add NavigationWindow style

This commit is contained in:
NaBian committed 2020-02-07 20:47:32 +08:00
1 parent 955894e265
commit 2544e84223
24 files changed
+293 -10

No files matched your search

@@ -72,6 +72,7 @@ namespace HandyControlDemo
}
ConfigHelper.Instance.SetWindowDefaultStyle();
ConfigHelper.Instance.SetNavigationWindowDefaultStyle();
ConfigHelper.Instance.SetSystemVersionInfo(CommonHelper.GetSystemVersionInfo());
ServicePointManager.SecurityProtocol = (SecurityProtocolType)(SslProtocols)0x00000C00;
@@ -29,7 +29,8 @@
[ "FlowDocument", "FlowDocumentDemoCtl", "WPFFlowDocument_16x", "1" ],
[ "ToolBar", "ToolBarDemoCtl", "ToolBar_16x", "" ],
[ "Border", "BorderDemoCtl", "BorderElement_16x", "" ],
[ "Label", "LabelDemoCtl", "Label_16x", "" ]
[ "Label", "LabelDemoCtl", "Label_16x", "" ],
[ "Window", "NativeWindowDemoCtl", "WindowsForm_16x", "1" ]
]
},
{
@@ -70,7 +71,7 @@
[ "Divider", "DividerDemoCtl", "DottedSplitter_16x", "" ],
[ "CirclePanel", "CirclePanelDemoCtl", "ColorWheel_16x", "" ],
[ "Grid", "GridDemoCtl", "GridPane_16x", "" ],
[ "RelativePanel", "RelativePanelDemoCtl", "TransformRelative_16x", "1" ],
[ "RelativePanel", "RelativePanelDemoCtl", "TransformRelative_16x", "" ],
[ "WaterfallPanel", "WaterfallPanelDemoCtl", "Panel_16x", "" ],
[ "HoneycombPanel", "HoneycombPanelDemoCtl", "PolygonHexagon_16x", "" ],
[ "TransitioningContentControl", "TransitioningContentControlDemoCtl", "TransitioningContentControl_16x", "" ],
@@ -42,5 +42,9 @@
public static readonly string GlowWindow = nameof(GlowWindow);
public static readonly string NativeCommonWindow = nameof(NativeCommonWindow);
public static readonly string NavigationWindow = nameof(NavigationWindow);
}
}
@@ -23,7 +23,9 @@ var messageList = new List<string>
"CustomNonClientAreaWindow",
"NoNonClientAreaDragableWindow",
"QQGroupView",
"GlowWindow"
"GlowWindow",
"NativeCommonWindow",
"NavigationWindow"
};
#>
namespace HandyControlDemo.Data
@@ -332,6 +332,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\NativeTextBoxDemoCtl.xaml.cs">
<DependentUpon>NativeTextBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\NativeWindowDemoCtl.xaml.cs">
<DependentUpon>NativeWindowDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\RadioButtonDemoCtl.xaml.cs">
<DependentUpon>RadioButtonDemoCtl.xaml</DependentUpon>
</Compile>
@@ -413,6 +416,12 @@
<Compile Include="$(MSBuildThisFileDirectory)Window\GrowlDemoWindow.xaml.cs">
<DependentUpon>GrowlDemoWindow.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Window\NativeCommonWindow.xaml.cs">
<DependentUpon>NativeCommonWindow.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Window\NavigationWindow.xaml.cs">
<DependentUpon>NavigationWindow.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Window\NoNonClientAreaDragableWindow.xaml.cs">
<DependentUpon>NoNonClientAreaDragableWindow.xaml</DependentUpon>
</Compile>
@@ -858,6 +867,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Styles\NativeWindowDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Styles\RadioButtonDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -934,6 +947,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Window\NativeCommonWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Window\NavigationWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Window\NoNonClientAreaDragableWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -1113,6 +1113,24 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 点击打开原生常规窗口 的本地化字符串。
/// </summary>
public static string OpenNativeCommonWindow {
get {
return ResourceManager.GetString("OpenNativeCommonWindow", resourceCulture);
}
}
/// <summary>
/// 查找类似 点击打开导航窗口 的本地化字符串。
/// </summary>
public static string OpenNavigationWindow {
get {
return ResourceManager.GetString("OpenNavigationWindow", resourceCulture);
}
}
/// <summary>
/// 查找类似 打开无非客户端区域可拖拽窗口 的本地化字符串。
/// </summary>
@@ -729,4 +729,10 @@
<data name="FlowDocumentReader" xml:space="preserve">
<value>FlowDocumentReader</value>
</data>
<data name="OpenNativeCommonWindow" xml:space="preserve">
<value>Open native common window</value>
</data>
<data name="OpenNavigationWindow" xml:space="preserve">
<value>Open navigation window</value>
</data>
</root>
@@ -729,4 +729,10 @@
<data name="FlowDocumentReader" xml:space="preserve">
<value>FlowDocumentReader</value>
</data>
<data name="OpenNativeCommonWindow" xml:space="preserve">
<value>Open native common window</value>
</data>
<data name="OpenNavigationWindow" xml:space="preserve">
<value>Open navigation window</value>
</data>
</root>
@@ -729,4 +729,10 @@
<data name="FlowDocumentReader" xml:space="preserve">
<value>FlowDocumentReader</value>
</data>
<data name="OpenNativeCommonWindow" xml:space="preserve">
<value>Open native common window</value>
</data>
<data name="OpenNavigationWindow" xml:space="preserve">
<value>Open navigation window</value>
</data>
</root>
@@ -729,4 +729,10 @@
<data name="FlowDocumentReader" xml:space="preserve">
<value>FlowDocumentReader</value>
</data>
<data name="OpenNativeCommonWindow" xml:space="preserve">
<value>Open native common window</value>
</data>
<data name="OpenNavigationWindow" xml:space="preserve">
<value>Open navigation window</value>
</data>
</root>
@@ -729,4 +729,10 @@
<data name="FlowDocumentReader" xml:space="preserve">
<value>流文档查看器</value>
</data>
<data name="OpenNativeCommonWindow" xml:space="preserve">
<value>点击打开原生常规窗口</value>
</data>
<data name="OpenNavigationWindow" xml:space="preserve">
<value>点击打开导航窗口</value>
</data>
</root>
@@ -0,0 +1,15 @@
<UserControl x:Class="HandyControlDemo.UserControl.NativeWindowDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:data="clr-namespace:HandyControlDemo.Data"
DataContext="{Binding WindowDemo,Source={StaticResource Locator}}"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="{DynamicResource RegionBrush}">
<hc:TransitioningContentControl>
<UniformGrid Margin="32" Columns="3" Rows="3" Height="200">
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.NativeCommonWindow}" Content="{x:Static langs:Lang.OpenNativeCommonWindow}"/>
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.NavigationWindow}" Content="{x:Static langs:Lang.OpenNavigationWindow}"/>
</UniformGrid>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class NativeWindowDemoCtl
{
public NativeWindowDemoCtl()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,10 @@
<Window x:Class="HandyControlDemo.Window.NativeCommonWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStartupLocation="CenterScreen"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Title="{x:Static langs:Lang.Title}"
Height="450"
Width="800"
Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
</Window>
@@ -0,0 +1,10 @@
namespace HandyControlDemo.Window
{
public partial class NativeCommonWindow
{
public NativeCommonWindow()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,10 @@
<NavigationWindow x:Class="HandyControlDemo.Window.NavigationWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStartupLocation="CenterScreen"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Title="{x:Static langs:Lang.Title}"
Height="450"
Width="800"
Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
</NavigationWindow>
@@ -0,0 +1,56 @@
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using HandyControl.Tools.Extension;
namespace HandyControlDemo.Window
{
public partial class NavigationWindow
{
private readonly List<Page> _pageList;
public NavigationWindow()
{
InitializeComponent();
AddHandler(ButtonBase.ClickEvent, new RoutedEventHandler(Button_Click));
_pageList = new List<Page>();
for (var i = 0; i < 5; i++)
{
_pageList.Add(CreatePage(i));
}
Navigate(_pageList[0]);
}
private Page CreatePage(int index)
{
var indexStr = index.ToString();
var button = new Button
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Content = indexStr,
Width = 320,
Tag = indexStr
};
return new Page
{
Title = indexStr,
Content = button
};
}
private void Button_Click(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is Button button && button.Tag is string tag)
{
var index = tag.Value<int>() + 1;
Navigate(index >= _pageList.Count ? _pageList[0] : _pageList[index]);
}
}
}
}
@@ -398,6 +398,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\NavigationWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\NavigationWindowBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\FlowDocumentBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -12,6 +12,7 @@
<Geometry o:Freeze="True" x:Key="LeftGeometry">M394.24 512L683.52 248.32c10.24-10.24 10.24-25.6 0-35.84-10.24-10.24-25.6-10.24-35.84 0l-307.2 279.04c-5.12 5.12-7.68 12.8-7.68 20.48 0 7.68 2.56 15.36 7.68 20.48l307.2 279.04c10.24 10.24 25.6 10.24 35.84 0 10.24-10.24 10.24-25.6 0-35.84L394.24 512z</Geometry>
<Geometry o:Freeze="True" x:Key="RightGeometry">M4.1666641,0 C5.2083321,0 6.25,0.41666794 7.0833321,1.25 L57.083331,46.666664 C57.916664,47.499998 58.33333,48.749998 58.333329,49.999998 58.33333,51.249997 57.916664,52.499997 57.083331,53.333331 L7.0833321,98.749996 C5.4166641,100.41666 2.9166641,100.41666 1.2499962,98.749996 -0.41666794,97.083328 -0.41666794,94.583328 1.2499962,92.916664 L48.333331,49.999998 1.2499962,7.0833321 C-0.41666794,5.4166641 -0.41666794,2.9166641 1.2499962,1.25 2.0833282,0.41666794 3.1249962,0 4.1666641,0 z</Geometry>
<Geometry o:Freeze="True" x:Key="RotateLeftGeometry">M165.238899 508.178506C164.450369 456.442676 171.767779 404.485842 187.244542 353.863631 266.138632 95.812692 533.436225-51.353028 784.380224 25.368251 1035.324219 102.08953 1174.62994 373.566359 1095.735851 631.617298 1016.84176 889.66824 749.544168 1036.833959 498.600172 960.11268 424.134741 937.346313 357.837833 896.870788 303.973868 842.276436 291.310328 829.441176 291.396506 808.495802 304.166356 795.493625 316.936205 782.491452 337.554042 782.356136 350.217582 795.191397 396.640587 842.243889 453.73137 877.098901 517.975091 896.740177 734.436966 962.919213 965.320335 835.802028 1033.557737 612.607541 1101.795139 389.413057 981.467179 154.919792 765.005305 88.740755 548.543428 22.561718 317.660056 149.678904 249.422655 372.873388 235.597198 418.094418 229.294871 464.461039 230.4403 510.559881L311.240978 429.759202C323.584094 417.416085 343.892513 417.712357 356.601099 430.420946 369.309686 443.129535 369.605959 463.437952 357.262842 475.781068L230.778782 602.265128C229.273826 605.769679 227.098877 609.041396 224.251145 611.889128 211.908029 624.232245 191.59961 623.935974 178.891024 611.227385L40.825428 473.16179C28.11684 460.453206 27.820569 440.144784 40.163685 427.801668 52.506801 415.458551 72.815218 415.754827 85.523806 428.463411L165.238899 508.178506Z</Geometry>
<Geometry o:Freeze="True" x:Key="RotateRightGeometry">M13.1117823382705,0.00108644926083379C18.7165758868546,0.0742913923738762 23.9197352191299,3.84162509632329 25.6893389483779,9.62980814885544 26.1165926715226,11.0273168346189 26.3185999652236,12.461670228202 26.296833302626,13.8899238456496L28.4974711200089,11.6892569876356C28.8483088275283,11.3384168617557 29.4089472552627,11.330238049977 29.7496950885147,11.6709881771838 30.0904429217666,12.0117402117628 30.0822642108291,12.572387459387 29.7314265033096,12.923229492639L25.9199488421768,16.7347560556155C25.5691111346572,17.0855980888674 25.0084688922257,17.0937769006462 24.6677210589736,16.7530248660672 24.5891077777236,16.674408708165 24.5290644427627,16.5840870073788 24.4875185748428,16.4873374624474L20.9957621356339,12.9955379708416C20.6550143023818,12.6547878436347 20.6631930133193,12.0941405960106 21.0140307208389,11.7432985627585 21.3648684283584,11.3924565295065 21.9255068560928,11.3842777177278 22.2662546893447,11.7250297523068L24.4968645831436,13.9556652415401C24.5284846087783,12.6830303030582 24.3545000811904,11.4030042974954 23.9728319903702,10.1546044295501 22.0890505572647,3.99295504901009 15.7152140399307,0.483677352708723 9.73950221742095,2.3106585349176 3.76379420960845,4.13763876344051 0.441986348280352,10.6112083411418 2.32576778138575,16.7728577216819 4.20954921449125,22.9345051948497 10.5833819171279,26.4437838448372 16.5590937396377,24.6168036163144 18.3326227923721,24.0745720467974 19.9086878558486,23.1123447593618 21.1902544757217,21.8133823630949 21.5398485919327,21.4590441166922 22.1090319415421,21.4627806587338 22.4615595599502,21.8217271162507 22.8140871783584,22.1806735737676 22.8164675494522,22.7589048852417 22.4668734332412,23.1132431316444 20.9798891803115,24.6204085496776 19.1496775409072,25.7378005615073 17.0939638873428,26.3663063881084 10.1663286944717,28.484321088751 2.78723170960845,24.4215726325395 0.609260823377952,17.2976520950044 -1.56871387754975,10.1737353722136 2.27700069154205,2.6791733248245 9.20463588441315,0.561156716809679 10.5035670062393,0.164028483596132 11.8183710833877,-0.0158071458708005 13.1117823382705,0.00108644926083379z</Geometry>
<Geometry o:Freeze="True" x:Key="EnlargeGeometry">M750.3 198.7C598 46.4 351.1 46.4 198.7 198.7s-152.3 399.2 0 551.5C345.1 896.6 578.8 902.3 732 767.3l172.1 172.1 35.4-35.4-172.1-171.9c135-153.2 129.3-387-17.1-533.4z m39.3 403.8c-17.1 42.1-42.2 80-74.7 112.4-32.5 32.5-70.3 57.6-112.4 74.7-40.7 16.5-83.8 24.9-128 24.9s-87.2-8.4-128-24.9c-42.1-17.1-80-42.2-112.4-74.7s-57.6-70.3-74.7-112.4c-16.5-40.7-24.9-83.8-24.9-128s8.4-87.2 24.9-128c17.1-42.1 42.2-80 74.7-112.4s70.3-57.6 112.4-74.7c40.7-16.5 83.8-24.9 128-24.9s87.2 8.4 128 24.9c42.1 17.1 80 42.2 112.4 74.7 32.5 32.5 57.6 70.3 74.7 112.4 16.5 40.7 24.9 83.8 24.9 128s-8.4 87.3-24.9 128zM671 502H496v175h-50V502H271v-50h175V277h50v175h175v50z</Geometry>
<Geometry o:Freeze="True" x:Key="ReduceGeometry">M750.3 198.7C598 46.4 351.1 46.4 198.7 198.7s-152.3 399.2 0 551.5C345.1 896.6 578.8 902.3 732 767.3l172.1 172.1 35.4-35.4-172.1-171.9c135-153.2 129.3-387-17.1-533.4z m39.3 403.8c-17.1 42.1-42.2 80-74.7 112.4-32.5 32.5-70.3 57.6-112.4 74.7-40.7 16.5-83.8 24.9-128 24.9s-87.2-8.4-128-24.9c-42.1-17.1-80-42.2-112.4-74.7s-57.6-70.3-74.7-112.4c-16.5-40.7-24.9-83.8-24.9-128s8.4-87.2 24.9-128c17.1-42.1 42.2-80 74.7-112.4s70.3-57.6 112.4-74.7c40.7-16.5 83.8-24.9 128-24.9s87.2 8.4 128 24.9c42.1 17.1 80 42.2 112.4 74.7 32.5 32.5 57.6 70.3 74.7 112.4 16.5 40.7 24.9 83.8 24.9 128s-8.4 87.3-24.9 128zM671 502H271v-50h400v50z</Geometry>
<Geometry o:Freeze="True" x:Key="DownloadGeometry">M868.100096 742.600704l-0.049152 0L216.246272 742.600704l-0.049152 0c-13.98784 0-25.327616 11.33568-25.327616 25.352192 0 13.993984 11.360256 25.327616 25.327616 25.327616l0.049152 0 651.804672 0 0.049152 0c13.996032 0 25.33376-11.333632 25.33376-25.327616C893.431808 753.936384 882.096128 742.600704 868.100096 742.600704L868.100096 742.600704 868.100096 742.600704M523.15136 688.433152c4.728832 4.757504 11.237376 7.733248 18.47296 7.733248l0 0 0 0c7.231488 0 13.740032-2.951168 18.42176-7.757824l314.836992-314.83904c4.732928-4.704256 7.714816-11.214848 7.7312-18.395136 0-14.342144-11.712512-25.9584-25.972736-25.9584-7.213056-0.02048-13.694976 2.930688-18.376704 7.636992L567.578624 607.51872 567.578624 117.52448c-0.024576-0.026624-0.024576-0.026624-0.024576-0.0512 0.024576-14.344192-11.59168-25.980928-25.901056-25.980928-14.348288 0-25.960448 11.634688-25.960448 25.980928 0 0 0 0.024576 0.024576 0.0512l0 489.967616L245.055488 336.826368c-4.683776-4.704256-11.2128-7.6288-18.374656-7.60832-14.342144-0.02048-25.954304 11.614208-26.005504 25.9072 0 7.20896 2.951168 13.768704 7.684096 18.423808L523.15136 688.433152 523.15136 688.433152 523.15136 688.433152M523.15136 688.433152 523.15136 688.433152z</Geometry>
@@ -0,0 +1,72 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Basic/Geometries.xaml"/>
<ResourceDictionary Source="MenuBaseStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="MenuItem4NavigationWindowStyle" BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem">
<Setter Property="Header" Value="{Binding (JournalEntry.Name)}"/>
<Setter Property="Command" Value="NavigationCommands.NavigateJournal"/>
<Setter Property="CommandTarget" Value="{Binding TemplatedParent, RelativeSource={RelativeSource AncestorType=ContextMenu}}"/>
<Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Self}}"/>
</Style>
<Style x:Key="NavigationWindowBaseStyle" TargetType="NavigationWindow">
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="NavigationWindow">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Top" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource DarkDefaultBrush}">
<controls:ButtonGroup x:Name="NavChrome" Width="90" Margin="10,6" HorizontalAlignment="Left">
<Button Padding="6" controls:IconElement.Geometry="{StaticResource LeftGeometry}" Command="NavigationCommands.BrowseBack">
<Button.ContextMenu>
<ContextMenu x:Name="BackNavMenu" ItemContainerStyle="{StaticResource MenuItem4NavigationWindowStyle}" ItemsSource="{Binding Path=(NavigationWindow.BackStack), RelativeSource={RelativeSource TemplatedParent}}"/>
</Button.ContextMenu>
</Button>
<Button Padding="6" controls:IconElement.Geometry="{StaticResource RightGeometry}" Command="NavigationCommands.BrowseForward">
<Button.ContextMenu>
<ContextMenu x:Name="ForwardNavMenu" ItemContainerStyle="{StaticResource MenuItem4NavigationWindowStyle}" ItemsSource="{Binding Path=(NavigationWindow.ForwardStack), RelativeSource={RelativeSource TemplatedParent}}"/>
</Button.ContextMenu>
</Button>
<Button Padding="6" controls:IconElement.Geometry="{StaticResource RotateRightGeometry}" Command="NavigationCommands.Refresh"/>
</controls:ButtonGroup>
</Border>
<controls:SimplePanel>
<AdornerDecorator>
<ContentPresenter x:Name="PART_NavWinCP" ClipToBounds="true"/>
</AdornerDecorator>
<ResizeGrip x:Name="WindowResizeGrip" HorizontalAlignment="Right" IsTabStop="false" Visibility="Collapsed" VerticalAlignment="Bottom"/>
</controls:SimplePanel>
</DockPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="ShowsNavigationUI" Value="False">
<Setter Property="Visibility" TargetName="NavChrome" Value="Collapsed"/>
</Trigger>
<Trigger Property="CanGoBack" Value="False">
<Setter Property="IsEnabled" TargetName="BackNavMenu" Value="false"/>
</Trigger>
<Trigger Property="CanGoForward" Value="False">
<Setter Property="IsEnabled" TargetName="ForwardNavMenu" Value="false"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="ResizeMode" Value="CanResizeWithGrip"/>
<Condition Property="WindowState" Value="Normal"/>
</MultiTrigger.Conditions>
<Setter Property="Visibility" TargetName="WindowResizeGrip" Value="Visible"/>
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
@@ -63,13 +63,7 @@
</Button>
<Border Margin="10,2" Background="White" Style="{StaticResource BorderVerticallySplitter}"/>
<Button Command="interactivity:ControlCommands.RotateLeft" CommandParameter="" Margin="6,0" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource RotateLeftGeometry}" Padding="3"/>
<Button Command="interactivity:ControlCommands.RotateRight" Margin="6,0,0,0" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource RotateLeftGeometry}" Padding="3" RenderTransformOrigin="0.5,0.5">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="1" ScaleX="-1"/>
</TransformGroup>
</Button.RenderTransform>
</Button>
<Button Command="interactivity:ControlCommands.RotateRight" Margin="6,0,0,0" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource RotateRightGeometry}" Padding="3"/>
<ToggleButton Visibility="{TemplateBinding ShowFullScreenButton,Converter={StaticResource Boolean2VisibilityConverter}}" Foreground="{DynamicResource TextIconBrush}" IsChecked="{Binding IsFullScreen,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" Margin="12,0,6,0" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.Geometry="{StaticResource FullScreenGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource FullScreenReturnGeometry}" Padding="3"/>
</StackPanel>
@@ -0,0 +1,9 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Base/NavigationWindowBaseStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource NavigationWindowBaseStyle}" TargetType="NavigationWindow"/>
</ResourceDictionary>
@@ -82,6 +82,7 @@
<ResourceDictionary Source="Separator.xaml"/>
<ResourceDictionary Source="StatusBar.xaml"/>
<ResourceDictionary Source="FlowDocument.xaml"/>
<ResourceDictionary Source="NavigationWindow.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
@@ -7,6 +7,7 @@ using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Markup;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using HandyControl.Controls;
using HandyControl.Data;
@@ -66,6 +67,15 @@ namespace HandyControl.Tools
FrameworkElement.StyleProperty.OverrideMetadata(typeof(System.Windows.Window), metadata);
}
public void SetNavigationWindowDefaultStyle(object resourceKey = null)
{
var metadata = resourceKey == null
? new FrameworkPropertyMetadata(Application.Current.FindResource(typeof(NavigationWindow)))
: new FrameworkPropertyMetadata(Application.Current.FindResource(resourceKey));
FrameworkElement.StyleProperty.OverrideMetadata(typeof(NavigationWindow), metadata);
}
public event PropertyChangedEventHandler PropertyChanged;
#if netle40