Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mica wpf.lite title fix #102

Merged
merged 4 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Here is an exemple:
x:Class="MicaWPF.DesktopApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mica="clr-namespace:MicaWPF.Styles;assembly=MicaWPF" <!-- For the lite version: clr-namespace:MicaWPF.Lite.Styles;assembly=MicaWPF.Lite -->
xmlns:mica="clr-namespace:MicaWPF.Styles;assembly=MicaWPF" <!-- For the lite version: clr-namespace:MicaWPF.Styles;assembly=MicaWPF.Lite -->
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
Expand Down
7 changes: 6 additions & 1 deletion src/MicaWPF.Core/Helpers/ServiceLocatorHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal static class ServiceLocatorHelper
/// <returns>The current namespace.</returns>
public static string GetNamespace()
{
return _assemblies.Any(x => x.GetName().Name == "MicaWPF") ? "MicaWPF" : "MicaWPF.Lite";
return _assemblies.Any(x => x.GetName().Name == "MicaWPF") ? "MicaWPF" : "MicaWPF.Core";
}

/// <summary>
Expand All @@ -36,6 +36,11 @@ public static T GetService<T>()
// Simplified assembly search with pattern matching
var currentAssembly = _assemblies.FirstOrDefault(x => x.GetName().Name is "MicaWPF" or "MicaWPF.Lite");

if (currentAssembly?.GetName().Name == "MicaWPF.Lite")
{
currentAssembly = _assemblies.FirstOrDefault(x => x.GetName().Name is "MicaWPF.Core");
}

if (currentAssembly is not null)
{
var instance = GetInstanceFromAssembly<T>(currentAssembly, serviceType);
Expand Down
1 change: 1 addition & 0 deletions src/MicaWPF.Core/MicaWPF.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net461;net47;net48;net481;netcoreapp3.1;net6.0-windows;net7.0-windows;net8.0-windows</TargetFrameworks>
<TargetMinimumPlatformVersion>7.0</TargetMinimumPlatformVersion>
<UseWPF>true</UseWPF>
<Copyright>Copyright (c) 2021 Simnico99</Copyright>
<RepositoryUrl>https://github.com/Simnico99/MicaWPF</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:MicaWPF.Controls">
xmlns:controls="clr-namespace:MicaWPF.Core.Controls">

<Style x:Key="MicaWPF.Styles.GradientBorder.Default" TargetType="{x:Type controls:GradientBorder}">
<Setter Property="TopBorderBrush" Value="{DynamicResource MicaWPF.Brushes.ControlStrokeColorSecondary}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:MicaWPF.Controls">
xmlns:controls="clr-namespace:MicaWPF.Core.Controls">

<Style x:Key="MicaWPF.Styles.GradientBorder.Default" TargetType="{x:Type controls:GradientBorder}">
<Setter Property="TopBorderBrush" Value="{DynamicResource MicaWPF.Brushes.ControlStrokeColorDefault}" />
Expand Down
4 changes: 2 additions & 2 deletions src/MicaWPF.Core/Styles/ThemeDictionaryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public ThemeDictionaryBase()
return;
}

if(!WindowsTheme.HasValue)
if (!WindowsTheme.HasValue)
{
SetTheme(Enums.WindowsTheme.Auto);
}
}

public WindowsTheme? WindowsTheme { get; private set; } = null;
public WindowsTheme? WindowsTheme { get; private set; } = Enums.WindowsTheme.Auto;

public virtual string SourceLocation { get; } = string.Empty;

Expand Down
264 changes: 264 additions & 0 deletions src/MicaWPF.Core/Styles/Themes/MicaDark.xaml

Large diffs are not rendered by default.

269 changes: 269 additions & 0 deletions src/MicaWPF.Core/Styles/Themes/MicaLight.xaml

Large diffs are not rendered by default.

39 changes: 0 additions & 39 deletions src/MicaWPF.Lite/Controls/GradientBorder.cs

This file was deleted.

18 changes: 0 additions & 18 deletions src/MicaWPF.Lite/Styles/Assets/Accent.xaml

This file was deleted.

66 changes: 0 additions & 66 deletions src/MicaWPF.Lite/Styles/Controls/Dark/GradientBorder.xaml

This file was deleted.

66 changes: 0 additions & 66 deletions src/MicaWPF.Lite/Styles/Controls/Light/GradientBorder.xaml

This file was deleted.

2 changes: 1 addition & 1 deletion src/MicaWPF.Lite/Styles/MicaWPF.Lite.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MicaWPF.Lite;component/Styles/Assets/Accent.xaml" />
<ResourceDictionary Source="pack://application:,,,/MicaWPF.Core;component/Styles/Assets/Accent.xaml" />
</ResourceDictionary.MergedDictionaries>

</ResourceDictionary>
2 changes: 1 addition & 1 deletion src/MicaWPF.Lite/Styles/ThemeDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ namespace MicaWPF.Lite.Styles;

public sealed class ThemeDictionary : ThemeDictionaryBase
{
public override string SourceLocation { get; } = "pack://application:,,,/MicaWPF.Lite;component/Styles/Themes";
public override string SourceLocation { get; } = "pack://application:,,,/MicaWPF.Core;component/Styles/Themes";
}
Loading