简体   繁体   English

WPF。 这是否可以在某些上下文上方显示 Dock 窗口(不包括使用自动隐藏状态)?

[英]WPF. Is this possible to show Dock window above some context(exclude using Auto Hide state)?

This is Dashboard View这是仪表板视图

在此处输入图片说明

Goal: Settings button must open dock window(Syncfusion`s UI control) where settings of app are loaded if dock window hidden.目标:设置按钮必须打开停靠窗口(Syncfusion 的 UI 控件),如果停靠窗口隐藏,则加载应用程序的设置。 Otherwise, close dock window.否则,关闭停靠窗口。 And dock window must appear above Dashboard.并且停靠窗口必须出现在仪表板上方。 Dock window must disappear only by pressing Settings button.停靠窗口必须仅通过按设置按钮消失。

I have done this partially.我已经部分地做到了这一点。 Settings button open and close dock window.设置按钮打开和关闭停靠窗口。 Appearance and disappearance occur only by pressing Settings button but when dock window appears the layout of the view become like this(Dock state in use):只有按下设置按钮才会出现和消失,但是当停靠窗口出现时,视图的布局变成这样(使用停靠状态):

在此处输入图片说明

The only way I found to realize appearance of dock window above Dashboard is using AutoHide state.我发现实现 Dashboard 上方停靠窗口外观的唯一方法是使用 AutoHide 状态。 But in this case dock window disappear automatically if you move mouse from dock window.但在这种情况下,如果您从停靠窗口移动鼠标,停靠窗口会自动消失。

In case if you will need in XAML of Dashboard View:如果您需要在仪表板视图的 XAML 中:

<syncfusion:DockingManager>
    <syncfusion:DockingManager.ClientControl>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="2*"/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <Border Grid.Row="1">
                <ContentControl prism:RegionManager.RegionName="OrdersRegion"/>
            </Border>

            <Border Grid.Column="1" Grid.Row="1">
                <TextBlock Text="Customers region" FontSize="20"/>
            </Border>

            <Border Grid.Column="2" Grid.Row="1">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>

                    <Border>
                        <TextBlock Text="Employees region" FontSize="15"/>
                    </Border>

                    <Border Grid.Row="1">
                        <TextBlock Text="Products region" FontSize="15"/>
                    </Border>
                </Grid>
            </Border>
        </Grid>
    </syncfusion:DockingManager.ClientControl>

    <ContentControl prism:RegionManager.RegionName="OrdersSettingsRegion" 
                    syncfusion:DockingManager.SideInDockedMode="Right"
                    syncfusion:DockingManager.State="{Binding CurrentDockState}"
                    syncfusion:DockingManager.DesiredWidthInDockedMode="400"/>
</syncfusion:DockingManager>

Is it possible to achieve my goal fully?是否有可能完全实现我的目标? If yes, please show how to do it.如果是,请说明如何操作。

I don't use SyncFusion so this may not be relevant.我不使用 SyncFusion 所以这可能不相关。 but using raw WPF this would be a simple case of placing your settings panel in it's own grid above the main display so that it doesn't affect layout.但是使用原始 WPF 这将是一个简单的例子,将您的设置面板放在主显示上方的自己的网格中,这样它就不会影响布局。 eg.例如。

<Grid>
   <MainDisplay>

   <!-- this will appear above MainDisplay -->
   <SettingsPanel Horizontal Alignment="Right" />
<Grid>

Thanks for contacting Syncfusion support.感谢您联系 Syncfusion 支持。

We have checked your query regarding “ Dock window disappear automatically if you move mouse from dock window ”.我们已经检查了您关于“如果您从停靠窗口移动鼠标,停靠窗口自动消失”的查询。

We have attached a simple video to use NativeFloatWindow at middle of Dashboard by clicking the Setting button using SetFloatingWindowRect property and to hide the same window when the button is pressed again.我们附加了一个简单的视频,通过单击使用 SetFloatingWindowRect 属性的设置按钮在仪表板中间使用 NativeFloatWindow,并在再次按下按钮时隐藏相同的窗口。

Sample link: https://www.syncfusion.com/downloads/support/directtrac/257566/ze/DockingDashBoard-1248510496示例链接: https : //www.syncfusion.com/downloads/support/directtrac/257566/ze/DockingDashBoard-1248510496
Video link : https://www.syncfusion.com/downloads/support/directtrac/257566/ze/Float856501553视频链接: https : //www.syncfusion.com/downloads/support/directtrac/257566/ze/Float856501553

When window is in AutoHidden mode, the window is open when focus within that window.当窗口处于自动隐藏模式时,当焦点位于该窗口内时,该窗口是打开的。 When focus is lost(click outside the AutoHidden window), window will be hidden automatically.当焦点丢失时(在 AutoHidden 窗口外单击),窗口将自动隐藏。 Please refer the attached video.请参考随附的视频。

Video link : https://www.syncfusion.com/downloads/support/directtrac/257566/ze/ScreenCapture_12-10-2019_1.59PM1683466041视频链接: https : //www.syncfusion.com/downloads/support/directtrac/257566/ze/ScreenCapture_12-10-2019_1.59PM1683466041

You can switch a window from AutoHidden mode to Dock state, click the pin button.您可以将窗口从 AutoHidden 模式切换到 Dock 状态,单击 pin 按钮。 When pinning or docking, the layout of other dock windows will be changed to allocate space for docked window.固定或停靠时,其他停靠窗口的布局将更改为停靠窗口分配空间。 You can click the pin button again to change the state from Dock to AutoHide.您可以再次单击固定按钮将状态从 Dock 更改为 AutoHide。

Video link: https://www.syncfusion.com/downloads/support/directtrac/257566/ze/DockAndAutoHide1206235360视频链接: https : //www.syncfusion.com/downloads/support/directtrac/257566/ze/DockAndAutoHide1206235360

Regards, Niranjan Kumar问候, 尼兰詹·库马尔

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM