Bug Report T300263
Visible to All Users

DXRibbonWindow cannot be minimized/maximized if it was created in code behind

created 9 years ago

Dear

I have created a sample solution to mimic our way of working (our solution is very much driven by datatemplates).

If you run the application and press the button to open a window, you will notice that you can maximize the screen. However the button to restore is is faulty.

Do you have any idea what the problem is here?

This is marked as urgent, because we will release in a few days.

Thank you in advance for your assistance.

Comments (3)
Kirill (DevExpress Support) 9 years ago

    Hello,
    I've reproduced this issue and forwarded it to our R&D team for further research. Follow our notifications to be informed about our progress.

    Thanks,
    Kirill

    CB CB
    Costin Bobirsc 9 years ago

      I see you have changed my question. I would like to point out that the reverse is also true.
      Eg if you open the window in a maximized state, you will be able to restore it once. The button will not allow you to maximize it again.

      Kirill (DevExpress Support) 9 years ago

        Hello,
        Thank you for this point. I've successfully reproduced this issue too and modified the subject accordingly.

        Thanks,
        Kirill

        Answers approved by DevExpress Support

        created 9 years ago (modified 9 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Show previous comments (2)
          DevExpress Support Team 9 years ago

            Hi Costin,
            The issue was fixed in the DataTemplate with the "dxrt:RibbonThemeKey ResourceKey=FloatingContainerTemplate"key in the RibbonWindow.xaml file. You can correct it manually for your custom theme. Add the following trigger to the DataTemplate.Triggers:

            XAML
            <Trigger Property="dxr:RibbonControlHelper.IsAutoHide" Value="True"> <Setter TargetName="PART_Restore" Property="Visibility" Value="Collapsed"/> <Setter TargetName="PART_Maximize" Property="Visibility" Value="Collapsed"/> <Setter TargetName="Part_WindowContent" Property="Margin" Value="0"/> </Trigger>

            Also, find the buttons in the stack panel whose styles have the "dxrt:DXRibbonWindowThemeKey ResourceKey=MaximizeButtonStyle" and "dxrt:DXRibbonWindowThemeKey ResourceKey=RestoreButtonStyle" keys and modify them in the following manner:

            XAML
            <Button Style="{DynamicResource {dxrt:DXRibbonWindowThemeKey ResourceKey=MaximizeButtonStyle}}" Visibility="{Binding Path=(dxc:FloatingContainer.IsMaximized), Converter={dxc:BooleanToVisibilityConverter Invert=False}}" /> <Button Style="{DynamicResource {dxrt:DXRibbonWindowThemeKey ResourceKey=RestoreButtonStyle}}" Visibility="{Binding Path=(dxc:FloatingContainer.IsMaximized), Converter={dxc:BooleanToVisibilityConverter Invert=True}}" />

            By the way, this is not a bug because you created your custom theme based on the theme with this bug. We have fixed the bug, but in the custom theme, it still exists. That's why it is necessary to correct the DataTemplate.
            Thanks,
            Nadya

            CB CB
            Costin Bobirsc 9 years ago

              Dear Nadya,
              Thank you for the information.
              I made a theme based on a working version. I upgraded using your tool to a version which apparently has a flaw in it. You release a new fixed version and somehow I cannot upgrade my theme to the fixed version.
              This … is not my fault. I consider this an issue on your side.
              However, thank you again for you assistance in the matter. For me, the issue is resolved :-)

              Kirill (DevExpress Support) 9 years ago

                Hello,

                As this issue isn't directly related to the original question, I created a separate ticket on your behalf: T311841: How to upgrade a custom theme to the current version after a hotfix was installed. This ticket is currently in our processing queue.

                Thanks,
                Kirill

                Other Answers

                created 9 years ago (modified 9 years ago)

                As a workaround for people who cannot upgrade immediately, you can use a contentcontrol as a wrapper

                C#
                window.Content = new ContentControl() {Content = viewModel};
                  Comments (3)
                  DevExpress Support Team 9 years ago

                    Hello Costin,

                    Thank you for providing the work around for this issue. I believe that it will be useful to other users who might face the same issue.

                    Thanks,
                    Elliot

                    CB CB
                    Costin Bobirsc 9 years ago

                      With pleasure! Could someone take a look at my comment on the theme? :-) (see other solution)

                      Kirill (DevExpress Support) 9 years ago

                        Of course, Costin. Please take another moment to review my comment above regarding the issue with the theme upgrade.

                        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.