WPF DevComponents Dock 控件不会填满屏幕
我正在使用 DevComponents 第三方控件创建一个屏幕,其中多个对接组件组织成三行,最后一行有三列。我已经成功创建了这个布局,但是我不知道如何将 DockSite 的高度扩展到屏幕边框。
我已经发布了下面的 XAML:
<UserControl x:Class="Docking_UC"
xmlns:my="clr-namespace:DevComponents.WpfDock;assembly=DevComponents.WpfDock"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="714" Width="1057">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="83"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid HorizontalAlignment="Stretch" Margin="0" Name="bodyGrid" Width="Auto" Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="71" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<WrapPanel>
<Label>Dock Test #</Label>
<Label>1</Label>
</WrapPanel>
<Rectangle Height="12" Name="menuRectangle" Stroke="Black" VerticalAlignment="Bottom" Fill="SteelBlue" Opacity="0.25" Grid.Row="1" />
</Grid>
<my:DockSite Background="Transparent" Name="dashDockSiteAll" Grid.Row="1">
<my:DockSite.SplitPanels>
<my:SplitPanel Orientation="Vertical" my:DockSite.Dock="Top" my:DockSite.DockSize="714">
<my:SplitPanel Orientation="Vertical">
<my:DockWindowGroup my:SplitPanel.RelativeSize="50,135">
<my:DockWindow Header="Top" Name="dockWindowTop">
<Label>2</Label>
</my:DockWindow>
</my:DockWindowGroup>
<my:DockWindowGroup my:SplitPanel.RelativeSize="50,220">
<my:DockWindow Header="MidWindowTab1" Name="dockWindowMid1">
<Label>3</Label>
</my:DockWindow>
<my:DockWindow Header="MidWindowTab2" Name="dockWindowMid2">
<Label>4</Label>
</my:DockWindow>
</my:DockWindowGroup>
<my:DockWindowGroup my:SplitPanel.RelativeSize="50,150">
<my:DockWindow Header="Bottom" Name="dockWindowBottom">
<my:SplitPanel Orientation="Horizontal" my:SplitPanel.RelativeSize="50,150">
<my:DockWindowGroup>
<my:DockWindow Header="BottomLeft">
<Label>5</Label>
</my:DockWindow>
</my:DockWindowGroup>
<my:DockWindowGroup>
<my:DockWindow Header="BottomMid">
<Label>6</Label>
</my:DockWindow>
</my:DockWindowGroup>
<my:DockWindowGroup>
<my:DockWindow Header="BottomRight">
<Label>7</Label>
</my:DockWindow>
</my:DockWindowGroup>
</my:SplitPanel>
</my:DockWindow>
</my:DockWindowGroup>
</my:SplitPanel>
</my:SplitPanel>
</my:DockSite.SplitPanels>
</my:DockSite>
</Grid>
我尝试删除 DockSite.Site 属性,但 DockSite 默认为左侧停靠。此外,将一个窗口停靠到底部站点后,仍然存在一个关于光标高度的空白区域,我无法删除该空白区域。
I am using the DevComponents third-party control to create a screen with multiple docking components organized in three rows, the last row having three columns. I have been successful in creating this layout, however I cannot figure out how to expand the height of the DockSite to the borders of the screen.
I have posted the XAML below:
<UserControl x:Class="Docking_UC"
xmlns:my="clr-namespace:DevComponents.WpfDock;assembly=DevComponents.WpfDock"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="714" Width="1057">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" MinHeight="83"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid HorizontalAlignment="Stretch" Margin="0" Name="bodyGrid" Width="Auto" Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="71" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<WrapPanel>
<Label>Dock Test #</Label>
<Label>1</Label>
</WrapPanel>
<Rectangle Height="12" Name="menuRectangle" Stroke="Black" VerticalAlignment="Bottom" Fill="SteelBlue" Opacity="0.25" Grid.Row="1" />
</Grid>
<my:DockSite Background="Transparent" Name="dashDockSiteAll" Grid.Row="1">
<my:DockSite.SplitPanels>
<my:SplitPanel Orientation="Vertical" my:DockSite.Dock="Top" my:DockSite.DockSize="714">
<my:SplitPanel Orientation="Vertical">
<my:DockWindowGroup my:SplitPanel.RelativeSize="50,135">
<my:DockWindow Header="Top" Name="dockWindowTop">
<Label>2</Label>
</my:DockWindow>
</my:DockWindowGroup>
<my:DockWindowGroup my:SplitPanel.RelativeSize="50,220">
<my:DockWindow Header="MidWindowTab1" Name="dockWindowMid1">
<Label>3</Label>
</my:DockWindow>
<my:DockWindow Header="MidWindowTab2" Name="dockWindowMid2">
<Label>4</Label>
</my:DockWindow>
</my:DockWindowGroup>
<my:DockWindowGroup my:SplitPanel.RelativeSize="50,150">
<my:DockWindow Header="Bottom" Name="dockWindowBottom">
<my:SplitPanel Orientation="Horizontal" my:SplitPanel.RelativeSize="50,150">
<my:DockWindowGroup>
<my:DockWindow Header="BottomLeft">
<Label>5</Label>
</my:DockWindow>
</my:DockWindowGroup>
<my:DockWindowGroup>
<my:DockWindow Header="BottomMid">
<Label>6</Label>
</my:DockWindow>
</my:DockWindowGroup>
<my:DockWindowGroup>
<my:DockWindow Header="BottomRight">
<Label>7</Label>
</my:DockWindow>
</my:DockWindowGroup>
</my:SplitPanel>
</my:DockWindow>
</my:DockWindowGroup>
</my:SplitPanel>
</my:SplitPanel>
</my:DockSite.SplitPanels>
</my:DockSite>
</Grid>
I have tried removing the DockSite.Site property but then the DockSite defaults to a Left Docked. Also, upon docking one window to the Bottom site there still remains an empty area about the height of the cursor that I cannot remove.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,经过一天的故障排除/摆弄控件后,我终于发现了我一直在努力实现的目标。我已将 my:SplitPanel 添加到标记外部的 DockSite,显然此 SplitPanel 会自动停靠到剩余的空白区域。
更正后的代码如下,并且添加内容被粗俗地标记:
希望这可以帮助其他遇到相同问题的人。
另外,如果有足够声誉的人读到了这篇文章,请您添加一个 DevComponents 标签吗?
OK, so after another day of troubleshooting/messing around with the control I finally discovered what I have been trying to accomplish. I have added a my:SplitPanel to the DockSite outside of the tag and apparently this SplitPanel will automatically dock to the remaining white space.
The corrected code is below and the additions are obscenely tabbed over:
Hope this helps anyone else having the same issue.
Also, if anyone with enough reputation reads this, would you please add a DevComponents tag?