新设置
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
<ui:Page
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.About"
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.AboutPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
+2
-2
@@ -2,9 +2,9 @@ using iNKORE.UI.WPF.Modern.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class Colors : Page
|
||||
public partial class AboutPage : Page
|
||||
{
|
||||
public Colors()
|
||||
public AboutPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Appearance"
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.AppearancePage"
|
||||
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"
|
||||
@@ -18,9 +18,9 @@
|
||||
Description="点击跳转到主题设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Click">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard
|
||||
@@ -29,9 +29,9 @@
|
||||
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.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard
|
||||
@@ -40,9 +40,9 @@
|
||||
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.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
+5
-5
@@ -15,9 +15,9 @@ using System.Windows.Shapes;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class Appearance : Page
|
||||
public partial class AppearancePage : Page
|
||||
{
|
||||
public Appearance()
|
||||
public AppearancePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -27,7 +27,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Theme");
|
||||
settingsWindow.NavigateToPage("ThemePage");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Colors");
|
||||
settingsWindow.NavigateToPage("ColorsPage");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Fonts");
|
||||
settingsWindow.NavigateToPage("FontsPage");
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Basic"
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.BasicPage"
|
||||
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"
|
||||
@@ -38,9 +38,9 @@
|
||||
Description="点击跳转到启动设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Click">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Play}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
+3
-3
@@ -18,9 +18,9 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
/// <summary>
|
||||
/// Basic.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class Basic : Page
|
||||
public partial class BasicPage : Page
|
||||
{
|
||||
public Basic()
|
||||
public BasicPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -32,7 +32,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
// 调用NavigateToPage方法导航到启动页面
|
||||
settingsWindow.NavigateToPage("NewSettingStartup");
|
||||
settingsWindow.NavigateToPage("StartupPage");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<ui:Page
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Colors"
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.ColorsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
+2
-2
@@ -2,9 +2,9 @@ using iNKORE.UI.WPF.Modern.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class Theme : Page
|
||||
public partial class ColorsPage : Page
|
||||
{
|
||||
public Theme()
|
||||
public ColorsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Design"
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.DesignPage"
|
||||
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"
|
||||
@@ -18,9 +18,9 @@
|
||||
Description="点击跳转到图标设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Click">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Home}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Home}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard
|
||||
@@ -29,9 +29,9 @@
|
||||
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.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
+4
-4
@@ -15,9 +15,9 @@ using System.Windows.Shapes;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class Design : Page
|
||||
public partial class DesignPage : Page
|
||||
{
|
||||
public Design()
|
||||
public DesignPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -27,7 +27,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Iconography");
|
||||
settingsWindow.NavigateToPage("IconographyPage");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
settingsWindow.NavigateToPage("Typography");
|
||||
settingsWindow.NavigateToPage("TypographyPage");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<ui:Page
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Fonts"
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.FontsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
+2
-2
@@ -2,9 +2,9 @@ using iNKORE.UI.WPF.Modern.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class About : Page
|
||||
public partial class FontsPage : Page
|
||||
{
|
||||
public About()
|
||||
public FontsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.HomePage"
|
||||
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"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="首页">
|
||||
|
||||
<ScrollViewer Padding="59,0,59,0">
|
||||
<!-- These styles can be referenced to create a consistent SettingsPage layout -->
|
||||
<FrameworkElement.Resources>
|
||||
<!-- Spacing between cards -->
|
||||
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
|
||||
<!-- Style (inc. the correct spacing) of a section header -->
|
||||
<Style x:Key="SettingsSectionHeaderTextBlockStyle"
|
||||
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
|
||||
TargetType="TextBlock">
|
||||
<Style.Setters>
|
||||
<Setter Property="Margin" Value="1,30,0,6" />
|
||||
</Style.Setters>
|
||||
</Style>
|
||||
</FrameworkElement.Resources>
|
||||
<Grid>
|
||||
<ikw:SimpleStackPanel MaxWidth="800"
|
||||
HorizontalAlignment="Stretch"
|
||||
Spacing="{StaticResource SettingsCardSpacing}">
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
||||
Text="快速导航" />
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="基本设置"
|
||||
Description="点击跳转到基本设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Basic_Click">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Home}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="页面 2"
|
||||
Description="点击跳转到页面 2"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Page2_Click">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:SymbolIcon Symbol="Document" />
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="设计设置"
|
||||
Description="点击跳转到设计设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Design_Click">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Design}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard
|
||||
Header="外观设置"
|
||||
Description="点击跳转到外观设置页面"
|
||||
IsClickEnabled="True"
|
||||
Click="SettingsCard_Appearance_Click">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
</ui:SettingsCard>
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Page>
|
||||
@@ -0,0 +1,72 @@
|
||||
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>
|
||||
/// HomePage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class HomePage : Page
|
||||
{
|
||||
public HomePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SettingsCard_Basic_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 找到SettingsWindow2窗口
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
// 调用NavigateToPage方法导航到基本设置页面
|
||||
settingsWindow.NavigateToPage("BasicPage");
|
||||
}
|
||||
}
|
||||
|
||||
private void SettingsCard_Page2_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 找到SettingsWindow2窗口
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
// 调用NavigateToPage方法导航到页面2
|
||||
settingsWindow.NavigateToPage("Page2Page");
|
||||
}
|
||||
}
|
||||
|
||||
private void SettingsCard_Design_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 找到SettingsWindow2窗口
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
// 调用NavigateToPage方法导航到设计设置页面
|
||||
settingsWindow.NavigateToPage("DesignPage");
|
||||
}
|
||||
}
|
||||
|
||||
private void SettingsCard_Appearance_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// 找到SettingsWindow2窗口
|
||||
SettingsWindow2 settingsWindow = Window.GetWindow(this) as SettingsWindow2;
|
||||
if (settingsWindow != null)
|
||||
{
|
||||
// 调用NavigateToPage方法导航到外观设置页面
|
||||
settingsWindow.NavigateToPage("AppearancePage");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<ui:Page
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Iconography"
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.IconographyPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
@@ -0,0 +1,12 @@
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class IconographyPage : Page
|
||||
{
|
||||
public IconographyPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Page2"
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Page2Page"
|
||||
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"
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -18,9 +18,9 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
/// <summary>
|
||||
/// Page2.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class Page2 : Page
|
||||
public partial class Page2Page : Page
|
||||
{
|
||||
public Page2()
|
||||
public Page2Page()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.NewSettingStartup"
|
||||
<Page x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.StartupPage"
|
||||
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"
|
||||
+135
-61
@@ -1,23 +1,24 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Ink_Canvas.Helpers;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// NewSettingStartup.xaml 的交互逻辑
|
||||
/// StartupPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewSettingStartup : Page
|
||||
public partial class StartupPage : Page
|
||||
{
|
||||
private bool _isLoaded = false;
|
||||
|
||||
public NewSettingStartup()
|
||||
public StartupPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += NewSettingStartup_Loaded;
|
||||
Loaded += StartupPage_Loaded;
|
||||
}
|
||||
|
||||
private void NewSettingStartup_Loaded(object sender, RoutedEventArgs e)
|
||||
private void StartupPage_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LoadSettings();
|
||||
_isLoaded = true;
|
||||
@@ -28,35 +29,23 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
/// </summary>
|
||||
private void LoadSettings()
|
||||
{
|
||||
if (MainWindow.Settings == null) return;
|
||||
|
||||
_isLoaded = false;
|
||||
|
||||
try
|
||||
{
|
||||
var settings = SettingsService.Current;
|
||||
|
||||
// 窗口无焦点模式
|
||||
if (MainWindow.Settings.Advanced != null)
|
||||
{
|
||||
ToggleSwitchNoFocusMode.IsOn = MainWindow.Settings.Advanced.IsNoFocusMode;
|
||||
}
|
||||
ToggleSwitchNoFocusMode.IsOn = settings.Advanced?.IsNoFocusMode ?? true;
|
||||
|
||||
// 窗口无边框模式
|
||||
if (MainWindow.Settings.Advanced != null)
|
||||
{
|
||||
ToggleSwitchWindowMode.IsOn = MainWindow.Settings.Advanced.WindowMode;
|
||||
}
|
||||
ToggleSwitchWindowMode.IsOn = settings.Advanced?.WindowMode ?? true;
|
||||
|
||||
// 窗口置顶
|
||||
if (MainWindow.Settings.Advanced != null)
|
||||
{
|
||||
ToggleSwitchAlwaysOnTop.IsOn = MainWindow.Settings.Advanced.IsAlwaysOnTop;
|
||||
}
|
||||
ToggleSwitchAlwaysOnTop.IsOn = settings.Advanced?.IsAlwaysOnTop ?? true;
|
||||
|
||||
// UIA置顶
|
||||
if (MainWindow.Settings.Advanced != null)
|
||||
{
|
||||
ToggleSwitchUIAccessTopMost.IsOn = MainWindow.Settings.Advanced.EnableUIAccessTopMost;
|
||||
}
|
||||
ToggleSwitchUIAccessTopMost.IsOn = settings.Advanced?.EnableUIAccessTopMost ?? false;
|
||||
|
||||
// 开机时运行
|
||||
bool runAtStartup = System.IO.File.Exists(
|
||||
@@ -64,16 +53,10 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
ToggleSwitchRunAtStartup.IsOn = runAtStartup;
|
||||
|
||||
// 启动时折叠
|
||||
if (MainWindow.Settings.Startup != null)
|
||||
{
|
||||
ToggleSwitchFoldAtStartup.IsOn = MainWindow.Settings.Startup.IsFoldAtStartup;
|
||||
}
|
||||
ToggleSwitchFoldAtStartup.IsOn = settings.Startup?.IsFoldAtStartup ?? false;
|
||||
|
||||
// 仅PPT模式
|
||||
if (MainWindow.Settings.ModeSettings != null)
|
||||
{
|
||||
ToggleSwitchPPTOnlyMode.IsOn = MainWindow.Settings.ModeSettings.IsPPTOnlyMode;
|
||||
}
|
||||
ToggleSwitchPPTOnlyMode.IsOn = settings.ModeSettings?.IsPPTOnlyMode ?? false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -95,9 +78,8 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
try
|
||||
{
|
||||
bool newState = ToggleSwitchNoFocusMode.IsOn;
|
||||
|
||||
// 使用Helper类更新设置并应用
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNoFocusMode", newState);
|
||||
SettingsService.UpdateSetting("Advanced.IsNoFocusMode", newState);
|
||||
ApplyWindowSettings();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -115,9 +97,8 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
try
|
||||
{
|
||||
bool newState = ToggleSwitchWindowMode.IsOn;
|
||||
|
||||
// 使用Helper类更新设置并应用
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchWindowMode", newState);
|
||||
SettingsService.UpdateSetting("Advanced.WindowMode", newState);
|
||||
ApplyWindowSettings();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -135,9 +116,8 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
try
|
||||
{
|
||||
bool newState = ToggleSwitchAlwaysOnTop.IsOn;
|
||||
|
||||
// 使用Helper类更新设置并应用
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAlwaysOnTop", newState);
|
||||
SettingsService.UpdateSetting("Advanced.IsAlwaysOnTop", newState);
|
||||
ApplyWindowSettings();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -155,18 +135,8 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
try
|
||||
{
|
||||
bool newState = ToggleSwitchUIAccessTopMost.IsOn;
|
||||
|
||||
// 更新Settings对象
|
||||
if (MainWindow.Settings.Advanced != null)
|
||||
{
|
||||
MainWindow.Settings.Advanced.EnableUIAccessTopMost = newState;
|
||||
}
|
||||
|
||||
// 保存设置
|
||||
MainWindow.SaveSettingsToFile();
|
||||
|
||||
// 通知其他面板同步状态
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchUIAccessTopMost");
|
||||
SettingsService.UpdateSetting("Advanced.EnableUIAccessTopMost", newState);
|
||||
ApplyWindowSettings();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -174,6 +144,54 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应用窗口设置到主窗口
|
||||
/// </summary>
|
||||
private void ApplyWindowSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
var mainWindow = Application.Current.MainWindow as MainWindow;
|
||||
if (mainWindow == null) return;
|
||||
|
||||
var settings = SettingsService.Current;
|
||||
|
||||
// 应用窗口置顶
|
||||
mainWindow.Topmost = settings.Advanced?.IsAlwaysOnTop ?? true;
|
||||
|
||||
// 应用窗口模式(无边框/有边框)
|
||||
if (settings.Advanced?.WindowMode ?? true)
|
||||
{
|
||||
mainWindow.WindowStyle = WindowStyle.None;
|
||||
}
|
||||
else
|
||||
{
|
||||
mainWindow.WindowStyle = WindowStyle.SingleBorderWindow;
|
||||
}
|
||||
|
||||
// 应用无焦点模式
|
||||
if (settings.Advanced?.IsNoFocusMode ?? true)
|
||||
{
|
||||
// 使用反射调用主窗口的无焦点模式设置方法
|
||||
var method = mainWindow.GetType().GetMethod("SetNoFocusMode",
|
||||
System.Reflection.BindingFlags.NonPublic |
|
||||
System.Reflection.BindingFlags.Public |
|
||||
System.Reflection.BindingFlags.Instance);
|
||||
method?.Invoke(mainWindow, new object[] { true });
|
||||
}
|
||||
|
||||
// 通知其他面板同步状态
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchNoFocusMode");
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchWindowMode");
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchAlwaysOnTop");
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchUIAccessTopMost");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"应用窗口设置时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 启动设置事件处理
|
||||
@@ -188,9 +206,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
try
|
||||
{
|
||||
bool newState = ToggleSwitchRunAtStartup.IsOn;
|
||||
|
||||
// 使用Helper类更新设置并应用
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchRunAtStartup", newState);
|
||||
SetRunAtStartup(newState);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -198,6 +214,62 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置开机启动
|
||||
/// </summary>
|
||||
private void SetRunAtStartup(bool enable)
|
||||
{
|
||||
try
|
||||
{
|
||||
string startupPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Startup);
|
||||
string shortcutPath = System.IO.Path.Combine(startupPath, "Ink Canvas Annotation.lnk");
|
||||
string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||
|
||||
if (enable)
|
||||
{
|
||||
// 创建快捷方式
|
||||
if (!System.IO.File.Exists(shortcutPath))
|
||||
{
|
||||
CreateShortcut(shortcutPath, exePath);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 删除快捷方式
|
||||
if (System.IO.File.Exists(shortcutPath))
|
||||
{
|
||||
System.IO.File.Delete(shortcutPath);
|
||||
}
|
||||
}
|
||||
|
||||
// 通知其他面板同步状态
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchRunAtStartup");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"设置开机启动失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建快捷方式
|
||||
/// </summary>
|
||||
private void CreateShortcut(string shortcutPath, string targetPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
dynamic shell = Activator.CreateInstance(Type.GetTypeFromProgID("WScript.Shell"));
|
||||
dynamic shortcut = shell.CreateShortcut(shortcutPath);
|
||||
shortcut.TargetPath = targetPath;
|
||||
shortcut.WorkingDirectory = System.IO.Path.GetDirectoryName(targetPath);
|
||||
shortcut.Save();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"创建快捷方式失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开机运行后收纳到侧边栏开关事件
|
||||
/// </summary>
|
||||
@@ -208,9 +280,10 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
try
|
||||
{
|
||||
bool newState = ToggleSwitchFoldAtStartup.IsOn;
|
||||
|
||||
// 使用Helper类更新设置并应用
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchFoldAtStartup", newState);
|
||||
SettingsService.UpdateSetting("Startup.IsFoldAtStartup", newState);
|
||||
|
||||
// 通知其他面板同步状态
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchFoldAtStartup");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -232,9 +305,10 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
try
|
||||
{
|
||||
bool newState = ToggleSwitchPPTOnlyMode.IsOn;
|
||||
|
||||
// 使用Helper类更新设置并应用
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchMode", newState);
|
||||
SettingsService.UpdateSetting("ModeSettings.IsPPTOnlyMode", newState);
|
||||
|
||||
// 通知其他面板同步状态
|
||||
Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchMode");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<ui:Page
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Theme"
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.ThemePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
+2
-2
@@ -2,9 +2,9 @@ using iNKORE.UI.WPF.Modern.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class Fonts : Page
|
||||
public partial class ThemePage : Page
|
||||
{
|
||||
public Fonts()
|
||||
public ThemePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class Typography : Page
|
||||
{
|
||||
public Typography()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
<ui:Page
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.Typography"
|
||||
x:Class="Ink_Canvas.Windows.SettingsViews2.Pages.TypographyPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
+2
-2
@@ -2,9 +2,9 @@ using iNKORE.UI.WPF.Modern.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews2.Pages
|
||||
{
|
||||
public partial class Iconography : Page
|
||||
public partial class TypographyPage : Page
|
||||
{
|
||||
public Iconography()
|
||||
public TypographyPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
Title="InkCanvasForClass 设置"
|
||||
Width="1138" Height="750"
|
||||
MinWidth="200" MinHeight="150"
|
||||
MinWidth="270" MinHeight="220"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ui:ThemeManager.IsThemeAware="True"
|
||||
ui:TitleBar.ExtendViewIntoTitleBar="True"
|
||||
@@ -16,7 +16,7 @@
|
||||
ui:WindowHelper.UseModernWindowStyle="True"
|
||||
ui:TitleBar.Height="48"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@@ -32,45 +32,40 @@
|
||||
<Thickness x:Key="NavigationViewHeaderMargin">56,34,0,0</Thickness>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="13*"/>
|
||||
<RowDefinition Height="134*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Rectangle
|
||||
x:Name="XboxContentSafeRect"
|
||||
Width="48"
|
||||
Canvas.ZIndex="0"
|
||||
Visibility="Collapsed" />
|
||||
|
||||
<Border
|
||||
x:Name="AppTitleBar"
|
||||
Grid.Column="1"
|
||||
Height="{Binding ElementName=NavigationViewControl, Path=CompactPaneLength}"
|
||||
VerticalAlignment="Top"
|
||||
Background="Transparent"
|
||||
IsHitTestVisible="True">
|
||||
IsHitTestVisible="True"
|
||||
Canvas.ZIndex="10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="137"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ikw:SimpleStackPanel x:Name="AppTitle" Orientation="Horizontal" Spacing="12">
|
||||
<Image Source="\Resources\icc.ico" Width="20" RenderOptions.BitmapScalingMode="HighQuality" Margin="57,0,0,0"/>
|
||||
<ikw:SimpleStackPanel x:Name="AppTitle" Grid.Column="0" Orientation="Horizontal" Spacing="12" VerticalAlignment="Center">
|
||||
<Image Source="\Resources\icc.ico" Width="20" RenderOptions.BitmapScalingMode="HighQuality"/>
|
||||
<TextBlock x:Name="AppTitleText"
|
||||
VerticalAlignment="Center"
|
||||
Text="应用设置" Margin="0,1,20,0" TextWrapping="NoWrap"/>
|
||||
Text="应用设置" TextWrapping="NoWrap"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ui:NavigationView
|
||||
x:Name="NavigationViewControl"
|
||||
Grid.Column="1"
|
||||
@@ -78,19 +73,20 @@
|
||||
Canvas.ZIndex="0"
|
||||
Header=" "
|
||||
IsFooterSeparatorVisible="True"
|
||||
PaneTitle="设置"
|
||||
PaneTitle=""
|
||||
IsTabStop="False"
|
||||
IsTitleBarAutoPaddingEnabled="False"
|
||||
PaneDisplayMode="Auto"
|
||||
SelectionChanged="OnNavigationViewSelectionChanged"
|
||||
BackRequested="OnNavigationViewBackRequested"
|
||||
IsSettingsVisible="True"
|
||||
DisplayModeChanged="NavigationViewControl_DisplayModeChanged"
|
||||
IsSettingsVisible="False"
|
||||
IsBackButtonVisible="Visible"
|
||||
IsBackEnabled="True"
|
||||
OpenPaneLength="240"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
|
||||
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled" Grid.RowSpan="2">
|
||||
|
||||
<ui:NavigationView.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,8,0,12">
|
||||
@@ -101,7 +97,7 @@
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ui:NavigationView.HeaderTemplate>
|
||||
|
||||
|
||||
<ui:NavigationView.AutoSuggestBox>
|
||||
<ui:AutoSuggestBox
|
||||
x:Name="controlsSearchBox"
|
||||
@@ -118,12 +114,21 @@
|
||||
</ui:NavigationView.AutoSuggestBox>
|
||||
|
||||
<ui:NavigationView.MenuItems>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="HomeItem"
|
||||
Content="首页"
|
||||
Tag="HomePage"
|
||||
ToolTipService.ToolTip="首页">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Home}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItemHeader Content="ICC CE 设置"/>
|
||||
<!-- 基本设置 -->
|
||||
<ui:NavigationViewItem
|
||||
x:Name="BasicItem"
|
||||
Content="基本"
|
||||
Tag="Basic"
|
||||
Tag="BasicPage"
|
||||
SelectsOnInvoked="True"
|
||||
ToolTipService.ToolTip="基本设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
@@ -133,7 +138,7 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="NewSettingStartupItem"
|
||||
Content="启动"
|
||||
Tag="NewSettingStartup"
|
||||
Tag="StartupPage"
|
||||
ToolTipService.ToolTip="启动设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Play}"/>
|
||||
@@ -146,7 +151,7 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="Page2Item"
|
||||
Content="页面 2"
|
||||
Tag="Page2">
|
||||
Tag="Page2Page">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:SymbolIcon Symbol="Document" />
|
||||
</ui:NavigationViewItem.Icon>
|
||||
@@ -156,7 +161,7 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="DesignItem"
|
||||
Content="设计"
|
||||
Tag="Design"
|
||||
Tag="DesignPage"
|
||||
SelectsOnInvoked="True">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Design}"/>
|
||||
@@ -165,20 +170,20 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="IconographyItem"
|
||||
Content="图标"
|
||||
Tag="Iconography"
|
||||
Tag="IconographyPage"
|
||||
ToolTipService.ToolTip="图标设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.AllApps}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.AllApps}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="TypographyItem"
|
||||
Content="排版"
|
||||
Tag="Typography"
|
||||
Tag="TypographyPage"
|
||||
ToolTipService.ToolTip="排版设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
</ui:NavigationViewItem.MenuItems>
|
||||
</ui:NavigationViewItem>
|
||||
@@ -187,7 +192,7 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="AppearanceItem"
|
||||
Content="外观"
|
||||
Tag="Appearance"
|
||||
Tag="AppearancePage"
|
||||
SelectsOnInvoked="True">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/>
|
||||
@@ -196,25 +201,25 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="ThemeItem"
|
||||
Content="主题"
|
||||
Tag="Theme"
|
||||
Tag="ThemePage"
|
||||
ToolTipService.ToolTip="主题设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:FluentSystemIcons.DarkTheme_24_Regular}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:FluentSystemIcons.DarkTheme_24_Regular}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="ColorsItem"
|
||||
Content="颜色"
|
||||
Tag="Colors"
|
||||
Tag="ColorsPage"
|
||||
ToolTipService.ToolTip="颜色设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Highlight}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Highlight}"/>
|
||||
</ui:NavigationViewItem.Icon>
|
||||
</ui:NavigationViewItem>
|
||||
<ui:NavigationViewItem
|
||||
x:Name="FontsItem"
|
||||
Content="字体"
|
||||
Tag="Fonts"
|
||||
Tag="FontsPage"
|
||||
ToolTipService.ToolTip="字体设置">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Font}"/>
|
||||
@@ -229,7 +234,7 @@
|
||||
<ui:NavigationViewItem
|
||||
x:Name="AboutItem"
|
||||
Content="关于 InkCanvasForClass"
|
||||
Tag="About">
|
||||
Tag="AboutPage">
|
||||
<ui:NavigationViewItem.Icon>
|
||||
<ui:SymbolIcon Symbol="Help" />
|
||||
</ui:NavigationViewItem.Icon>
|
||||
|
||||
@@ -48,17 +48,18 @@ namespace Ink_Canvas.Windows.SettingsViews2
|
||||
// 初始化内置页面映射
|
||||
_pageTypes = new Dictionary<string, Type>
|
||||
{
|
||||
{ "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) },
|
||||
{ "NewSettingStartup", typeof(NewSettingStartup) },
|
||||
{ "About", typeof(About) },
|
||||
{ "HomePage", typeof(HomePage) },
|
||||
{ "BasicPage", typeof(BasicPage) },
|
||||
{ "Page2Page", typeof(Page2Page) },
|
||||
{ "DesignPage", typeof(DesignPage) },
|
||||
{ "AppearancePage", typeof(AppearancePage) },
|
||||
{ "IconographyPage", typeof(IconographyPage) },
|
||||
{ "TypographyPage", typeof(TypographyPage) },
|
||||
{ "ThemePage", typeof(ThemePage) },
|
||||
{ "ColorsPage", typeof(ColorsPage) },
|
||||
{ "FontsPage", typeof(FontsPage) },
|
||||
{ "StartupPage", typeof(StartupPage) },
|
||||
{ "AboutPage", typeof(AboutPage) },
|
||||
{ "Settings", typeof(SettingsPage) }
|
||||
};
|
||||
|
||||
@@ -67,12 +68,19 @@ namespace Ink_Canvas.Windows.SettingsViews2
|
||||
// 初始化导航菜单(内置+插件)
|
||||
InitializeNavigationMenu();
|
||||
|
||||
// 默认选中第一个菜单项
|
||||
// 默认选中首页
|
||||
if (NavigationViewControl.MenuItems.Count > 0)
|
||||
{
|
||||
// 首先导航到首页
|
||||
NavigateToPage("HomePage");
|
||||
// 然后选中首页菜单项
|
||||
NavigationViewControl.SelectedItem = NavigationViewControl.MenuItems[0];
|
||||
NavigationViewControl.Header = "首页";
|
||||
}
|
||||
|
||||
// 初始化标题栏边距
|
||||
UpdateAppTitleBarMargin();
|
||||
|
||||
// 窗口生命周期事件注册
|
||||
this.Loaded += (sender, e) =>
|
||||
{
|
||||
@@ -128,6 +136,18 @@ namespace Ink_Canvas.Windows.SettingsViews2
|
||||
// 正常状态下只设置最大尺寸限制
|
||||
SetMaxSizeOnly();
|
||||
}
|
||||
|
||||
// 窗口状态改变时更新标题栏显示
|
||||
UpdateAppTitleBarMargin();
|
||||
};
|
||||
|
||||
// 窗口大小改变时更新标题栏显示
|
||||
this.SizeChanged += (sender, e) =>
|
||||
{
|
||||
if (NavigationViewControl.DisplayMode == NavigationViewDisplayMode.Minimal)
|
||||
{
|
||||
UpdateAppTitleBarMargin();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -375,6 +395,41 @@ namespace Ink_Canvas.Windows.SettingsViews2
|
||||
}
|
||||
}
|
||||
|
||||
private void NavigationViewControl_DisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args)
|
||||
{
|
||||
UpdateAppTitleBarMargin(sender);
|
||||
}
|
||||
|
||||
private void UpdateAppTitleBarMargin()
|
||||
{
|
||||
UpdateAppTitleBarMargin(NavigationViewControl);
|
||||
}
|
||||
|
||||
private void UpdateAppTitleBarMargin(NavigationView sender)
|
||||
{
|
||||
Thickness currMargin = AppTitleBar.Margin;
|
||||
if (sender.DisplayMode == NavigationViewDisplayMode.Minimal)
|
||||
{
|
||||
AppTitleBar.Margin = new Thickness((sender.CompactPaneLength * 2), currMargin.Top, currMargin.Right, currMargin.Bottom);
|
||||
|
||||
// 当窗口宽度非常小时,隐藏图标和应用设置文字
|
||||
if (this.ActualWidth < 400)
|
||||
{
|
||||
AppTitle.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
AppTitle.Visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AppTitleBar.Margin = new Thickness(sender.CompactPaneLength, currMargin.Top, currMargin.Right, currMargin.Bottom);
|
||||
AppTitle.Visibility = Visibility.Visible;
|
||||
}
|
||||
AppTitleBar.Visibility = sender.PaneDisplayMode == NavigationViewPaneDisplayMode.Top ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
|
||||
private NavigationViewItem FindNavigationViewItemByTag(string tag)
|
||||
{
|
||||
// 遍历主菜单
|
||||
|
||||
Reference in New Issue
Block a user