martinj
Topic Author
Posts: 19
Joined: 20 Mar 2012, 15:38

How to bind to add/remove grid columns from ViewModel

05 Sep 2014, 15:02

Hi,

I'm designing a UserControl that uses a Grid to layout its visual sub elements.
I'd like to have a Model that describes the number of visual elements to be displayed and a ViewModel that makes that happen.

I'm not sure how to proceed. I cannot see any way to bind to the Columndefinition collection, and I'm not really sure how I to do this otherwise.

I found an approach here:
http://rachel53461.wordpress.com/2011/0 ... roperties/
Is this possible in Noesis today? (seems overly complex for such a simple task?)
 
User avatar
sfernandez
Site Admin
Posts: 1915
Joined: 22 Dec 2011, 19:20

Re: How to bind to add/remove grid columns from ViewModel

09 Sep 2014, 15:45

Hi,

I'm curious how will you assign to each sub-element its corresponding Grid.Row and Grid.Column. Maybe you already have code in your UserControl where you can manage the collection of columns and rows, and add/remove them accordingly.

Anyway, it shouldn't be a problem to implement a similar approach to the one exposed in your link. I will help you with these task if you find any problems.
 
martinj
Topic Author
Posts: 19
Joined: 20 Mar 2012, 15:38

Re: How to bind to add/remove grid columns from ViewModel

10 Sep 2014, 14:42

Thanks for the answer. I got it working, but decided to take another approach. I'll probably get back to you when I get a bit further down that path :)

Who is online

Users browsing this forum: No registered users and 0 guests