Skip to content

Commit

Permalink
Add settingspageexample
Browse files Browse the repository at this point in the history
  • Loading branch information
NotYoojun committed Apr 6, 2024
1 parent bc83020 commit 0aa02ae
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 2 deletions.
26 changes: 24 additions & 2 deletions iNKORE.UI.WPF.Modern.sln
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NoAppXamlTest", "source\sam
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlyoutTest", "source\samples\FlyoutTest\FlyoutTest.csproj", "{3614991C-ECC0-474A-BC8E-1D0A56FD0BDE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StarterKit", "source\samples\StarterKit\StarterKit.csproj", "{B13E16CB-55E0-42CB-B761-216D82273473}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StarterKit", "source\samples\StarterKit\StarterKit.csproj", "{B13E16CB-55E0-42CB-B761-216D82273473}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SettingsPageExample", "source\samples\SettingsPageExample\SettingsPageExample.csproj", "{677DAAFA-C061-4C79-BAAE-5639BCD80448}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -239,20 +241,40 @@ Global
{B13E16CB-55E0-42CB-B761-216D82273473}.Release|x64.Build.0 = Release|Any CPU
{B13E16CB-55E0-42CB-B761-216D82273473}.Release|x86.ActiveCfg = Release|Any CPU
{B13E16CB-55E0-42CB-B761-216D82273473}.Release|x86.Build.0 = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|Any CPU.Build.0 = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|ARM.ActiveCfg = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|ARM.Build.0 = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|ARM64.Build.0 = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|x64.ActiveCfg = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|x64.Build.0 = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|x86.ActiveCfg = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Debug|x86.Build.0 = Debug|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|Any CPU.ActiveCfg = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|Any CPU.Build.0 = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|ARM.ActiveCfg = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|ARM.Build.0 = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|ARM64.ActiveCfg = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|ARM64.Build.0 = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|x64.ActiveCfg = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|x64.Build.0 = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|x86.ActiveCfg = Release|Any CPU
{677DAAFA-C061-4C79-BAAE-5639BCD80448}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{DE27C3CE-E9E9-48D2-A4A1-5846E550462E} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
{35EF6F6B-3E8C-4A9E-BCD2-16CA5C2C2ADC} = {07337569-6CA9-4BB0-9C8F-962D981CB5F4}
{54049F5E-E57B-433E-B316-3C51F25B523D} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
{DBB698F7-FB37-4514-82C2-DA3C71A4B92F} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
{A6E3D156-8F7F-4566-9931-DC76009E73FC} = {445FD5A2-621B-450B-B0AB-4B9A070ECC1E}
{1413BB5F-D932-4C64-B7B4-2F253DDE36B2} = {445FD5A2-621B-450B-B0AB-4B9A070ECC1E}
{7C68372B-A2EE-43DB-A6B1-EC0CA6471BA3} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
{3614991C-ECC0-474A-BC8E-1D0A56FD0BDE} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
{B13E16CB-55E0-42CB-B761-216D82273473} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
{677DAAFA-C061-4C79-BAAE-5639BCD80448} = {A96F98E9-18B5-4863-8F28-9B7BDF70A128}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6251E140-0FAA-4DE9-B245-1C5BE188E578}
Expand Down
15 changes: 15 additions & 0 deletions source/samples/SettingsPageExample/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Application x:Class="CardStyleExample.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CardStyleExample"
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>
14 changes: 14 additions & 0 deletions source/samples/SettingsPageExample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Configuration;
using System.Data;
using System.Windows;

namespace CardStyleExample
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}

}
10 changes: 10 additions & 0 deletions source/samples/SettingsPageExample/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
130 changes: 130 additions & 0 deletions source/samples/SettingsPageExample/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<Window x:Class="CardStyleExample.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"
xmlns:local="clr-namespace:CardStyleExample"
mc:Ignorable="d"
ui:WindowHelper.UseModernWindowStyle="True"
ui:WindowHelper.SystemBackdropType="Mica"
Title="Settings" Height="450" Width="800">
<FrameworkElement.Resources>
<ResourceDictionary>

<Style TargetType="Expander" BasedOn="{StaticResource {x:Static ui:ThemeKeys.ExpanderCardStyleKey}}">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
<Style x:Key="Style_SectionBorderStyle" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource {x:Static ui:ThemeKeys.ExpanderHeaderBackgroundKey}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static ui:ThemeKeys.ExpanderHeaderBorderBrushKey}}"/>
<Setter Property="BorderThickness" Value="{DynamicResource {x:Static ui:ThemeKeys.ExpanderHeaderBorderThicknessKey}}"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Padding" Value="15,0,20,0"/>
</Style>

<Style TargetType="ComboBox" BasedOn="{StaticResource {x:Static ui:ThemeKeys.DefaultComboBoxStyleKey}}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>

<Style TargetType="ui:FontIcon">
<Setter Property="FontSize" Value="20"/>
</Style>

<Style TargetType="ui:ToggleSwitch">
<Setter Property="MinWidth" Value="0"/>
</Style>

</ResourceDictionary>
</FrameworkElement.Resources>
<ui:ScrollViewerEx>
<ui:SimpleStackPanel Spacing="10" MaxWidth="960" Margin="40" VerticalAlignment="Center">

<TextBlock Text="Settings" FontSize="24" FontWeight="Bold"/>

<TextBlock Text="General" FontSize="16"/>
<Expander x:Name="Expander_Language" IsExpanded="True">
<Expander.Header>
<Grid VerticalAlignment="Center" Margin="0,10,-10,10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<ui:FontIcon Glyph="{x:Static ui:SegoeIcons.LocaleLanguage}" Grid.RowSpan="2" Margin="5,15,20,15"/>
<TextBlock x:Name="TextBlock_Language" Text="Language" Grid.Column="1" VerticalAlignment="Bottom" Margin="0,0,0,2"/>
<TextBlock x:Name="TextBlock_Language_Description" Text="The primary language that displays on the UI" Grid.Column="1" VerticalAlignment="Top" Grid.Row="1" Margin="0,2,20,5" Opacity="0.615" FontSize="12" TextTrimming="CharacterEllipsis" TextWrapping="WrapWithOverflow"/>

<ComboBox x:Name="ComboBox_Language" DisplayMemberPath="Name" Grid.Column="2" Grid.RowSpan="2">
</ComboBox>
</Grid>
</Expander.Header>

<Grid Margin="5,0,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="TextBlock_Language_Author" Text="Author" Margin="0,5,0,5"/>
<TextBlock x:Name="TextBlock_Language_Version" Text="Version" Grid.Row="1" Margin="0,5,0,5"/>

<TextBlock x:Name="TextBlock_Language_Author_Value" Text="NotYoojun.!" Margin="0,5,0,5" Grid.Column="1"/>
<TextBlock x:Name="TextBlock_Language_Version_Value" Text="1.0.0" Grid.Row="1" Margin="0,5,0,5" Grid.Column="1"/>

</Grid>

</Expander>
<Border Style="{StaticResource Style_SectionBorderStyle}">
<Grid VerticalAlignment="Center" Margin="0,10,0,10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<ui:FontIcon Glyph="{x:Static ui:SegoeIcons.Light}" Grid.RowSpan="2" Margin="5,15,20,15"/>
<TextBlock x:Name="TextBlock_ThemeMode" Text="Theme mode" Grid.Column="1" VerticalAlignment="Bottom" Margin="0,0,0,2"/>
<TextBlock x:Name="TextBlock_ThemeMode_Description" Text="Lorem ipsum dolor sit amet." Grid.Column="1" VerticalAlignment="Top" Grid.Row="1" Margin="0,2,20,5" Opacity="0.615" FontSize="12" TextTrimming="CharacterEllipsis" TextWrapping="WrapWithOverflow"/>

<ComboBox x:Name="ComboBox_ThemeMode" Grid.Column="2" Grid.RowSpan="2" SelectedIndex="0">
<ComboBoxItem x:Name="ComboBoxItem_ThemeMode_Default" Content="System Default"/>
<ComboBoxItem x:Name="ComboBoxItem_ThemeMode_Light" Content="Light"/>
<ComboBoxItem x:Name="ComboBoxItem_ThemeMode_Dark" Content="Dark"/>
</ComboBox>
</Grid>
</Border>

<TextBlock Text="Advanced" FontSize="16" Margin="0,20,0,0"/>
<Border Style="{StaticResource Style_SectionBorderStyle}">
<Grid VerticalAlignment="Center" Margin="0,10,0,10">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ui:FontIcon Glyph="{x:Static ui:SegoeIcons.Draw}" Grid.RowSpan="2" Margin="5,15,20,15"/>
<TextBlock x:Name="TextBlock_StylusToDraw" Text="Draw with stylus" Grid.Column="1" VerticalAlignment="Bottom" Margin="0,0,0,2"/>
<TextBlock x:Name="TextBlock_StylusToDraw_Description" Text="Draw with your stylus while using your fingers to move the viewport" Grid.Column="1" VerticalAlignment="Top" Grid.Row="1" Margin="0,2,20,5" Opacity="0.615" FontSize="12" TextTrimming="CharacterEllipsis" TextWrapping="WrapWithOverflow"/>

<ui:ToggleSwitch x:Name="ToggleSwitch_StylusToDraw_Enabled" Grid.Column="2" Grid.RowSpan="2"/>
</Grid>
</Border>
</ui:SimpleStackPanel>
</ui:ScrollViewerEx>
</Window>
24 changes: 24 additions & 0 deletions source/samples/SettingsPageExample/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Text;
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 CardStyleExample
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
15 changes: 15 additions & 0 deletions source/samples/SettingsPageExample/SettingsPageExample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="iNKORE.UI.WPF.Modern" Version="0.9.26.3" />
</ItemGroup>

</Project>

0 comments on commit 0aa02ae

Please sign in to comment.