新设置
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();
|
||||
}
|
||||
Reference in New Issue
Block a user