From 93219aaf9bc30a5f9d0a110cc6e9cff01857cdcf Mon Sep 17 00:00:00 2001 From: BobdaFett Date: Thu, 23 Nov 2023 17:35:40 -0500 Subject: [PATCH] Allowed ErrorWindow to close properly. --- PcgsInvUi.csproj | 224 ------------------- PcgsInvUi.sln | 53 ----- PcgsInvUi/ViewModels/ErrorWindowViewModel.cs | 7 +- PcgsInvUi/ViewModels/MainWindowViewModel.cs | 5 +- PcgsInvUi/Views/ErrorWindow.axaml | 5 +- PcgsInvUi/Views/ErrorWindow.axaml.cs | 5 +- PcgsInvUi/Views/MainWindow.axaml.cs | 10 +- 7 files changed, 16 insertions(+), 293 deletions(-) delete mode 100644 PcgsInvUi.csproj delete mode 100644 PcgsInvUi.sln diff --git a/PcgsInvUi.csproj b/PcgsInvUi.csproj deleted file mode 100644 index 26caed2..0000000 --- a/PcgsInvUi.csproj +++ /dev/null @@ -1,224 +0,0 @@ - - - - x64 - - - {54609B1E-BC06-306E-9607-8EAEF1F4571E} - Win32Proj - 10.0.22621.0 - x64 - PcgsInvUi - v4.7.2 - NoUpgrade - true - Exe - Properties - - - - true - true - C:\Users\lvas4\RiderProjects\pcgs-inv\Debug\ - v143 - PcgsInvUi - Program - C:\Users\lvas4\RiderProjects\pcgs-inv\Debug\PcgsInvUi.exe - full - DEBUG - prompt - latest - false - 3 - - - C:\Users\lvas4\RiderProjects\pcgs-inv\Release\ - v143 - PcgsInvUi - Program - C:\Users\lvas4\RiderProjects\pcgs-inv\Release\PcgsInvUi.exe - none - - queue - latest - true - 1 - - - C:\Users\lvas4\RiderProjects\pcgs-inv\MinSizeRel\ - v143 - PcgsInvUi - Program - C:\Users\lvas4\RiderProjects\pcgs-inv\MinSizeRel\PcgsInvUi.exe - none - - latest - true - - - true - true - C:\Users\lvas4\RiderProjects\pcgs-inv\RelWithDebInfo\ - v143 - PcgsInvUi - Program - C:\Users\lvas4\RiderProjects\pcgs-inv\RelWithDebInfo\PcgsInvUi.exe - full - - latest - false - - - - - - - - - - CMakeLists.txt - - - - - - - - - - - - - - - - - - - - - App.axaml.cs - - - Program.cs - - - ViewLocator.cs - - - App.axaml - - - Models\Coin.cs - - - Services\CoinCollection.cs - - - Services\CoinDatabase.cs - - - Services\PcgsClient.cs - - - ViewModels\CoinListViewModel.cs - - - ViewModels\DeleteWindowViewModel.cs - - - ViewModels\EditViewModel.cs - - - ViewModels\ErrorWindowViewModel.cs - - - ViewModels\FindWindowViewModel.cs - - - ViewModels\MainWindowViewModel.cs - - - ViewModels\NewViewModel.cs - - - ViewModels\ViewModelBase.cs - - - Views\DeleteWindow.axaml - - - Views\DeleteWindow.axaml.cs - - - Views\ErrorWindow.axaml - - - Views\ErrorWindow.axaml.cs - - - Views\FindWindow.axaml - - - Views\FindWindow.axaml.cs - - - Views\MainWindow.axaml - - - Views\MainWindow.axaml.cs - - - Views\NewView.axaml - - - Views\NewView.axaml.cs - - - - - true - true - - - - - {3FD6A666-E15C-386C-9AAE-B352CA747977} - ZERO_CHECK - false - Never - - - - - - - - - - - - - - - - CustomCommand_Debug_2b1af5d328edb17d91180d581ead755d; - CustomCommand_MinSizeRel_2b1af5d328edb17d91180d581ead755d; - CustomCommand_RelWithDebInfo_2b1af5d328edb17d91180d581ead755d; - CustomCommand_Release_2b1af5d328edb17d91180d581ead755d; - $(BuildDependsOn) - - - \ No newline at end of file diff --git a/PcgsInvUi.sln b/PcgsInvUi.sln deleted file mode 100644 index 1428c41..0000000 --- a/PcgsInvUi.sln +++ /dev/null @@ -1,53 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{1318C6B3-3038-3793-8B5B-FFAF1B645D42}" - ProjectSection(ProjectDependencies) = postProject - {54609B1E-BC06-306E-9607-8EAEF1F4571E} = {54609B1E-BC06-306E-9607-8EAEF1F4571E} - {3FD6A666-E15C-386C-9AAE-B352CA747977} = {3FD6A666-E15C-386C-9AAE-B352CA747977} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PcgsInvUi", "PcgsInvUi.csproj", "{54609B1E-BC06-306E-9607-8EAEF1F4571E}" - ProjectSection(ProjectDependencies) = postProject - {3FD6A666-E15C-386C-9AAE-B352CA747977} = {3FD6A666-E15C-386C-9AAE-B352CA747977} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{3FD6A666-E15C-386C-9AAE-B352CA747977}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - MinSizeRel|x64 = MinSizeRel|x64 - RelWithDebInfo|x64 = RelWithDebInfo|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1318C6B3-3038-3793-8B5B-FFAF1B645D42}.Debug|x64.ActiveCfg = Debug|x64 - {1318C6B3-3038-3793-8B5B-FFAF1B645D42}.Release|x64.ActiveCfg = Release|x64 - {1318C6B3-3038-3793-8B5B-FFAF1B645D42}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 - {1318C6B3-3038-3793-8B5B-FFAF1B645D42}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {54609B1E-BC06-306E-9607-8EAEF1F4571E}.Debug|x64.ActiveCfg = Debug|x64 - {54609B1E-BC06-306E-9607-8EAEF1F4571E}.Debug|x64.Build.0 = Debug|x64 - {54609B1E-BC06-306E-9607-8EAEF1F4571E}.Release|x64.ActiveCfg = Release|x64 - {54609B1E-BC06-306E-9607-8EAEF1F4571E}.Release|x64.Build.0 = Release|x64 - {54609B1E-BC06-306E-9607-8EAEF1F4571E}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 - {54609B1E-BC06-306E-9607-8EAEF1F4571E}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 - {54609B1E-BC06-306E-9607-8EAEF1F4571E}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {54609B1E-BC06-306E-9607-8EAEF1F4571E}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {3FD6A666-E15C-386C-9AAE-B352CA747977}.Debug|x64.ActiveCfg = Debug|x64 - {3FD6A666-E15C-386C-9AAE-B352CA747977}.Debug|x64.Build.0 = Debug|x64 - {3FD6A666-E15C-386C-9AAE-B352CA747977}.Release|x64.ActiveCfg = Release|x64 - {3FD6A666-E15C-386C-9AAE-B352CA747977}.Release|x64.Build.0 = Release|x64 - {3FD6A666-E15C-386C-9AAE-B352CA747977}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64 - {3FD6A666-E15C-386C-9AAE-B352CA747977}.MinSizeRel|x64.Build.0 = MinSizeRel|x64 - {3FD6A666-E15C-386C-9AAE-B352CA747977}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {3FD6A666-E15C-386C-9AAE-B352CA747977}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {59E64599-55C1-370C-BB8B-8DCA690BC7F5} - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PcgsInvUi/ViewModels/ErrorWindowViewModel.cs b/PcgsInvUi/ViewModels/ErrorWindowViewModel.cs index ab7d0d8..68ed391 100644 --- a/PcgsInvUi/ViewModels/ErrorWindowViewModel.cs +++ b/PcgsInvUi/ViewModels/ErrorWindowViewModel.cs @@ -1,6 +1,4 @@ using System.Reactive; -using System.Security.Principal; -using PcgsInvUi.Views; using ReactiveUI; namespace PcgsInvUi.ViewModels; @@ -11,16 +9,15 @@ public class ErrorWindowViewModel : ViewModelBase { get => _message; set => this.RaiseAndSetIfChanged(ref _message, value); } - private string _message; - public ReactiveCommand CloseCommand { get; } + public ReactiveCommand CloseCommand { get; } public ErrorWindowViewModel(string message) { _message = message; - CloseCommand = ReactiveCommand.Create(window => window.Close()); + CloseCommand = ReactiveCommand.Create(() => (object)false); } } diff --git a/PcgsInvUi/ViewModels/MainWindowViewModel.cs b/PcgsInvUi/ViewModels/MainWindowViewModel.cs index b6f70f4..7de848e 100644 --- a/PcgsInvUi/ViewModels/MainWindowViewModel.cs +++ b/PcgsInvUi/ViewModels/MainWindowViewModel.cs @@ -42,7 +42,7 @@ public class MainWindowViewModel : ViewModelBase { public Interaction ShowDeleteWindow { get; } public ReactiveCommand ExportCommand { get; } public Interaction ShowExportWindow { get; } - public Interaction ShowErrorWindow { get; } + public Interaction ShowErrorWindow { get; } private ViewModelBase _sideContent; private Coin? _selectedCoin; @@ -57,7 +57,7 @@ public class MainWindowViewModel : ViewModelBase { TotalValue = DisplayedList.Sum(x => x.TotalPrice); // Set up the ability to show the error window. - ShowErrorWindow = new Interaction(); + ShowErrorWindow = new Interaction(); // Set up the ability to open the delete window. ShowDeleteWindow = new Interaction(); @@ -117,6 +117,7 @@ public class MainWindowViewModel : ViewModelBase { }); // Change TotalValue anytime SelectedCoin.TotalPrice changes. + // TODO: fix this. Should update when a coin within the collection is changed. // Possible null deref - how do you remove this? this.WhenAnyValue(x => x.SelectedCoin.TotalPrice) .Subscribe(_ => TotalValue = ConnectedCoinDatabase.Collection.Sum(x => x.TotalPrice)); diff --git a/PcgsInvUi/Views/ErrorWindow.axaml b/PcgsInvUi/Views/ErrorWindow.axaml index 5067840..d238b59 100644 --- a/PcgsInvUi/Views/ErrorWindow.axaml +++ b/PcgsInvUi/Views/ErrorWindow.axaml @@ -12,8 +12,7 @@ Margin="15" Content="{Binding DisplayedMessage}" />