RadWIndow Silverlight

6 posts, 1 answers
  1. Bob
    Bob avatar
    4 posts
    Member since:
    Jul 2008

    Posted 29 Jul 2008 Link to this post

    I would like to use the RadWindow for an about box.  I cannot find documentation on how to populate the window with controls or text.  Is there an documentation or samples for RadWindow ?

    Bob
  2. Valio
    Valio avatar
    102 posts
    Member since:
    Jun 2006

    Posted 29 Jul 2008 Link to this post

    Hi Bob,

    You can see how to use RadWindow from our online examples site:
    http://www.telerik.com/demos/silverlight/#Examples/Window/FirstLook

    Basically - everything you place between the <RadWindow opening and closing tags will be displayed in the window:
        <telerik:RadWindow x:Name="window" Header="RadWindow" WindowStartupLocation="CenterParent" TopOffset="-50" WindowAnimation="OnShow">  
                <Image Source="../../Common/Images/RadWindow/Window.png"/>          
        </telerik:RadWindow> 

    Let us know if you have any other questions.

    Best Regards,
    Valentin Stoychev
    Telerik
  3. DevCraft banner
  4. Bob
    Bob avatar
    4 posts
    Member since:
    Jul 2008

    Posted 29 Jul 2008 Link to this post

    Thank you for the quick reply.  I need to be able to add items programatically from the code behind.  I tried adding a stack panel to the comments as well as a contentcontrol that had the stack panel added to it.  I both cases I had a number of abends.  How does one access the children of the Window via the code behind ?

    Bob
  5. Bob
    Bob avatar
    4 posts
    Member since:
    Jul 2008

    Posted 29 Jul 2008 Link to this post

    I think I can see how to do this.  I created the window in the xaml and added a child element of type StackPanel.  In the code behind I can now add items to the stack panel.  I just don't seem to be able to completely build the control in the code behind which would be the preference.

    Bob
  6. Answer
    Valio
    Valio avatar
    102 posts
    Member since:
    Jun 2006

    Posted 29 Jul 2008 Link to this post

    Hi Bob,

    you need to set the Content property of RadWindow. This is a sample code:
    RadWindow window = new RadWindow();  
    Image img = new Image();  
    img.Source = new BitmapImage(new Uri(@"Window.png", UriKind.RelativeOrAbsolute));  
    window.Content = img;  
     

    Basically the RadWindow is a HeaderedContentControl, which means that you can set any content you like to its Content property (including StackPanel). More info on HeaderedContentControls is available here:
    http://msdn.microsoft.com/en-us/library/system.windows.controls.headeredcontentcontrol.aspx

    Best,
    Valentin Stoychev
    Telerik
  7. Valio
    Valio avatar
    102 posts
    Member since:
    Jun 2006

    Posted 29 Jul 2008 Link to this post

    Bob,

    you can find more info on how to create dynamicaly the RadWindow in this example:
    http://www.telerik.com/demos/silverlight/#Examples/Window/Configurator

    Check-out the c# code of the sample.

    Let us know if we can help you further.

    Best,
    Valentin Stoychev
    Telerik
Back to Top
DevCraft banner