Skip to content

Commit

Permalink
Merge pull request #102 from Simnico99/MicaWPF.Lite-Title-Fix
Browse files Browse the repository at this point in the history
Mica wpf.lite title fix
  • Loading branch information
Simnico99 authored May 9, 2024
2 parents c3c1bf3 + 6838d4d commit bf37adc
Show file tree
Hide file tree
Showing 23 changed files with 565 additions and 1,306 deletions.
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
File renamed without changes.
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

0 comments on commit bf37adc

Please sign in to comment.