removed mahapps dep, did lighter weight ControlzEx. Need to add these to WSX

This commit is contained in:
Clint Rutkas 2020-11-11 14:14:34 -08:00
parent 2c0656142a
commit 62f2e6fb8e
10 changed files with 40 additions and 45 deletions

View File

@ -26,6 +26,7 @@ namespace ImageResizer.Properties
{ {
if (disposing) if (disposing)
{ {
_imageResizerApp.Dispose();
_imageResizerApp = null; _imageResizerApp = null;
} }

View File

@ -61,7 +61,7 @@
<Resource Include="Resources\ImageResizer.png" /> <Resource Include="Resources\ImageResizer.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MahApps.Metro" Version="2.3.3" /> <PackageReference Include="ControlzEx" Version="4.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0"> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>

View File

@ -1,11 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro" xmlns:system="clr-namespace:System;assembly=System.Runtime">
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">Dark.Accent1</system:String> <system:String x:Key="Theme.Name">Dark.Accent1</system:String>

View File

@ -1,11 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro" xmlns:system="clr-namespace:System;assembly=System.Runtime">
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent2</system:String> <system:String x:Key="Theme.Name">HighContrast.Accent2</system:String>

View File

@ -1,11 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro" xmlns:system="clr-namespace:System;assembly=System.Runtime">
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent3</system:String> <system:String x:Key="Theme.Name">HighContrast.Accent3</system:String>

View File

@ -1,12 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro" xmlns:system="clr-namespace:System;assembly=System.Runtime">
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent4</system:String> <system:String x:Key="Theme.Name">HighContrast.Accent4</system:String>
<system:String x:Key="Theme.Origin">PowerToysImageResizer</system:String> <system:String x:Key="Theme.Origin">PowerToysImageResizer</system:String>

View File

@ -1,11 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro" xmlns:system="clr-namespace:System;assembly=System.Runtime">
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent5</system:String> <system:String x:Key="Theme.Name">HighContrast.Accent5</system:String>

View File

@ -1,11 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro" xmlns:system="clr-namespace:System;assembly=System.Runtime">
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="options">
<!-- Metadata --> <!-- Metadata -->
<system:String x:Key="Theme.Name">Light.Accent1</system:String> <system:String x:Key="Theme.Name">Light.Accent1</system:String>

View File

@ -0,0 +1,24 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using ControlzEx.Theming;
namespace ImageResizer.Utilities
{
public class CustomLibraryThemeProvider : LibraryThemeProvider
{
public static readonly CustomLibraryThemeProvider DefaultInstance = new CustomLibraryThemeProvider();
public CustomLibraryThemeProvider()
: base(true)
{
}
/// <inheritdoc />
public override void FillColorSchemeValues(Dictionary<string, string> values, RuntimeThemeColorValues colorValues)
{
}
}
}

View File

@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation // Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license. // The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information. // See the LICENSE file in the project root for more information.
using System; using System;
using System.Linq; using System.Linq;
using System.Windows; using System.Windows;
using ControlzEx.Theming; using ControlzEx.Theming;
using MahApps.Metro.Theming;
using Microsoft.Win32; using Microsoft.Win32;
namespace ImageResizer.Utilities namespace ImageResizer.Utilities
@ -39,27 +39,27 @@ namespace ImageResizer.Utilities
ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme( ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme(
new LibraryTheme( new LibraryTheme(
highContrastOneThemeUri, highContrastOneThemeUri,
MahAppsLibraryThemeProvider.DefaultInstance)); CustomLibraryThemeProvider.DefaultInstance));
ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme( ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme(
new LibraryTheme( new LibraryTheme(
highContrastTwoThemeUri, highContrastTwoThemeUri,
MahAppsLibraryThemeProvider.DefaultInstance)); CustomLibraryThemeProvider.DefaultInstance));
ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme( ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme(
new LibraryTheme( new LibraryTheme(
highContrastBlackThemeUri, highContrastBlackThemeUri,
MahAppsLibraryThemeProvider.DefaultInstance)); CustomLibraryThemeProvider.DefaultInstance));
ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme( ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme(
new LibraryTheme( new LibraryTheme(
highContrastWhiteThemeUri, highContrastWhiteThemeUri,
MahAppsLibraryThemeProvider.DefaultInstance)); CustomLibraryThemeProvider.DefaultInstance));
ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme( ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme(
new LibraryTheme( new LibraryTheme(
lightThemeUri, lightThemeUri,
MahAppsLibraryThemeProvider.DefaultInstance)); CustomLibraryThemeProvider.DefaultInstance));
ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme( ControlzEx.Theming.ThemeManager.Current.AddLibraryTheme(
new LibraryTheme( new LibraryTheme(
darkThemeUri, darkThemeUri,
MahAppsLibraryThemeProvider.DefaultInstance)); CustomLibraryThemeProvider.DefaultInstance));
ResetTheme(); ResetTheme();
ControlzEx.Theming.ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncWithAppMode; ControlzEx.Theming.ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncWithAppMode;