-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
584 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Application x:Class="SettingsNavigationTest.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ui:ThemeResources /> | ||
<ui:XamlControlsResources /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Media; | ||
|
||
namespace SettingsNavigationTest | ||
{ | ||
/// <summary> | ||
/// App.xaml 的交互逻辑 | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
internal static class VisualTreeExtensions | ||
{ | ||
public static T TryFindParent<T>(this DependencyObject child) where T : DependencyObject | ||
{ | ||
var parent = VisualTreeHelper.GetParent(child); | ||
while (parent != null) | ||
{ | ||
if (parent is T parentType) return parentType; | ||
parent = VisualTreeHelper.GetParent(parent); | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<Page x:Class="SettingsNavigationTest.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" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" | ||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800" | ||
Title="DemoPage1"> | ||
|
||
<Grid> | ||
<ikw:SimpleStackPanel Spacing="10"> | ||
<Button Content="Back" Click="BackToMain"/> | ||
<ui:SettingsCard Header="Theme" | ||
Description="Set the theme of this app."> | ||
<ui:SettingsCard.HeaderIcon> | ||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Color}"/> | ||
</ui:SettingsCard.HeaderIcon> | ||
<ComboBox SelectedIndex="0"> | ||
<ComboBoxItem Content="System"/> | ||
<ComboBoxItem Content="Light"/> | ||
<ComboBoxItem Content="Dark"/> | ||
</ComboBox> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="Transparency" | ||
Description="?!"> | ||
<ui:SettingsCard.HeaderIcon> | ||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.AppIconDefault}"/> | ||
</ui:SettingsCard.HeaderIcon> | ||
<ui:ToggleSwitch HorizontalContentAlignment="Right"/> | ||
</ui:SettingsCard> | ||
</ikw:SimpleStackPanel> | ||
</Grid> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using iNKORE.UI.WPF.Modern.Media.Animation; | ||
|
||
namespace SettingsNavigationTest | ||
{ | ||
/// <summary> | ||
/// AppearancePage.xaml 的交互逻辑 | ||
/// </summary> | ||
public partial class AppearancePage | ||
{ | ||
public AppearancePage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void BackToMain(object sender, System.Windows.RoutedEventArgs e) | ||
{ | ||
var parent = this.TryFindParent<MainWindow>(); | ||
parent.SettingsFrame.Navigate(parent.Main, new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromLeft }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<Page x:Class="SettingsNavigationTest.MainPage" | ||
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:ui="http://schemas.inkore.net/lib/ui/wpf/modern" | ||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800" | ||
Title="MainPage"> | ||
|
||
<ikw:SimpleStackPanel Spacing="10"> | ||
<ui:SettingsCard Header="App Appearance" | ||
Description="Set the appearance of this app." | ||
IsClickEnabled="True" | ||
Click="ToAppearancePage"> | ||
<ui:SettingsCard.HeaderIcon> | ||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Apps}"/> | ||
</ui:SettingsCard.HeaderIcon> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="Browser Search Engine" | ||
Description="Choose the search engine you like."> | ||
<ui:SettingsCard.HeaderIcon> | ||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.CloudSearch}"/> | ||
</ui:SettingsCard.HeaderIcon> | ||
<ComboBox SelectedIndex="2"> | ||
<ComboBoxItem Content="Baidu"/> | ||
<ComboBoxItem Content="Google"/> | ||
<ComboBoxItem Content="Bing"/> | ||
</ComboBox> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="Sidebar" | ||
Description="Provides many useful tools."> | ||
<ui:SettingsCard.HeaderIcon> | ||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.ActionCenter}"/> | ||
</ui:SettingsCard.HeaderIcon> | ||
<ui:ToggleSwitch HorizontalContentAlignment="Right"/> | ||
</ui:SettingsCard> | ||
<ui:SettingsCard Header="Check Update" | ||
Description="Current Version: 1.0.0"> | ||
<ui:SettingsCard.HeaderIcon> | ||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Processing}"/> | ||
</ui:SettingsCard.HeaderIcon> | ||
<ui:ToggleSwitch HorizontalContentAlignment="Right"/> | ||
</ui:SettingsCard> | ||
</ikw:SimpleStackPanel> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using iNKORE.UI.WPF.Modern.Media.Animation; | ||
|
||
namespace SettingsNavigationTest | ||
{ | ||
/// <summary> | ||
/// MainPage.xaml 的交互逻辑 | ||
/// </summary> | ||
public partial class MainPage | ||
{ | ||
public MainPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void ToAppearancePage(object sender, System.Windows.RoutedEventArgs e) | ||
{ | ||
var parent = this.TryFindParent<MainWindow>(); | ||
parent.SettingsFrame.Navigate(parent.Appearance, new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromRight }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Window x:Class="SettingsNavigationTest.MainWindow" | ||
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" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" | ||
mc:Ignorable="d" | ||
UseLayoutRounding="True" | ||
ui:ThemeManager.IsThemeAware="True" | ||
ui:WindowHelper.SystemBackdropType="Mica" | ||
ui:WindowHelper.UseModernWindowStyle="True" | ||
Title="SettingsNavigationTest" Height="450" Width="800"> | ||
<Grid Margin="25,15,15,15"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="*"/> | ||
</Grid.RowDefinitions> | ||
<TextBlock Text="Settings" FontSize="28" Grid.Row="0"/> | ||
<ui:Frame x:Name="SettingsFrame" Grid.Row="1" Margin="0,20,0,0"/> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using iNKORE.UI.WPF.Modern.Media.Animation; | ||
using System.Windows; | ||
using Page = System.Windows.Controls.Page; | ||
|
||
namespace SettingsNavigationTest | ||
{ | ||
/// <summary> | ||
/// MainWindow.xaml 的交互逻辑 | ||
/// </summary> | ||
public partial class MainWindow | ||
{ | ||
public readonly Page Main = new MainPage(); | ||
public readonly Page Appearance = new AppearancePage(); | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
SettingsFrame.Navigate(Main, new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromRight }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System.Reflection; | ||
using System.Resources; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
using System.Windows; | ||
|
||
// 有关程序集的一般信息由以下 | ||
// 控制。更改这些特性值可修改 | ||
// 与程序集关联的信息。 | ||
[assembly: AssemblyTitle("SettingsNavigationTest")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("SettingsNavigationTest")] | ||
[assembly: AssemblyCopyright("Copyright © 2024")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// 将 ComVisible 设置为 false 会使此程序集中的类型 | ||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 | ||
//请将此类型的 ComVisible 特性设置为 true。 | ||
[assembly: ComVisible(false)] | ||
|
||
//若要开始生成可本地化的应用程序,请设置 | ||
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture> | ||
//在 <PropertyGroup> 中。例如,如果你使用的是美国英语。 | ||
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消 | ||
//对以下 NeutralResourceLanguage 特性的注释。 更新 | ||
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 | ||
|
||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] | ||
|
||
|
||
[assembly: ThemeInfo( | ||
ResourceDictionaryLocation.None, //主题特定资源词典所处位置 | ||
//(未在页面中找到资源时使用, | ||
//或应用程序资源字典中找到时使用) | ||
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 | ||
//(未在页面中找到资源时使用, | ||
//、应用程序或任何主题专用资源字典中找到时使用) | ||
)] | ||
|
||
|
||
// 程序集的版本信息由下列四个值组成: | ||
// | ||
// 主版本 | ||
// 次版本 | ||
// 生成号 | ||
// 修订号 | ||
// | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
Oops, something went wrong.