Skip to content

Commit

Permalink
update sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
singhashish-wpf committed Dec 22, 2023
1 parent a58be6c commit 18367ef
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 2 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Ashish Kumar Singh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Win11ThemeSampleApp
Sample App to test Win 11 Theming
2 changes: 1 addition & 1 deletion ThemingTest.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 17.8.34112.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win11ThemeTest", "Win11ThemeTest\Win11ThemeTest.csproj", "{38873268-98C3-4090-B1B7-AE90E77C0589}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win11ThemeSampleApp", "Winn11ThemeSampleApp\Win11ThemeSampleApp.csproj", "{B46630F2-08F2-4883-B581-9AB61DF68384}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win11ThemeSampleApp", "Win11ThemeSampleApp\Win11ThemeSampleApp.csproj", "{B46630F2-08F2-4883-B581-9AB61DF68384}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
20 changes: 20 additions & 0 deletions Win11ThemeSampleApp/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Application x:Class="Win11ThemeSampleApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Win11ThemeSampleApp"
StartupUri="MainWindow.xaml"
>
<Application.Resources>
<ResourceDictionary>

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Win11;component/resources/presentationframework.win11.xaml"/>
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Win11;component/resources/theme/light.xaml"/>
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Win11;component/styles/button.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Win11;component/styles/checkbox.xaml" />
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Win11;component/styles/RadioButton.xaml" />

</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
14 changes: 14 additions & 0 deletions Win11ThemeSampleApp/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 Win11ThemeSampleApp
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}

}
10 changes: 10 additions & 0 deletions Win11ThemeSampleApp/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)
)]
16 changes: 16 additions & 0 deletions Win11ThemeSampleApp/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Window x:Class="Win11ThemeSampleApp.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:local="clr-namespace:Win11ThemeSampleApp"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<StackPanel Orientation="Vertical">
<Button Content="Click Me" Appearance="Light"/>
<CheckBox Content="Test Checkbox"/>
<RadioButton>Hello World</RadioButton>
</StackPanel>
</Grid>
</Window>
24 changes: 24 additions & 0 deletions Win11ThemeSampleApp/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 Win11ThemeSampleApp
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
15 changes: 15 additions & 0 deletions Win11ThemeSampleApp/Win11ThemeSampleApp.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>net9.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UseWPF>true</UseWPF>
<Platforms>x64</Platforms>
</PropertyGroup>
<PropertyGroup>
<WpfRepoRoot>D:\repos\Dec2023\wpf</WpfRepoRoot>
</PropertyGroup>
<Import Project="$(WpfRepoRoot)\eng\wpf-debug.targets" />
</Project>
1 change: 0 additions & 1 deletion Winn11ThemeSampleApp
Submodule Winn11ThemeSampleApp deleted from 894881

0 comments on commit 18367ef

Please sign in to comment.