我使用WPF中的功能区控件,我注意到有2个不同的版本。WPF窗口边框行事奇怪与功能区控制
using Microsoft.Windows.Controls.Ribbon;
- 如果我在我的xaml和class中使用这个窗口,我的整个窗口将会处于非常旧的windows风格。
using System.Windows.Controls.Ribbon;
- 如果我在我的xaml和类中使用这个,我的Ribbontabs突然不会正确填充了。
当我使用这两者。有了这个:
<ribbon:RibbonWindow x:Class="WPSDashboard.Views.ShellWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="clr-namespace:System.Windows.Controls.Ribbon;assembly=System.Windows.Controls.Ribbon"
xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
Title="WPSDashboard"
x:Name="RibbonWindow"
Width="640" Height="480">
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Ribbon Region -->
<r:Ribbon x:Name="Ribbon" prism:RegionManager.RegionName="RibbonRegion">
<r:Ribbon.ApplicationMenu>
<r:RibbonApplicationMenu SmallImageSource="Images\SmallIcon.png">
<r:RibbonApplicationMenuItem Header="Exit"
x:Name="MenuItemExit"
ImageSource="Images\Exit.png"
Command="{Binding ExitCommand}"/>
</r:RibbonApplicationMenu>
</r:Ribbon.ApplicationMenu>
</r:Ribbon>
<Grid x:Name="ClientArea" Grid.Row="1">
<!-- Workspace Region-->
<GridSplitter HorizontalAlignment="Left" Width="2" Grid.Column="1"/>
<ContentControl x:Name="WorkspaceRegion" Grid.Column="1" prism:RegionManager.RegionName="WorkspaceRegion" />
</Grid>
</Grid>
</ribbon:RibbonWindow>
我Ribbontabs将加载但窗口现在看起来像这样: 我不能点击关闭和最小化和最大化。 < ---
我怎样才能获得的边界是正常的,而不是小?
我无法用这种方法关闭我的窗户。
这破坏了功能区窗口的快速链接。这不是一个完整的解决方案。 –
我不知道这是如何修复了,但我看到你的评论,并回到这个旧项目。我注意到我不必使用-22的余量来工作。我会编辑我的答案。 – MCollard
如果您再次尝试此解决方案,那将会很好。我编辑了答案。如果这种情况在你的情况下不起作用,那么肯定会出现其他问题。这只是我的问题的解决方案。 – MCollard