How to bind to add/remove grid columns from ViewModel
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?)
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?)
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: How to bind to add/remove grid columns from ViewModel
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.
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.
Re: How to bind to add/remove grid columns from ViewModel
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 81 guests