diff --git a/Samples/Directory.Packages.props b/Samples/Directory.Packages.props new file mode 100644 index 0000000000..3f24827b01 --- /dev/null +++ b/Samples/Directory.Packages.props @@ -0,0 +1,13 @@ + + + true + + + + + + + + + + \ No newline at end of file diff --git a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/App.xaml.cs b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/App.xaml.cs index 41c001cc97..9b9bf71e09 100644 --- a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/App.xaml.cs +++ b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/App.xaml.cs @@ -16,7 +16,7 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry) protected override Window CreateShell() { - return new MainWindow(); + return Container.Resolve(); } } } diff --git a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/Converters/UnitToStringConverter.cs b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/Converters/UnitToStringConverter.cs index 04dcdb901e..f7f2806f73 100644 --- a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/Converters/UnitToStringConverter.cs +++ b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/Converters/UnitToStringConverter.cs @@ -6,7 +6,7 @@ using System.Windows.Controls; using System.Windows.Data; using System.Windows.Markup; -using CommonServiceLocator; +using Prism.Ioc; using UnitsNet; using WpfMVVMSample.Settings; @@ -22,7 +22,7 @@ public UnitToStringConverter() { if (!DesignerProperties.GetIsInDesignMode(new DependencyObject())) { - _settings = ServiceLocator.Current.GetInstance(); + _settings = Prism.Ioc.ContainerLocator.Container.Resolve(); } } diff --git a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MainWindow.xaml.cs b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MainWindow.xaml.cs index e0d2d6299d..2245d7f9cf 100644 --- a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MainWindow.xaml.cs +++ b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MainWindow.xaml.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +using System.Windows; namespace WpfMVVMSample { diff --git a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MainWindowViewModel.cs b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MainWindowViewModel.cs index bb9a26aafd..0019962e88 100644 --- a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MainWindowViewModel.cs +++ b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MainWindowViewModel.cs @@ -1,14 +1,5 @@ -using Prism.Commands; -using Prism.Mvvm; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Prism.Mvvm; using UnitsNet; -using UnitsNet.Units; -using WpfMVVMSample.Converters; -using WpfMVVMSample.Properties; using WpfMVVMSample.Settings; namespace WpfMVVMSample diff --git a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MvvmSample.Wpf.csproj b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MvvmSample.Wpf.csproj index 05e93234d6..cb757e1ceb 100644 --- a/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MvvmSample.Wpf.csproj +++ b/Samples/MvvmSample.Wpf/MvvmSample.Wpf/MvvmSample.Wpf.csproj @@ -1,163 +1,25 @@ - - - + - 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/Samples.sln b/Samples/Samples.sln index 2101631750..84ba089fe6 100644 --- a/Samples/Samples.sln +++ b/Samples/Samples.sln @@ -9,6 +9,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvvmSample.Wpf", "MvvmSampl EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitConverter.Console", "UnitConverter.Console\UnitConverter.Console.csproj", "{B3141011-CEF2-46DE-B3DD-7FECD0D6108C}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Files", "_Files", "{D3B39B9C-CE85-4929-A268-1AEBD945127C}" + ProjectSection(SolutionItems) = preProject + build.bat = build.bat + Directory.Packages.props = Directory.Packages.props + msbuild.cmd = msbuild.cmd + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU 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" /> - + - + - - - - - - + - -