-
Notifications
You must be signed in to change notification settings - Fork 11
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
676 additions
and
168 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
EleCho.WpfSuite.FluentDesign/EleCho - Backup.WpfSuite.FluentDesign.csproj
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,43 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net8.0-windows;net6.0-windows;net48;net47;net46;net45</TargetFrameworks> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>latest</LangVersion> | ||
<UseWPF>true</UseWPF> | ||
<EnableWindowsTargeting>true</EnableWindowsTargeting> | ||
<RootNamespace>EleCho.WpfSuite</RootNamespace> | ||
|
||
<Version>0.0.1</Version> | ||
|
||
<Authors>EleCho</Authors> | ||
<Copyright>Copyright © 2024 EleCho</Copyright> | ||
<PackageProjectUrl>https://github.com/OrgEleCho/EleCho.WpfSuite</PackageProjectUrl> | ||
<PackageIcon>logo.png</PackageIcon> | ||
<PackageTags>WPF;MVVM;Toolkit;Controls;Converters;BindingProxy</PackageTags> | ||
<Description>WPF layout panels, controls, value converters, utilities suite</Description> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\EleCho.WpfSuite\EleCho.WpfSuite.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="Controls\" /> | ||
<Folder Include="NewFolder\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Page Update="Styles\PasswordBoxResources.xaml"> | ||
<SubType>Designer</SubType> | ||
<Generator>MSBuild:Compile</Generator> | ||
</Page> | ||
<Page Update="Styles\TextBoxResources.xaml"> | ||
<SubType>Designer</SubType> | ||
<Generator>MSBuild:Compile</Generator> | ||
</Page> | ||
</ItemGroup> | ||
|
||
</Project> |
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,23 @@ | ||
using System.Reflection; | ||
using System.Windows; | ||
|
||
namespace EleCho.WpfSuite.FluentDesign | ||
{ | ||
public class FluentDesignResourceKey : ResourceKey | ||
{ | ||
private static readonly Assembly s_thisAssembly = Assembly.GetExecutingAssembly(); | ||
|
||
public override Assembly Assembly => s_thisAssembly; | ||
|
||
public string Name { get; set; } = string.Empty; | ||
|
||
public FluentDesignResourceKey(string name) | ||
{ | ||
Name = name; | ||
} | ||
|
||
public FluentDesignResourceKey() | ||
{ | ||
} | ||
} | ||
} |
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
62 changes: 62 additions & 0 deletions
62
EleCho.WpfSuite.FluentDesign/FluentDesignThemeResources.cs
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,62 @@ | ||
using System; | ||
using System.Windows; | ||
|
||
namespace EleCho.WpfSuite.FluentDesign | ||
{ | ||
public class FluentDesignThemeResources : ResourceDictionary | ||
{ | ||
private readonly ResourceDictionary _lightThemeResources = new(); | ||
private readonly ResourceDictionary _darkThemeResources = new(); | ||
|
||
public FluentDesignThemeResources() | ||
{ | ||
_lightThemeResources = new ResourceDictionary() { Source = new Uri("pack://application:,,,/EleCho.WpfSuite.FluentDesign;component/Themes/Light.xaml") }; | ||
_darkThemeResources = new ResourceDictionary() { Source = new Uri("pack://application:,,,/EleCho.WpfSuite.FluentDesign;component/Themes/Dark.xaml") }; | ||
|
||
MergedDictionaries.Add(_lightThemeResources); | ||
} | ||
|
||
public bool IsDarkMode | ||
{ | ||
get => MergedDictionaries.Contains(_darkThemeResources); | ||
set | ||
{ | ||
MergedDictionaries.Clear(); | ||
|
||
if (value) | ||
{ | ||
MergedDictionaries.Add(_darkThemeResources); | ||
} | ||
else | ||
{ | ||
MergedDictionaries.Add(_lightThemeResources); | ||
} | ||
} | ||
} | ||
|
||
// color keys | ||
public static readonly FluentDesignResourceKey TextColorKey = new FluentDesignResourceKey(nameof(TextColorKey)); | ||
|
||
public static readonly FluentDesignResourceKey ControlBackgroundColorKey = new FluentDesignResourceKey(nameof(ControlBackgroundColorKey)); | ||
public static readonly FluentDesignResourceKey ControlHoverBackgroundColorKey = new FluentDesignResourceKey(nameof(ControlHoverBackgroundColorKey)); | ||
public static readonly FluentDesignResourceKey ControlPressedBackgroundColorKey = new FluentDesignResourceKey(nameof(ControlPressedBackgroundColorKey)); | ||
|
||
public static readonly FluentDesignResourceKey TextBoxBackgroundColorKey = new FluentDesignResourceKey(nameof(TextBoxBackgroundColorKey)); | ||
public static readonly FluentDesignResourceKey TextBoxHoverBackgroundColorKey = new FluentDesignResourceKey(nameof(TextBoxHoverBackgroundColorKey)); | ||
public static readonly FluentDesignResourceKey TextBoxFocusedBackgroundColorKey = new FluentDesignResourceKey(nameof(TextBoxFocusedBackgroundColorKey)); | ||
|
||
|
||
// brush keys | ||
public static readonly FluentDesignResourceKey TextBrushKey = new FluentDesignResourceKey(nameof(TextBrushKey)); | ||
|
||
public static readonly FluentDesignResourceKey ControlBackgroundBrushKey = new FluentDesignResourceKey(nameof(ControlBackgroundBrushKey)); | ||
public static readonly FluentDesignResourceKey ControlHoverBackgroundBrushKey = new FluentDesignResourceKey(nameof(ControlHoverBackgroundBrushKey)); | ||
public static readonly FluentDesignResourceKey ControlPressedBackgroundBrushKey = new FluentDesignResourceKey(nameof(ControlPressedBackgroundBrushKey)); | ||
public static readonly FluentDesignResourceKey ControlBorderBrushKey = new FluentDesignResourceKey(nameof(ControlBorderBrushKey)); | ||
|
||
public static readonly FluentDesignResourceKey TextBoxBackgroundBrushKey = new FluentDesignResourceKey(nameof(TextBoxBackgroundBrushKey)); | ||
public static readonly FluentDesignResourceKey TextBoxHoverBackgroundBrushKey = new FluentDesignResourceKey(nameof(TextBoxHoverBackgroundBrushKey)); | ||
public static readonly FluentDesignResourceKey TextBoxFocusedBackgroundBrushKey = new FluentDesignResourceKey(nameof(TextBoxFocusedBackgroundBrushKey)); | ||
public static readonly FluentDesignResourceKey TextBoxBorderBrushKey = new FluentDesignResourceKey(nameof(TextBoxBorderBrushKey)); | ||
} | ||
} |
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
Oops, something went wrong.