This is a migrated thread and some comments may be shown as answers.

Can one declare everything at runtime?

0 Answers 31 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 01 Jul 2011, 02:30 PM

Is XAML really necessary?  If someone really wanted to, could everything displayed on a Silverlight page be declared at runtime in the C# code?
VISIFire has example code where they set up one of their classes, chart, in the C# code and then simply add it to the user interface with a simple C# call:

LayoutRoot.Children.Add(chart);
How would I do a similar creation with a class I already have defined in the XAML file but because of other reasons I need to declare it at runtime?  If I could use it as it is in XAML I think it would work because there are no errors with its display.  It is declared like this:

 

 <views:PrescriberPage01 x:Name="DashboardPrescriberPage01" Visibility="Collapsed" SelectedProduct="{Binding SelectedProduct, Mode=TwoWay}"Grid.Row ="0"/>

 

How would I declare that in C# code?

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
William
Top achievements
Rank 1
Share this question
or