add:NewNewSettings
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Appearance"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews2.Pages"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="外观">
|
||||
|
||||
<Grid Margin="24">
|
||||
<StackPanel>
|
||||
<TextBlock Text="外观设置" Style="{DynamicResource TitleTextBlockStyle}" Margin="0,0,0,16" />
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="主题"
|
||||
Description="点击跳转到主题设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Click">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="颜色"
|
||||
Description="点击跳转到颜色设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Click_1"
|
||||
Margin="0,8,0,0">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="字体"
|
||||
Description="点击跳转到字体设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Click_2"
|
||||
Margin="0,8,0,0">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
</ui:SettingsCard>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class Appearance : Page
|
||||
{
|
||||
public Appearance()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SettingsCard_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Theme");
|
||||
}
|
||||
}
|
||||
|
||||
private void SettingsCard_Click_1(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Colors");
|
||||
}
|
||||
}
|
||||
|
||||
private void SettingsCard_Click_2(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Fonts");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Basic"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews2.Pages"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="基本">
|
||||
|
||||
<Grid Margin="24">
|
||||
<StackPanel>
|
||||
<TextBlock Text="基本设置" Style="{DynamicResource TitleTextBlockStyle}" Margin="0,0,0,16" />
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="启动设置"
|
||||
Description="点击跳转到启动设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Click">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Play}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
</ui:SettingsCard>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class Basic : Page
|
||||
{
|
||||
public Basic()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SettingsCard_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 找到SettingsWindow2窗口
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
// 调用NavigateToPage方法导航到启动页面
|
||||
settingsWindow.NavigateToPage("Startup");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Design"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews2.Pages"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="设计">
|
||||
|
||||
<Grid Margin="24">
|
||||
<StackPanel>
|
||||
<TextBlock Text="设计设置" Style="{DynamicResource TitleTextBlockStyle}" Margin="0,0,0,16" />
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="图标"
|
||||
Description="点击跳转到图标设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Click">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Home}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="排版"
|
||||
Description="点击跳转到排版设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Click_1"
|
||||
Margin="0,8,0,0">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
</ui:SettingsCard>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class Design : Page
|
||||
{
|
||||
public Design()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SettingsCard_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Iconography");
|
||||
}
|
||||
}
|
||||
|
||||
private void SettingsCard_Click_1(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Typography");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-4
@@ -1,4 +1,4 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Page1"
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Startup"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -6,9 +6,12 @@
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews2.Pages"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="Page1">
|
||||
Title="启动">
|
||||
|
||||
<Grid>
|
||||
|
||||
<StackPanel Margin="24">
|
||||
<TextBlock Text="启动设置" Style="{DynamicResource TitleTextBlockStyle}" Margin="0,0,0,16" />
|
||||
<TextBlock Text="这里是启动设置页面" Style="{DynamicResource BodyTextBlockStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Page>
|
||||
</Page>
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -16,13 +16,13 @@ using System.Windows.Shapes;
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// Page1.xaml 的交互逻辑
|
||||
/// Startup.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class Page1 : Page
|
||||
public partial class Startup : Page
|
||||
{
|
||||
public Page1()
|
||||
public Startup()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@
|
||||
MinWidth="200"
|
||||
VerticalAlignment="Center"
|
||||
x:FieldModifier="public"
|
||||
PlaceholderText="搜索设置"
|
||||
PlaceholderText="查找设置"
|
||||
QuerySubmitted="OnControlsSearchBoxQuerySubmitted"
|
||||
TextChanged="OnControlsSearchBoxTextChanged" >
|
||||
<ui:AutoSuggestBox.QueryIcon>
|
||||
@@ -67,12 +67,25 @@
|
||||
|
||||
<ui:NavigationView.MenuItems>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="Page1Item"
|
||||
Content="页面 1"
|
||||
Tag="Page1">
|
||||
x:Name="BasicItem"
|
||||
Content="基本"
|
||||
Tag="Basic"
|
||||
SelectsOnInvoked="True"
|
||||
ToolTipService.ToolTip="基本设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:SymbolIcon Symbol="Home" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Home}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:NavigationViewItem.MenuItems>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="StartupItem"
|
||||
Content="启动"
|
||||
Tag="Startup"
|
||||
ToolTipService.ToolTip="启动设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Play}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
</ui:NavigationViewItem.MenuItems>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="Page2Item"
|
||||
@@ -85,9 +98,10 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="DesignItem"
|
||||
Content="设计"
|
||||
Tag="Design">
|
||||
Tag="Design"
|
||||
SelectsOnInvoked="True">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:SymbolIcon Symbol="Home" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Design}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:NavigationViewItem.MenuItems>
|
||||
<ui:NavigationViewItem
|
||||
@@ -111,9 +125,10 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="AppearanceItem"
|
||||
Content="外观"
|
||||
Tag="Appearance">
|
||||
Tag="Appearance"
|
||||
SelectsOnInvoked="True">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:SymbolIcon Symbol="Home" />
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:NavigationViewItem.MenuItems>
|
||||
<ui:NavigationViewItem
|
||||
|
||||
@@ -19,13 +19,16 @@ namespace Ink_Canvas.Windows.SettingsViews2
|
||||
// 初始化页面类型映射
|
||||
_pageTypes = new Dictionary<string, Type>
|
||||
{
|
||||
{ "Page1", typeof(Page1) },
|
||||
{ "Basic", typeof(Basic) },
|
||||
{ "Page2", typeof(Page2) },
|
||||
{ "Design", typeof(Design) },
|
||||
{ "Appearance", typeof(Appearance) },
|
||||
{ "Iconography", typeof(Iconography) },
|
||||
{ "Typography", typeof(Typography) },
|
||||
{ "Theme", typeof(Theme) },
|
||||
{ "Colors", typeof(Colors) },
|
||||
{ "Fonts", typeof(Fonts) },
|
||||
{ "Startup", typeof(Startup) },
|
||||
{ "About", typeof(About) },
|
||||
{ "Settings", typeof(SettingsPage) }
|
||||
};
|
||||
@@ -46,21 +49,17 @@ namespace Ink_Canvas.Windows.SettingsViews2
|
||||
}
|
||||
else if (args.SelectedItem is iNKORE.UI.WPF.Modern.Controls.NavigationViewItem item)
|
||||
{
|
||||
// 检查是否是子导航项(没有子菜单)
|
||||
if (item.MenuItems.Count == 0)
|
||||
// 检查是否有Tag,如果有则导航
|
||||
string tag = item.Tag as string;
|
||||
if (!string.IsNullOrEmpty(tag))
|
||||
{
|
||||
// 如果是子导航项,直接导航
|
||||
string tag = item.Tag as string;
|
||||
if (!string.IsNullOrEmpty(tag))
|
||||
{
|
||||
NavigateToPage(tag);
|
||||
}
|
||||
NavigateToPage(tag);
|
||||
}
|
||||
// 父级导航项(有子菜单)会自动展开,不需要额外处理
|
||||
}
|
||||
}
|
||||
|
||||
private void NavigateToPage(string pageTag)
|
||||
public void NavigateToPage(string pageTag)
|
||||
{
|
||||
if (_pageTypes.TryGetValue(pageTag, out Type pageType))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user