From b12a2ba4f0b3fe9c13f539531c37baff213fc5c9 Mon Sep 17 00:00:00 2001 From: lipchev Date: Sat, 28 Dec 2024 22:21:27 +0200 Subject: [PATCH 1/3] Update the Samples (v6) - projects converted to Sdk style - added a new Directory.Packages for the Samples folder and updated the references to the latest (working) versions - minor fixes to the UnitConverter.Wpf --- Samples/Directory.Packages.props | 15 ++ .../MvvmSample.Wpf/MvvmSample.Wpf.csproj | 164 ++---------------- .../MvvmSample.Wpf/packages.config | 17 -- .../UnitConverter.Console.csproj | 20 +-- .../UnitConverter.Wpf/App.xaml | 6 +- .../UnitConverter.Wpf/IMainWindowVm.cs | 6 +- .../UnitConverter.Wpf/MainWindow.xaml | 26 ++- .../UnitConverter.Wpf/MainWindowDesignVM.cs | 6 +- .../UnitConverter.Wpf/MainWindowVM.cs | 20 +-- .../UnitConverter.Wpf.csproj | 124 ++----------- .../UnitConverter.Wpf/UnitListItem.cs | 2 +- .../UnitConverter.Wpf/packages.config | 7 - 12 files changed, 83 insertions(+), 330 deletions(-) create mode 100644 Samples/Directory.Packages.props delete mode 100644 Samples/MvvmSample.Wpf/MvvmSample.Wpf/packages.config delete mode 100644 Samples/UnitConverter.Wpf/UnitConverter.Wpf/packages.config diff --git a/Samples/Directory.Packages.props b/Samples/Directory.Packages.props new file mode 100644 index 0000000000..352b73614b --- /dev/null +++ b/Samples/Directory.Packages.props @@ -0,0 +1,15 @@ + + + true + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MvvmSample.Wpf.csproj b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MvvmSample.Wpf.csproj index 05e93234d6..04d852be7f 100644 --- a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MvvmSample.Wpf.csproj +++ b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MvvmSample.Wpf.csproj @@ -1,163 +1,29 @@ - - - + - Debug - AnyCPU - {B72F9215-70FF-4155-89BC-9A02CC550447} + net48 WinExe WpfMVVMSample - MvvmSample.Wpf - v4.8 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false + true + true - - ..\..\packages\Unity.5.8.11\lib\net47\CommonServiceLocator.dll - - - ..\..\packages\Prism.Core.7.1.0.431\lib\net45\Prism.dll - - - ..\..\packages\Prism.Unity.7.1.0.431\lib\net45\Prism.Unity.Wpf.dll - - - ..\..\packages\Prism.Wpf.7.1.0.431\lib\net45\Prism.Wpf.dll - - + + + + + + + + - - ..\..\packages\System.Configuration.ConfigurationManager.4.5.0\lib\net461\System.Configuration.ConfigurationManager.dll - - - - - ..\..\packages\System.Security.AccessControl.4.5.0\lib\net461\System.Security.AccessControl.dll - - - ..\..\packages\System.Security.Permissions.4.5.0\lib\net461\System.Security.Permissions.dll - - - ..\..\packages\System.Security.Principal.Windows.4.5.1\lib\net461\System.Security.Principal.Windows.dll - - - ..\..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll - - - ..\..\packages\Prism.Wpf.7.1.0.431\lib\net45\System.Windows.Interactivity.dll - - - - - - - - - 4.0 - - - ..\..\packages\UnitsNet.5.9.0\lib\netstandard2.0\UnitsNet.dll - - - ..\..\packages\Unity.Abstractions.3.3.1\lib\net47\Unity.Abstractions.dll - - - ..\..\packages\Unity.5.8.11\lib\net47\Unity.Configuration.dll - - - ..\..\packages\Unity.Container.5.8.11\lib\net47\Unity.Container.dll - - - ..\..\packages\Unity.5.8.11\lib\net47\Unity.Interception.dll - - - ..\..\packages\Unity.5.8.11\lib\net47\Unity.Interception.Configuration.dll - - - ..\..\packages\Unity.5.8.11\lib\net47\Unity.RegistrationByConvention.dll - - - ..\..\packages\Unity.5.8.11\lib\net47\Unity.ServiceLocation.dll - - - - - - - - MSBuild:Compile - Designer - - - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - MainWindow.xaml - Code - - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - + - + - \ No newline at end of file diff --git a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/packages.config b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/packages.config deleted file mode 100644 index c7e5ee450f..0000000000 --- a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/packages.config +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/UnitConverter.Console/UnitConverter.Console.csproj b/Samples/UnitConverter.Console/UnitConverter.Console.csproj index 21a2269189..3f3de72140 100644 --- a/Samples/UnitConverter.Console/UnitConverter.Console.csproj +++ b/Samples/UnitConverter.Console/UnitConverter.Console.csproj @@ -1,14 +1,14 @@ - - Exe - net7.0 - enable - enable - + + Exe + net8.0 + enable + enable + - - - + + + - + \ No newline at end of file diff --git a/Samples/UnitConverter.Wpf/UnitConverter.Wpf/App.xaml b/Samples/UnitConverter.Wpf/UnitConverter.Wpf/App.xaml index 0601f215a0..86dd63140b 100644 --- a/Samples/UnitConverter.Wpf/UnitConverter.Wpf/App.xaml +++ b/Samples/UnitConverter.Wpf/UnitConverter.Wpf/App.xaml @@ -8,10 +8,8 @@ - - - - + + diff --git a/Samples/UnitConverter.Wpf/UnitConverter.Wpf/IMainWindowVm.cs b/Samples/UnitConverter.Wpf/UnitConverter.Wpf/IMainWindowVm.cs index d727ec84a3..c2ed86fb67 100644 --- a/Samples/UnitConverter.Wpf/UnitConverter.Wpf/IMainWindowVm.cs +++ b/Samples/UnitConverter.Wpf/UnitConverter.Wpf/IMainWindowVm.cs @@ -1,4 +1,4 @@ -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; using System.ComponentModel; using System.Windows.Input; using UnitsNet.Samples.UnitConverter.Wpf.Properties; @@ -23,8 +23,8 @@ public interface IMainWindowVm : INotifyPropertyChanged string FromHeader { get; } string ToHeader { get; } - decimal FromValue { get; set; } - decimal ToValue { get; } + double FromValue { get; set; } + double ToValue { get; } ICommand SwapCommand { get; } } } diff --git a/Samples/UnitConverter.Wpf/UnitConverter.Wpf/MainWindow.xaml b/Samples/UnitConverter.Wpf/UnitConverter.Wpf/MainWindow.xaml index 26fcdf48f5..81d8491452 100644 --- a/Samples/UnitConverter.Wpf/UnitConverter.Wpf/MainWindow.xaml +++ b/Samples/UnitConverter.Wpf/UnitConverter.Wpf/MainWindow.xaml @@ -7,12 +7,15 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:wpf="clr-namespace:UnitsNet.Samples.UnitConverter.Wpf" mc:Ignorable="d" - Title="UnitsNet - WPF unit converter sample app" Height="350" Width="525" + WindowStartupLocation="CenterScreen" + Title="UnitsNet - WPF unit converter sample app" Height="800" Width="800" + d:DesignHeight="600" d:DesignWidth="600" d:DataContext="{d:DesignInstance wpf:MainWindowDesignVm, IsDesignTimeCreatable=True}"> + @@ -29,7 +32,7 @@ SelectionChanged="Selector_OnSelectionChanged" /> - + - + - - - - - - + - -