我使用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