Hi,
we developed a sort of wizard control that allows user to create an object with the information collect during the wizard "life".
It's a standard Silverlight user control, with a grid as a container. The developer just have to define the pages and the objects that go within those pages.
Now, we are facing a big problem, when we try to access the objects, they're always null :(
We improved the FindByName to overcome this (based on the example of the VisualTreeWalker), we get the object on run-time by name, we create a "proxy" in development time, and work with these proxies instead of working with the controls directly.
This is a major pain, we have pages with 20 controls and we have to create 20 temporary objects. Just to get the text defined in a text box we have to:
Create a proxy like: TextBox textBoxNameInternal;
Then get the instance: textBoxNameInternal = VisualTreeWalker.FindName<TextBox>("textBoxName", gridPage);
Only then we can do: textBoxNameInternal.Text;
Imagine this multiplied by several wizards, by several controls on each wizard page and you can imagine how this can delay the development. :(
Did any of you have ever faced a similar problem? Did you manage to overcome this?
Thanks,
L. Pinho
we developed a sort of wizard control that allows user to create an object with the information collect during the wizard "life".
It's a standard Silverlight user control, with a grid as a container. The developer just have to define the pages and the objects that go within those pages.
Now, we are facing a big problem, when we try to access the objects, they're always null :(
We improved the FindByName to overcome this (based on the example of the VisualTreeWalker), we get the object on run-time by name, we create a "proxy" in development time, and work with these proxies instead of working with the controls directly.
This is a major pain, we have pages with 20 controls and we have to create 20 temporary objects. Just to get the text defined in a text box we have to:
Create a proxy like: TextBox textBoxNameInternal;
Then get the instance: textBoxNameInternal = VisualTreeWalker.FindName<TextBox>("textBoxName", gridPage);
Only then we can do: textBoxNameInternal.Text;
Imagine this multiplied by several wizards, by several controls on each wizard page and you can imagine how this can delay the development. :(
Did any of you have ever faced a similar problem? Did you manage to overcome this?
Thanks,
L. Pinho