[ImageResizer] Moving from ModernWPF to WpfUI (#26858)

* Moving from ModernWPF to WpfUI

* signing fix

* Spellcheck

* Sign fix 2

* Loc tweaks

* sign fix 3

* Move titlebar

* Tweaks

* Debug

* Fix again

* Updating preview package

* Fixes

* Update notice.md

---------

Co-authored-by: Stefan Markovic <stefan@janeasystems.com>
This commit is contained in:
Niels Laute
2023-08-08 15:19:38 +02:00
committed by GitHub
parent f6e9b08855
commit a49f806ac7
21 changed files with 417 additions and 405 deletions

View File

@@ -929,6 +929,7 @@ LEFTSCROLLBAR
LEFTUP LEFTUP
lego lego
len len
lepo
LError LError
Lessthan Lessthan
LEVELID LEVELID
@@ -2189,6 +2190,7 @@ wox
wparam wparam
wpf wpf
wpftmp wpftmp
wpfui
wpr wpr
wprp wprp
wql wql

View File

@@ -281,7 +281,8 @@
"WinUI3Apps\\SharpCompress.dll", "WinUI3Apps\\SharpCompress.dll",
"ColorCode.Core.dll", "ColorCode.Core.dll",
"ColorCode.UWP.dll", "ColorCode.UWP.dll",
"UnitsNet.dll" "UnitsNet.dll",
"Wpf.Ui.dll"
], ],
"SigningInfo": { "SigningInfo": {
"Operations": [ "Operations": [

View File

@@ -66,6 +66,7 @@
<PackageVersion Include="Vanara.PInvoke.User32" Version="3.4.11" /> <PackageVersion Include="Vanara.PInvoke.User32" Version="3.4.11" />
<PackageVersion Include="Vanara.PInvoke.Shell32" Version="3.4.11" /> <PackageVersion Include="Vanara.PInvoke.Shell32" Version="3.4.11" />
<PackageVersion Include="WinUIEx" Version="2.2.0" /> <PackageVersion Include="WinUIEx" Version="2.2.0" />
<PackageVersion Include="WPF-UI" Version="3.0.0-preview.4" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(IsExperimentationLive)'!=''"> <ItemGroup Condition="'$(IsExperimentationLive)'!=''">
<!-- Additional dependencies used by experimentation --> <!-- Additional dependencies used by experimentation -->

View File

@@ -337,4 +337,5 @@ SOFTWARE.
- Vanara.PInvoke.Shell32 3.4.11 - Vanara.PInvoke.Shell32 3.4.11
- Vanara.PInvoke.User32 3.4.11 - Vanara.PInvoke.User32 3.4.11
- WinUIEx 2.2.0 - WinUIEx 2.2.0
- WPF-UI 3.0.0-preview.4

View File

@@ -4,13 +4,12 @@
xmlns:m="clr-namespace:ImageResizer.Models" xmlns:m="clr-namespace:ImageResizer.Models"
xmlns:sys="clr-namespace:System;assembly=System.Runtime" xmlns:sys="clr-namespace:System;assembly=System.Runtime"
xmlns:v="clr-namespace:ImageResizer.Views" xmlns:v="clr-namespace:ImageResizer.Views"
xmlns:ui="http://schemas.modernwpf.com/2019"> xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ui:ThemeResources /> <ui:ThemesDictionary Theme="Dark" />
<ui:XamlControlsResources /> <ui:ControlsDictionary />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<ObjectDataProvider x:Key="ResizeFitValues" <ObjectDataProvider x:Key="ResizeFitValues"

View File

@@ -5,7 +5,6 @@
using System; using System;
using System.Text; using System.Text;
using System.Windows; using System.Windows;
using Common.UI;
using ImageResizer.Models; using ImageResizer.Models;
using ImageResizer.Properties; using ImageResizer.Properties;
using ImageResizer.Utilities; using ImageResizer.Utilities;
@@ -16,9 +15,6 @@ namespace ImageResizer
{ {
public partial class App : Application, IDisposable public partial class App : Application, IDisposable
{ {
private ThemeManager _themeManager;
private bool _isDisposed;
static App() static App()
{ {
Console.InputEncoding = Encoding.Unicode; Console.InputEncoding = Encoding.Unicode;
@@ -44,8 +40,6 @@ namespace ImageResizer
var mainWindow = new MainWindow(new MainViewModel(batch, Settings.Default)); var mainWindow = new MainWindow(new MainViewModel(batch, Settings.Default));
mainWindow.Show(); mainWindow.Show();
_themeManager = new ThemeManager(this);
// Temporary workaround for issue #1273 // Temporary workaround for issue #1273
BecomeForegroundWindow(new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle); BecomeForegroundWindow(new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle);
} }
@@ -58,23 +52,9 @@ namespace ImageResizer
NativeMethods.SetForegroundWindow(hWnd); NativeMethods.SetForegroundWindow(hWnd);
} }
protected virtual void Dispose(bool disposing)
{
if (!_isDisposed)
{
if (disposing)
{
_themeManager?.Dispose();
}
_isDisposed = true;
}
}
public void Dispose() public void Dispose()
{ {
// Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method
Dispose(disposing: true);
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
} }

View File

@@ -56,8 +56,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" /> <PackageReference Include="Microsoft.Windows.CsWinRT" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" /> <PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" />
<PackageReference Include="ModernWpfUI" />
<PackageReference Include="System.IO.Abstractions" /> <PackageReference Include="System.IO.Abstractions" />
<PackageReference Include="WPF-UI" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\common\GPOWrapperProjection\GPOWrapperProjection.csproj" /> <ProjectReference Include="..\..\..\common\GPOWrapperProjection\GPOWrapperProjection.csproj" />

View File

@@ -19,7 +19,7 @@ namespace ImageResizer.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources { public class Resources {
@@ -87,6 +87,15 @@ namespace ImageResizer.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to H.
/// </summary>
public static string HeightChar {
get {
return ResourceManager.GetString("HeightChar", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Image Resizer. /// Looks up a localized string similar to Image Resizer.
/// </summary> /// </summary>
@@ -214,7 +223,7 @@ namespace ImageResizer.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Open settings. /// Looks up a localized string similar to Settings.
/// </summary> /// </summary>
public static string Open_settings { public static string Open_settings {
get { get {
@@ -277,7 +286,7 @@ namespace ImageResizer.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to _Stop. /// Looks up a localized string similar to Stop.
/// </summary> /// </summary>
public static string Progress_Stop { public static string Progress_Stop {
get { get {
@@ -554,5 +563,14 @@ namespace ImageResizer.Properties {
return ResourceManager.GetString("Width", resourceCulture); return ResourceManager.GetString("Width", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized string similar to W.
/// </summary>
public static string WidthChar {
get {
return ResourceManager.GetString("WidthChar", resourceCulture);
}
}
} }
} }

View File

@@ -185,7 +185,7 @@
<value>Resizing your pictures...</value> <value>Resizing your pictures...</value>
</data> </data>
<data name="Progress_Stop" xml:space="preserve"> <data name="Progress_Stop" xml:space="preserve">
<value>_Stop</value> <value>Stop</value>
</data> </data>
<data name="Progress_TimeRemaining_HourMinute" xml:space="preserve"> <data name="Progress_TimeRemaining_HourMinute" xml:space="preserve">
<value>About {0} hour, {1} minute remaining.</value> <value>About {0} hour, {1} minute remaining.</value>
@@ -278,9 +278,17 @@
<value>Width</value> <value>Width</value>
</data> </data>
<data name="Open_settings" xml:space="preserve"> <data name="Open_settings" xml:space="preserve">
<value>Open settings</value> <value>Settings</value>
</data> </data>
<data name="Input_RemoveMetadata" xml:space="preserve"> <data name="Input_RemoveMetadata" xml:space="preserve">
<value>Remove metadata that doesn't affect rendering</value> <value>Remove metadata that doesn't affect rendering</value>
</data> </data>
<data name="HeightChar" xml:space="preserve">
<value>H</value>
<comment>First character of 'Height'</comment>
</data>
<data name="WidthChar" xml:space="preserve">
<value>W</value>
<comment>First character of 'Width'</comment>
</data>
</root> </root>

View File

@@ -1,18 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">Dark.Accent1</system:String>
<system:String x:Key="Theme.Origin">PowerToysImageResizer</system:String>
<system:String x:Key="Theme.DisplayName">Accent1 (Dark)</system:String>
<system:String x:Key="Theme.BaseColorScheme">Dark</system:String>
<system:String x:Key="Theme.ColorScheme">Accent1</system:String>
<Color x:Key="Theme.PrimaryAccentColor">Black</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF3a3a3a" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF333333" />
<SolidColorBrush x:Key="PrimaryForegroundBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF999999" />
<SolidColorBrush x:Key="PrimaryBorderBrush" Color="Transparent"/>
</ResourceDictionary>

View File

@@ -1,18 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent2</system:String>
<system:String x:Key="Theme.Origin">PowerToysImageResizer</system:String>
<system:String x:Key="Theme.DisplayName">Accent2 (HighContrast)</system:String>
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
<system:String x:Key="Theme.ColorScheme">Accent2</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF3a3a3a" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF333333" />
<SolidColorBrush x:Key="PrimaryForegroundBrush" Color="#FFffff00" />
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF00ff00" />
<SolidColorBrush x:Key="PrimaryBorderBrush" Color="#FFffff00"/>
</ResourceDictionary>

View File

@@ -1,19 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent3</system:String>
<system:String x:Key="Theme.Origin">PowerToysImageResizer</system:String>
<system:String x:Key="Theme.DisplayName">Accent3 (HighContrast)</system:String>
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
<system:String x:Key="Theme.ColorScheme">Accent3</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF3a3a3a" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF333333" />
<SolidColorBrush x:Key="PrimaryForegroundBrush" Color="#FF00ff00" />
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FFc0c0c0" />
<SolidColorBrush x:Key="PrimaryBorderBrush" Color="#FF00ff00"/>
</ResourceDictionary>

View File

@@ -1,18 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent4</system:String>
<system:String x:Key="Theme.Origin">PowerToysImageResizer</system:String>
<system:String x:Key="Theme.DisplayName">Accent4 (HighContrast)</system:String>
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
<system:String x:Key="Theme.ColorScheme">Accent4</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FF3a3a3a" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FF333333" />
<SolidColorBrush x:Key="PrimaryForegroundBrush" Color="#FFffffff" />
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF1aebff" />
<SolidColorBrush x:Key="PrimaryBorderBrush" Color="White"/>
</ResourceDictionary>

View File

@@ -1,18 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">HighContrast.Accent5</system:String>
<system:String x:Key="Theme.Origin">PowerToysImageResizer</system:String>
<system:String x:Key="Theme.DisplayName">Accent5 (HighContrast)</system:String>
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
<system:String x:Key="Theme.ColorScheme">Accent5</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FFf3f3f3" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FFffffff" />
<SolidColorBrush x:Key="PrimaryForegroundBrush" Color="#FF000000" />
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF676666" />
<SolidColorBrush x:Key="PrimaryBorderBrush" Color="Black"/>
</ResourceDictionary>

View File

@@ -1,18 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=System.Runtime">
<!-- Metadata -->
<system:String x:Key="Theme.Name">Light.Accent1</system:String>
<system:String x:Key="Theme.Origin">PowerToysImageResizer</system:String>
<system:String x:Key="Theme.DisplayName">Accent1 (Light)</system:String>
<system:String x:Key="Theme.BaseColorScheme">Light</system:String>
<system:String x:Key="Theme.ColorScheme">Accent1</system:String>
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
<SolidColorBrush x:Key="SecondaryBackgroundBrush" Color="#FFf3f3f3" />
<SolidColorBrush x:Key="PrimaryBackgroundBrush" Color="#FFffffff" />
<SolidColorBrush x:Key="PrimaryForegroundBrush" Color="#FF000000" />
<SolidColorBrush x:Key="SecondaryForegroundBrush" Color="#FF676666" />
<SolidColorBrush x:Key="PrimaryBorderBrush" Color="Transparent"/>
</ResourceDictionary>

View File

@@ -1,209 +1,295 @@
<UserControl x:Class="ImageResizer.Views.InputPage" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="ImageResizer.Views.InputPage"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:ImageResizer.Views" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:ImageResizer.Models" xmlns:m="clr-namespace:ImageResizer.Models"
xmlns:p="clr-namespace:ImageResizer.Properties" xmlns:p="clr-namespace:ImageResizer.Properties"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml">
MinWidth="350">
<Grid Background="{DynamicResource PrimaryBackgroundBrush}">
<Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" MinHeight="84"/> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto"/> <RowDefinition Height="*" />
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<ComboBox x:Name="SizeComboBox" <ComboBox
ItemsSource="{Binding Settings.AllSizes}" x:Name="SizeComboBox"
HorizontalAlignment="Stretch" Grid.Row="1"
Margin="12" Height="64"
SelectedIndex="{Binding Settings.SelectedSizeIndex}" Margin="16,16,16,24"
ui:ControlHelper.Header="{x:Static p:Resources.Input_Content}"> HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
VerticalContentAlignment="Stretch"
ItemsSource="{Binding Settings.AllSizes}"
SelectedIndex="{Binding Settings.SelectedSizeIndex}">
<ComboBox.Resources> <ComboBox.Resources>
<DataTemplate DataType="{x:Type m:ResizeSize}"> <DataTemplate DataType="{x:Type m:ResizeSize}">
<Grid Margin="0,6,0,0" AutomationProperties.Name="{Binding Name}"> <Grid Margin="2,0,0,0" VerticalAlignment="Center" AutomationProperties.Name="{Binding Name}">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="20" /> <RowDefinition Height="Auto" />
<RowDefinition Height="24" /> <RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="{Binding Name}" <TextBlock FontWeight="SemiBold" Text="{Binding Name}" />
FontSize="14" <StackPanel
FontWeight="SemiBold"/> Grid.Row="1"
<StackPanel Orientation="Horizontal" VerticalAlignment="Top"
Grid.Row="1" Orientation="Horizontal">
VerticalAlignment="Top"> <TextBlock
<TextBlock Text="{Binding Fit, Converter={StaticResource EnumValueConverter}, ConverterParameter=ThirdPersonSingular}" FontSize="12"
Style="{StaticResource CaptionTextBlockStyle}" Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"/> Text="{Binding Fit, Converter={StaticResource EnumValueConverter}, ConverterParameter=ThirdPersonSingular}" />
<TextBlock Text="{Binding Width, Converter={StaticResource AutoDoubleConverter}, ConverterParameter=Auto}" <TextBlock
Margin="4,0,0,0" Margin="4,0,0,0"
Style="{StaticResource CaptionTextBlockStyle}" FontSize="12"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"/> FontWeight="SemiBold"
<TextBlock Text="×" Text="{Binding Width, Converter={StaticResource AutoDoubleConverter}, ConverterParameter=Auto}" />
Margin="4,0,0,0" <TextBlock
Style="{StaticResource CaptionTextBlockStyle}" Margin="4,0,0,0"
Foreground="{DynamicResource TextFillColorSecondaryBrush}" FontSize="12"
Visibility="{Binding ShowHeight, Converter={StaticResource BoolValueConverter}}"/> Foreground="{DynamicResource TextFillColorSecondaryBrush}"
<TextBlock Text="{Binding Height, Converter={StaticResource AutoDoubleConverter}, ConverterParameter=Auto}" Text="×"
Margin="4,0,0,0" Visibility="{Binding ShowHeight, Converter={StaticResource BoolValueConverter}}" />
Style="{StaticResource CaptionTextBlockStyle}" <TextBlock
Foreground="{DynamicResource TextFillColorSecondaryBrush}" Margin="4,0,0,0"
Visibility="{Binding ShowHeight, Converter={StaticResource BoolValueConverter}}"/> FontSize="12"
<TextBlock Text="{Binding Unit, Converter={StaticResource EnumValueConverter}, ConverterParameter=ToLower}" FontWeight="SemiBold"
Margin="4,0,0,0" Text="{Binding Height, Converter={StaticResource AutoDoubleConverter}, ConverterParameter=Auto}"
Style="{StaticResource CaptionTextBlockStyle}" Visibility="{Binding ShowHeight, Converter={StaticResource BoolValueConverter}}" />
Foreground="{DynamicResource TextFillColorSecondaryBrush}"/> <TextBlock
Margin="4,0,0,0"
FontSize="12"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{Binding Unit, Converter={StaticResource EnumValueConverter}, ConverterParameter=ToLower}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type m:CustomSize}"> <DataTemplate DataType="{x:Type m:CustomSize}">
<Grid Height="50" <Grid VerticalAlignment="Center" AutomationProperties.Name="{Binding Name}">
AutomationProperties.Name="{Binding Name}"> <TextBlock
FontWeight="SemiBold"
<TextBlock Text="{Binding Name}" Text="{Binding Name}" />
Margin="0,0,0,0"
VerticalAlignment="Center"
FontSize="14"
FontWeight="SemiBold"
Foreground="{DynamicResource PrimaryForegroundBrush}" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ComboBox.Resources> </ComboBox.Resources>
</ComboBox> </ComboBox>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="12,0,12,12" Visibility="{Binding ElementName=SizeComboBox, Path=SelectedValue, Converter={StaticResource SizeTypeToVisibilityConverter}}"> <Grid Grid.Row="2">
<ComboBox ItemsSource="{Binding Source={StaticResource ResizeFitValues}}" <Grid.RowDefinitions>
AutomationProperties.Name="{x:Static p:Resources.Resize_Type}" <RowDefinition Height="Auto" />
Height="56" <RowDefinition Height="*" />
MinWidth="120" <RowDefinition Height="Auto" />
ui:ControlHelper.Header="{x:Static p:Resources.Resize_Type}" <RowDefinition Height="Auto" />
Text="{Binding ElementName=SizeComboBox, Path= SelectedValue.Fit, Mode=TwoWay}"/> <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border
Grid.RowSpan="5"
Background="{DynamicResource LayerFillColorDefaultBrush}"
BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0" />
<ui:NumberBox SpinButtonPlacementMode="Compact" <Grid
Minimum="0" Height="86"
Width="102" Margin="18,16,16,16"
Name="WidthNumberBox" Visibility="{Binding ElementName=SizeComboBox, Path=SelectedValue, Converter={StaticResource SizeTypeToVisibilityConverter}}">
KeyDown="Button_KeyDown" <Grid.ColumnDefinitions>
AutomationProperties.Name="{x:Static p:Resources.Width}" <ColumnDefinition Width="20" />
Margin="8,0,0,0"> <ColumnDefinition Width="*" />
<ui:ControlHelper.Header> <ColumnDefinition Width="24" />
<TextBlock Text="{x:Static p:Resources.Width}" Margin="0,0,0,-1" /> <ColumnDefinition Width="20" />
</ui:ControlHelper.Header> <ColumnDefinition Width="*" />
<ui:NumberBox.Value> </Grid.ColumnDefinitions>
<Binding ElementName="SizeComboBox" Path="SelectedValue.Width" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"/> <Grid.RowDefinitions>
</ui:NumberBox.Value> <RowDefinition Height="Auto" />
</ui:NumberBox> <RowDefinition Height="8" />
<TextBlock VerticalAlignment="Center" <RowDefinition Height="Auto" />
Text="&#xE947;" </Grid.RowDefinitions>
FontFamily="{StaticResource SymbolThemeFontFamily}"
Width="24"
Foreground="{DynamicResource SecondaryForegroundBrush}"
Name="Times_Symbol"
AutomationProperties.Name="{x:Static p:Resources.Times_Symbol}"
TextAlignment="Center"
Margin="0,8,0,0"
Visibility="{Binding ElementName=SizeComboBox, Path= SelectedValue.ShowHeight, Converter={StaticResource BoolValueConverter}}"/>
<ui:NumberBox DataContext="{Binding ElementName=SizeComboBox, Path=SelectedItem}"
SpinButtonPlacementMode="Compact"
Minimum="0"
Width="102"
Name="HeightNumberBox"
KeyDown="Button_KeyDown"
AutomationProperties.Name="{x:Static p:Resources.Height}"
Visibility="{Binding ElementName=SizeComboBox, Path= SelectedValue.ShowHeight, Converter={StaticResource BoolValueConverter}}">
<ui:ControlHelper.Header>
<TextBlock Text="{x:Static p:Resources.Height}" Margin="0,0,0,-1" />
</ui:ControlHelper.Header>
<ui:NumberBox.Value>
<Binding ElementName="SizeComboBox" Path="SelectedValue.Height" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"/>
</ui:NumberBox.Value>
</ui:NumberBox>
<ComboBox Margin="8,0,0,0"
Height="56"
ItemsSource="{Binding Source={StaticResource ResizeUnitValues}}"
AutomationProperties.Name="{x:Static p:Resources.Unit}"
ui:ControlHelper.Header="{x:Static p:Resources.Unit}"
Text="{Binding ElementName=SizeComboBox, Path= SelectedValue.Unit, Mode=TwoWay}"/>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Vertical"> <TextBlock
HorizontalAlignment="Left"
VerticalAlignment="Center"
AutomationProperties.Name="{x:Static p:Resources.Width}"
FontSize="12"
FontWeight="SemiBold"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{x:Static p:Resources.WidthChar}"
ToolTipService.ToolTip="{x:Static p:Resources.Width}" />
<ui:NumberBox
Name="WidthNumberBox"
Grid.Column="1"
HorizontalAlignment="Stretch"
AutomationProperties.Name="{x:Static p:Resources.Width}"
KeyDown="Button_KeyDown"
Minimum="0"
SpinButtonPlacementMode="Inline">
<ui:NumberBox.Value>
<Binding
ElementName="SizeComboBox"
Mode="TwoWay"
Path="SelectedValue.Width"
UpdateSourceTrigger="PropertyChanged" />
</ui:NumberBox.Value>
</ui:NumberBox>
<TextBlock
Grid.Column="3"
HorizontalAlignment="Left"
VerticalAlignment="Center"
AutomationProperties.Name="{x:Static p:Resources.Height}"
FontSize="12"
FontWeight="SemiBold"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Text="{x:Static p:Resources.HeightChar}"
ToolTipService.ToolTip="{x:Static p:Resources.Height}"
Visibility="{Binding ElementName=SizeComboBox, Path=SelectedValue.ShowHeight, Converter={StaticResource BoolValueConverter}}" />
<ui:NumberBox
Name="HeightNumberBox"
Grid.Column="4"
HorizontalAlignment="Stretch"
AutomationProperties.Name="{x:Static p:Resources.Height}"
DataContext="{Binding ElementName=SizeComboBox, Path=SelectedItem}"
KeyDown="Button_KeyDown"
Minimum="0"
SpinButtonPlacementMode="Inline"
Visibility="{Binding ElementName=SizeComboBox, Path=SelectedValue.ShowHeight, Converter={StaticResource BoolValueConverter}}">
<CheckBox Margin="12,4,12,0" <ui:NumberBox.Value>
Content="{x:Static p:Resources.Input_ShrinkOnly}" <Binding
IsChecked="{Binding Settings.ShrinkOnly}"/> ElementName="SizeComboBox"
Mode="TwoWay"
<CheckBox Margin="12,4,12,0" Path="SelectedValue.Height"
Content="{x:Static p:Resources.Input_IgnoreOrientation}" UpdateSourceTrigger="PropertyChanged" />
IsChecked="{Binding Settings.IgnoreOrientation}"/> </ui:NumberBox.Value>
<!-- TODO: This option doesn't make much sense when resizing into a directory. We should swap it for an option </ui:NumberBox>
to overwrite any files in the directory instead (issue #88) -->
<CheckBox Margin="12,4,12,0"
Content="{x:Static p:Resources.Input_Replace}"
IsChecked="{Binding Settings.Replace}"/>
<CheckBox Margin="12,4,12,0" <ui:SymbolIcon
Content="{x:Static p:Resources.Input_RemoveMetadata}" Grid.Row="2"
IsChecked="{Binding Settings.RemoveMetadata}"/> Margin="-2,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Symbol="ArrowMaximize16"
ToolTipService.ToolTip="{x:Static p:Resources.Resize_Type}" />
<TextBlock Grid.Column="0" <ComboBox
FontWeight="Bold" Grid.Row="2"
Text="{x:Static p:Resources.Input_GifWarning}" Grid.Column="1"
TextWrapping="Wrap" HorizontalAlignment="Stretch"
Margin="12,12,12,0" AutomationProperties.Name="{x:Static p:Resources.Resize_Type}"
HorizontalAlignment="Right" ItemsSource="{Binding Source={StaticResource ResizeFitValues}}"
TextAlignment="Left" Text="{Binding ElementName=SizeComboBox, Path=SelectedValue.Fit, Mode=TwoWay}" />
Foreground="{ui:ThemeResource SystemControlErrorTextForegroundBrush}"
Visibility="{Binding TryingToResizeGifFiles, Converter={StaticResource BoolValueConverter}}" <ui:SymbolIcon
/> Grid.Row="2"
</StackPanel> Grid.Column="3"
Margin="-2,0,0,0"
<Border Margin="0,12,0,0" HorizontalAlignment="Left"
Background="{DynamicResource SecondaryBackgroundBrush}" VerticalAlignment="Center"
BorderBrush="{DynamicResource PrimaryBorderBrush}" FontSize="18"
BorderThickness="0,1,0,0" Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Padding="12" Symbol="Ruler16"
Grid.Row="3"> ToolTipService.ToolTip="{x:Static p:Resources.Unit}" />
<Grid>
<ComboBox
Grid.Row="2"
Grid.Column="4"
AutomationProperties.Name="{x:Static p:Resources.Unit}"
ItemsSource="{Binding Source={StaticResource ResizeUnitValues}}"
Text="{Binding ElementName=SizeComboBox, Path=SelectedValue.Unit, Mode=TwoWay}" />
</Grid>
<StackPanel
Grid.Row="1"
VerticalAlignment="Top"
Orientation="Vertical">
<CheckBox
Margin="16,12,16,0"
Content="{x:Static p:Resources.Input_ShrinkOnly}"
IsChecked="{Binding Settings.ShrinkOnly}" />
<CheckBox
Margin="16,2,16,0"
Content="{x:Static p:Resources.Input_IgnoreOrientation}"
IsChecked="{Binding Settings.IgnoreOrientation}" />
<!--
TODO: This option doesn't make much sense when resizing into a directory. We should swap it for an option
to overwrite any files in the directory instead (issue #88)
-->
<CheckBox
Margin="16,2,16,0"
Content="{x:Static p:Resources.Input_Replace}"
IsChecked="{Binding Settings.Replace}" />
<CheckBox
Margin="16,2,16,0"
Content="{x:Static p:Resources.Input_RemoveMetadata}"
IsChecked="{Binding Settings.RemoveMetadata}" />
</StackPanel>
<Border
Grid.Row="2"
Height="1"
Margin="0,12,0,8"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Background="{DynamicResource DividerStrokeColorDefaultBrush}" />
<ui:InfoBar
Grid.Row="3"
Margin="16,0,16,0"
Padding="12,8,8,8"
IsClosable="False"
IsOpen="{Binding TryingToResizeGifFiles}"
Message="{x:Static p:Resources.Input_GifWarning}"
Severity="Warning" />
<Grid Grid.Row="4" Margin="16,8,16,16">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Width="36"
Command="{Binding OpenSettingsCommand}" <ui:Button
Width="36"
Height="36" Height="36"
Margin="-8,0,0,0" Margin="-6,0,0,0"
Content="&#xE713;" Padding="0"
Background="Transparent"
FontFamily="{StaticResource SymbolThemeFontFamily}"
FontSize="16"
HorizontalAlignment="Left" HorizontalAlignment="Left"
ToolTipService.ToolTip="{x:Static p:Resources.Open_settings}" AutomationProperties.Name="{x:Static p:Resources.Open_settings}"
AutomationProperties.Name="{x:Static p:Resources.Open_settings}" /> Background="Transparent"
BorderBrush="Transparent"
Command="{Binding OpenSettingsCommand}"
ToolTipService.ToolTip="{x:Static p:Resources.Open_settings}">
<ui:Button.Content>
<ui:SymbolIcon FontSize="18" Symbol="Settings20" />
</ui:Button.Content>
</ui:Button>
<ui:Button
Grid.Column="1"
MinWidth="76"
Margin="8,0,0,0"
Appearance="Primary"
AutomationProperties.Name="{x:Static p:Resources.Resize_Tooltip}"
Command="{Binding ResizeCommand}"
IsDefault="True">
<StackPanel Orientation="Horizontal">
<ui:SymbolIcon FontSize="18" Symbol="ResizeImage20" />
<TextBlock Margin="8,0,0,0" Text="{x:Static p:Resources.Input_Resize}" />
</StackPanel>
</ui:Button>
<Button Grid.Column="1" <ui:Button
Style="{StaticResource AccentButtonStyle}" Grid.Column="2"
MinWidth="76" MinWidth="76"
Margin="12,0,0,0" Margin="8,0,0,0"
Command="{Binding ResizeCommand}" Command="{Binding CancelCommand}"
AutomationProperties.Name="{x:Static p:Resources.Resize_Tooltip}" Content="{x:Static p:Resources.Cancel}"
Content="{x:Static p:Resources.Input_Resize}" IsCancel="True" />
IsDefault="True"/>
<Button Grid.Column="2"
Style="{StaticResource DefaultButtonStyle}"
MinWidth="76"
Margin="12,0,0,0"
Command="{Binding CancelCommand}"
Content="{x:Static p:Resources.Cancel}"
IsCancel="True"/>
</Grid> </Grid>
</Border>
</Grid>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -5,8 +5,9 @@
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
using ImageResizer.ViewModels; using ImageResizer.ViewModels;
using ModernWpf.Controls; using Wpf.Ui.Controls;
using static ImageResizer.ViewModels.InputViewModel; using static ImageResizer.ViewModels.InputViewModel;
using Numberbox = Wpf.Ui.Controls.NumberBox;
namespace ImageResizer.Views namespace ImageResizer.Views
{ {
@@ -31,7 +32,7 @@ namespace ImageResizer.Views
var viewModel = (InputViewModel)this.DataContext; var viewModel = (InputViewModel)this.DataContext;
double number; double number;
KeyPressParams keyParams; KeyPressParams keyParams;
if (double.TryParse(((TextBox)e.OriginalSource).Text, out number)) if (double.TryParse(((System.Windows.Controls.TextBox)e.OriginalSource).Text, out number))
{ {
// Determine which NumberBox triggered the event based on its name // Determine which NumberBox triggered the event based on its name
switch (numberBox.Name) switch (numberBox.Name)

View File

@@ -1,44 +1,64 @@
<Window x:Class="ImageResizer.Views.MainWindow" <ui:FluentWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="ImageResizer.Views.MainWindow"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:ImageResizer.Views" xmlns:local="clr-namespace:ImageResizer.Views"
xmlns:p="clr-namespace:ImageResizer.Properties" xmlns:p="clr-namespace:ImageResizer.Properties"
xmlns:vm="clr-namespace:ImageResizer.ViewModels" xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Content="{Binding CurrentPage}" xmlns:vm="clr-namespace:ImageResizer.ViewModels"
Icon="/PowerToys.ImageResizer;component/Resources/ImageResizer.ico" Name="_this"
Name="_this" Width="360"
ResizeMode="NoResize" Height="506"
SizeToContent="WidthAndHeight" ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
MinWidth="485" ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Title="{x:Static p:Resources.ImageResizer}" AutomationProperties.Name="{x:Static p:Resources.ImageResizer}"
WindowStartupLocation="CenterScreen" ExtendsContentIntoTitleBar="True"
ui:WindowHelper.UseModernWindowStyle="True" Icon="/PowerToys.ImageResizer;component/Resources/ImageResizer.ico"
ui:TitleBar.IsIconVisible="True" ResizeMode="NoResize"
ui:TitleBar.Background="{DynamicResource PrimaryBackgroundBrush}" WindowBackdropType="Mica"
AutomationProperties.Name="{x:Static p:Resources.ImageResizer}"> WindowCornerPreference="Default"
WindowStartupLocation="CenterScreen">
<Window.Resources> <Window.Resources>
<DataTemplate DataType="{x:Type vm:InputViewModel}"> <DataTemplate DataType="{x:Type vm:InputViewModel}">
<local:InputPage/> <local:InputPage />
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type vm:ProgressViewModel}"> <DataTemplate DataType="{x:Type vm:ProgressViewModel}">
<local:ProgressPage/> <local:ProgressPage />
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type vm:ResultsViewModel}"> <DataTemplate DataType="{x:Type vm:ResultsViewModel}">
<local:ResultsPage/> <local:ResultsPage />
</DataTemplate> </DataTemplate>
</Window.Resources> </Window.Resources>
<Window.TaskbarItemInfo> <Window.TaskbarItemInfo>
<TaskbarItemInfo ProgressState="Normal" ProgressValue="{Binding Progress}"/> <TaskbarItemInfo ProgressState="Normal" ProgressValue="{Binding Progress}" />
</Window.TaskbarItemInfo> </Window.TaskbarItemInfo>
<behaviors:Interaction.Triggers> <behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="Loaded"> <behaviors:EventTrigger EventName="Loaded">
<behaviors:InvokeCommandAction Command="{Binding LoadCommand}" CommandParameter="{Binding ElementName=_this}"/> <behaviors:InvokeCommandAction Command="{Binding LoadCommand}" CommandParameter="{Binding ElementName=_this}" />
</behaviors:EventTrigger> </behaviors:EventTrigger>
</behaviors:Interaction.Triggers> </behaviors:Interaction.Triggers>
</Window> <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ui:TitleBar
x:Name="TitleBar"
Title="{x:Static p:Resources.ImageResizer}"
Grid.Row="0"
Height="32"
Padding="16,0,16,0"
ShowMaximize="False"
ShowMinimize="False">
<ui:TitleBar.Icon>
<ui:ImageIcon Source="/PowerToys.ImageResizer;component/Resources/ImageResizer.ico" />
</ui:TitleBar.Icon>
</ui:TitleBar>
<ContentPresenter Grid.Row="1" Content="{Binding CurrentPage}" />
</Grid>
</ui:FluentWindow>

View File

@@ -5,18 +5,19 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows;
using ImageResizer.ViewModels; using ImageResizer.ViewModels;
using Microsoft.Win32; using Microsoft.Win32;
using Wpf.Ui.Controls;
using AppResources = ImageResizer.Properties.Resources; using AppResources = ImageResizer.Properties.Resources;
namespace ImageResizer.Views namespace ImageResizer.Views
{ {
public partial class MainWindow : Window, IMainView public partial class MainWindow : FluentWindow, IMainView
{ {
public MainWindow(MainViewModel viewModel) public MainWindow(MainViewModel viewModel)
{ {
DataContext = viewModel; DataContext = viewModel;
Wpf.Ui.Appearance.Watcher.Watch(this);
InitializeComponent(); InitializeComponent();
} }

View File

@@ -1,45 +1,45 @@
<UserControl x:Class="ImageResizer.Views.ProgressPage" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="ImageResizer.Views.ProgressPage"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ImageResizer.Views" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:p="clr-namespace:ImageResizer.Properties" xmlns:local="clr-namespace:ImageResizer.Views"
Background="{DynamicResource PrimaryBackgroundBrush}" xmlns:p="clr-namespace:ImageResizer.Properties">
MinWidth="350">
<UserControl.Resources> <UserControl.Resources>
<local:TimeRemainingConverter x:Key="TimeRemainingConverter"/> <local:TimeRemainingConverter x:Key="TimeRemainingConverter" />
</UserControl.Resources> </UserControl.Resources>
<behaviors:Interaction.Triggers> <behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="Loaded"> <behaviors:EventTrigger EventName="Loaded">
<behaviors:InvokeCommandAction Command="{Binding StartCommand}"/> <behaviors:InvokeCommandAction Command="{Binding StartCommand}" />
</behaviors:EventTrigger> </behaviors:EventTrigger>
</behaviors:Interaction.Triggers> </behaviors:Interaction.Triggers>
<StackPanel> <StackPanel>
<TextBlock Margin="12,12,12,0" <TextBlock
FontSize="16" Margin="12,12,12,0"
Foreground="{DynamicResource PrimaryForegroundBrush}" FontSize="16"
Text="{x:Static p:Resources.Progress_MainInstruction}"/> Text="{x:Static p:Resources.Progress_MainInstruction}" />
<TextBlock Margin="12,12,12,0" <TextBlock
Foreground="{DynamicResource PrimaryForegroundBrush}" Margin="12,12,12,0"
Text="{Binding TimeRemaining,Converter={StaticResource TimeRemainingConverter}}"/> Foreground="{DynamicResource TextFillColorSecondaryBrush}"
<ProgressBar Height="16" Text="{Binding TimeRemaining, Converter={StaticResource TimeRemainingConverter}}" />
Margin="12,12,12,0" <ProgressBar
Value="{Binding Progress}" Height="16"
Maximum="1"/> Margin="12,12,12,0"
<Border Margin="0,12,0,0" Maximum="1"
Background="{DynamicResource SecondaryBackgroundBrush}" Value="{Binding Progress}" />
BorderBrush="{DynamicResource PrimaryBorderBrush}" <Border
BorderThickness="0,1,0,0" Margin="0,12,0,0"
Padding="12,12"> Padding="12,12"
BorderThickness="0,1,0,0">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button MinWidth="76" <Button
Style="{StaticResource AccentButtonStyle}" MinWidth="76"
Command="{Binding StopCommand}" Command="{Binding StopCommand}"
Content="{x:Static p:Resources.Progress_Stop}" Content="{x:Static p:Resources.Progress_Stop}"
IsCancel="True"/> IsCancel="True" />
</StackPanel> </StackPanel>
</Border> </Border>
</StackPanel> </StackPanel>

View File

@@ -1,43 +1,46 @@
<UserControl x:Class="ImageResizer.Views.ResultsPage" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="ImageResizer.Views.ResultsPage"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:p="clr-namespace:ImageResizer.Properties" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="350" xmlns:p="clr-namespace:ImageResizer.Properties">
Background="{DynamicResource PrimaryBackgroundBrush}">
<StackPanel> <StackPanel>
<TextBlock Margin="12,12,12,0" <TextBlock
FontSize="16" Margin="12,12,12,0"
Foreground="{DynamicResource PrimaryForegroundBrush}" FontSize="16"
Text="{x:Static p:Resources.Results_MainInstruction}"/> Text="{x:Static p:Resources.Results_MainInstruction}" />
<ScrollViewer MaxWidth="363" <ScrollViewer
MaxHeight="350" MaxWidth="363"
HorizontalAlignment="Stretch" MaxHeight="350"
VerticalScrollBarVisibility="Auto"> HorizontalAlignment="Stretch"
VerticalScrollBarVisibility="Auto">
<ItemsControl Margin="12,4,12,0" ItemsSource="{Binding Errors}"> <ItemsControl Margin="12,4,12,0" ItemsSource="{Binding Errors}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate DataType="ResizeError"> <DataTemplate DataType="ResizeError">
<StackPanel> <StackPanel>
<TextBlock Margin="0,8,0,0" <TextBlock
FontWeight="Bold" Margin="0,8,0,0"
Text="{Binding File}"/> FontWeight="Bold"
<TextBlock Text="{Binding Error}" TextWrapping="Wrap"/> Text="{Binding File}" />
<TextBlock Text="{Binding Error}" TextWrapping="Wrap" />
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</ScrollViewer> </ScrollViewer>
<Border Margin="0,12,0,0" <Border
Background="{DynamicResource SecondaryBackgroundBrush}" Margin="0,12,0,0"
BorderBrush="{DynamicResource PrimaryBorderBrush}" Padding="12,12"
BorderThickness="0,1,0,0" Background="{DynamicResource LayerFillColorDefaultBrush}"
Padding="12,12"> BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button MinWidth="76" <Button
Command="{Binding CloseCommand}" MinWidth="76"
Content="{x:Static p:Resources.Results_Close}" Command="{Binding CloseCommand}"
IsCancel="True" Content="{x:Static p:Resources.Results_Close}"
IsDefault="True"/> IsCancel="True"
IsDefault="True" />
</StackPanel> </StackPanel>
</Border> </Border>
</StackPanel> </StackPanel>