Dock breaks application

5 posts, 1 answers
  1. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 08 Apr 2015 Link to this post

    Hi,

     

    I have a problem with RadDock.

    And I managed to reproduce it in a very small sample.

    To explain what's going on - I serialize a RadDock when I leave a view - and restore it later when I come back (load again) to this view.

    In the real application I store the values in a database - the attached sample uses simply a string to show the behavior.
    I also found a post (which may be about the same problem).

    http://www.telerik.com/forums/problem-with-loading-layout#4kMNn5jNsEuXcZtbd0k4-w

    But this post is pretty old (2011) and there is a statement: "We will fix this problem with loading the layout in our future releases."

    So I guess my problem is something different.

    To show that the solution in general works try:

    Move one window to the right side of the document pane.
    Click V2 (which shows View 2) - Click V1 - and see the restored pane.
    Drag the window out of the Dock to see it "free floating" - again switch the views - everything works fine.

    To reproduce the problem do:
    Close the floating window and switch the view.
    Although the code runs and "CurVM" is set to the different view nothing happens.

    In simple words - store / restore fails if I have a closed floating window.

     

    Regards

    Manfred

     

  2. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 08 Apr 2015 Link to this post

    About the attachment - the GIF is a zip containing a sample project showing the issue.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Nasko
    Admin
    Nasko avatar
    585 posts

    Posted 09 Apr 2015 Link to this post

    Hi Manfred,

    We tested the provided sample project and your Save/Load layout implementation of RadDocking is working as expected. However, after further investigation we notice that the IsHidden property of the Pane is not bound properly. So, when you close a Pane (set IsHidden to true)  by pressing the close button in the Header the value of the Pane is not set as expected. You could check that by removing the IsHidden property from the Panes - everything should work as expected.

    We hope this will help you.

    Regards,
    Nasko
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  5. ManniAT
    ManniAT avatar
    877 posts
    Member since:
    Nov 2003

    Posted 09 Apr 2015 in reply to Nasko Link to this post

    Hi,

    thank you for the answer.

    Yes - when I remove the binding it works.

    BUT - the binding works - as long as I don't hide a floating window.

    And after that nothing works.
    So it seems as if serialization / deserialization breaks the binding somehow.

    I also found this thread - http://www.telerik.com/forums/462812-binding-not-working-on-ishidden-in-radpane

    Although not useful for me (I need a binding to the ViewModel) I tried the last approach there which is giving the control a name and bind to a property of the control.

     

    <telerik:RadToggleButton x:Name="bntFeatures" Content="Features" Margin="6,2" Height="24" />
     
    ...
     
        <telerik:RadPane  Header="Features" IsHidden="{Binding IsChecked, ElementName=bntFeatures, Mode=TwoWay}" CanDockInDocumentHost="False" telerik:RadDocking.SerializationTag="DirectMaterialPane">
                            <telerik:RadPane.Content>
    ..

    This works "partial".

    When I make the window floating - hide it and switch the view I get:
    a.) the button unchecked (but the window hidden)
    --when I click on the button it get's checked
    --when I click again the button is unchecked and the window visible again

    Anyhow - you say
    a.) my binding is wrong
    b.) remove the binding - everything should work as expected

    For b.) definitely NO - expected is that the window is hidden / shown depending on a property in my ViewModel

    For a.) - can you tell me the correct binding to make it work?

    I found a lot of post about this problem here - but none of these solutions do really work.
    And - the bitter thing - most of these posts are old (2010, 2011) - and I can't find any working solution.
    Maybe you can give me a hint by changing my provided sample.

    Manfred

  6. Answer
    Nasko
    Admin
    Nasko avatar
    585 posts

    Posted 14 Apr 2015 Link to this post

    Hello Manfred,

    After further investigation of the issue we found that in a specific scenarios when the IsHidden property is bound to RadToggleButton's IsChecked property the binding gets broken when the Layout is saved and then loaded. This issue is a known one and it has already been logged in our internal backlog. Unfortunately, the only approach that we could suggest you is the one proposed by George in the forum post you found - to bind the Pane's IsHidden property to the IsChecked of the ToggleButton:
    <StackPanel Orientation="Horizontal">
        <telerik:RadToggleButton x:Name="toggleButton1" IsChecked="{Binding IsErrorWindowHidden, Mode=TwoWay, Converter={StaticResource bInvertedConverter}}" Content="Error" Margin="6,2" Height="24" />
    </StackPanel>
    <telerik:RadDocking Grid.Row="1" x:Name="rDock">
    ...
        <telerik:RadPane Header="Errors" IsHidden="{Binding IsChecked, ElementName=toggleButton1, Mode=TwoWay}" CanDockInDocumentHost="False" telerik:RadDocking.SerializationTag="ErrorPane"/>
    ...
    </telerik:RadDocking>

    We apologize for any caused inconvenience. 

    Regards,
    Nasko
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready