Window + DataBinding + ItemsControl

3 posts, 0 answers
  1. Mark
    Mark avatar
    12 posts
    Member since:
    May 2009

    Posted 17 Sep 2009 Link to this post

    My requirements are to have a dashboard like experience utilizing windows so that users can move these windows around the screen as they see fit.

    The setup is very MVVM... instead of adding windows through code I have been trying to utilize an items control bound to my list of "windows". This items controls' generated item template is a RadWindow.

    1. The windows never appear.
    2. If I call 'Show' in the windows loaded event I get an exception stating that the window can have only one parent.
    3. I know the test case is sound as when I utilize a simple stack panel in the item template all is well.

    question... is Window + DataBinding + ItemsControl possible?

  2. Kaloyan
    Kaloyan avatar
    920 posts

    Posted 23 Sep 2009 Link to this post

    Hello Mark,

    Could you please share some code with us so that we can try to reproduce the problem and resolve it? I tried the code snippet bellow and it seemed to be working fine.

     <ItemsControl x:Name="itemsControl"
                            <telerikNavigation:RadWindow Loaded="RadWindow_Loaded"
                                <Button Content="some content" Width="100" Height="25" /> 
    private void RadWindow_Loaded(object sender, System.Windows.RoutedEventArgs e) 
                var window = sender as RadWindow; 

    What am I missing?

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft R3 2016 release webinar banner
  4. Mark
    Mark avatar
    12 posts
    Member since:
    May 2009

    Posted 23 Sep 2009 Link to this post

    Interesting... not sure if it was the solution but having wrapped the window in a stackpanel is what fixes the issue. (a hint from you example).

    works now!
Back to Top