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]);
}
}
}
}