Thursday, September 13, 2012

How do you set the conent of a Silverlight element to a view?

How do you set the conent of a Silverlight element to a view?

I am updating some xaml I have written to instead use the code behind due to an issue cropping up.

Pane refers to a Telerik RadPane object. What I need to do semantically is :

pane.Content = PaneView.xaml; 

PaneView being a xaml file containing multiple elements and info. This will not work.

I had this working as follows in the previous xaml file, so it is possible to do; though I don't know how. Can anyone help ?

<UserControl x:vws="MyProject.ViewFolder.Views"> ...          <telerik:RadPane Header="PaneView" CanUserClose="False" CanFloat="False"                                      telerik:RadDocking.SerializationTag="PaneView">                         <vws:PaneView />         </telerik:RadPane> 

What wrapper do I need to put my xaml file in to force this to work?

Thanks very much

Answers & Comments...

Answer: 1

If your RadPane control (the XAML) is defined as x:Class="SomeNameSpaceHere.PaneView" you can set the content pretty simply via:

pane.Content = new PaneView(); 

You can use a simple UserControl as a container:

<UserControl x:Class="SomeNameSpaceHere.PaneView">   ... </UserControl> 
by : Jeddixhttp://stackoverflow.com/users/869120




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog