Slapped bandaids on things for a fast release test.
This commit is contained in:
1 parent
4fcae0b3c7
commit
9c6ea08221
7 files changed
+35
-26
No files matched your search
@@ -23,7 +23,7 @@
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.5" />
|
||||
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.5" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3"/>
|
||||
<PackageReference Include="System.Data.SQLite" Version="1.0.118"/>
|
||||
<PackageReference Include="System.Data.SQLite" Version="1.0.118" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
using System;
|
||||
using System.Reactive;
|
||||
using ReactiveUI;
|
||||
using System.Security.Principal;
|
||||
using PcgsInvUi.Views;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace PcgsInvUi.ViewModels;
|
||||
|
||||
public class ErrorWindowViewModel : ViewModelBase {
|
||||
|
||||
public Exception DisplayedException {
|
||||
public string DisplayedMessage {
|
||||
get => _message;
|
||||
set => this.RaiseAndSetIfChanged(ref _message, value);
|
||||
}
|
||||
|
||||
private Exception _message;
|
||||
private string _message;
|
||||
|
||||
public ReactiveCommand<ErrorWindow, Unit> CloseCommand { get; }
|
||||
|
||||
public ErrorWindowViewModel(string message) {
|
||||
CloseCommand = ReactiveCommand.Create<ErrorWindow>(window => { window.Close(); });
|
||||
public ErrorWindowViewModel(string message)
|
||||
{
|
||||
DisplayedMessage = message;
|
||||
|
||||
CloseCommand = ReactiveCommand.Create<ErrorWindow>(window => window.Close());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
<Button Grid.Row="1" Grid.Column="1" Margin="5"
|
||||
Width="100"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Content="No" Command="{Binding CancelCommand}" />
|
||||
HorizontalContentAlignment="Center" IsEnabled="False"
|
||||
Content="Use X button" Command="{Binding CancelCommand}" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -3,11 +3,17 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewModels="clr-namespace:PcgsInvUi.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="150"
|
||||
x:Class="PcgsInvUi.Views.ErrorWindow" x:DataType="viewModels:ErrorWindowViewModel"
|
||||
Title="ErrorWindow">
|
||||
<Grid RowDefinitions="2">
|
||||
<TextBlock Text="{Binding DisplayedException.Message}" />
|
||||
<Button Content="OK" Command="{Binding CloseCommand}" />
|
||||
Title="Error!" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterOwner"
|
||||
x:Name="NameErrorWindow" CanResize="False" >
|
||||
<Grid RowDefinitions="*,*">
|
||||
<Label Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Stretch"
|
||||
Margin="15"
|
||||
Content="{Binding DisplayedMessage}" />
|
||||
<Button Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom"
|
||||
Margin="10" Name="CloseButton" IsEnabled="False"
|
||||
Content="Use X button" Command="{Binding CloseCommand, Mode=OneWay}"
|
||||
CommandParameter="{Binding ElementName=NameErrorWindow}"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,11 +1,11 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.ReactiveUI;
|
||||
using PcgsInvUi.ViewModels;
|
||||
|
||||
namespace PcgsInvUi.Views;
|
||||
|
||||
public partial class ErrorWindow : Window {
|
||||
public ErrorWindow() {
|
||||
public partial class ErrorWindow : ReactiveWindow<ErrorWindowViewModel> {
|
||||
public ErrorWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Est. Price" Width="*"
|
||||
Binding="{Binding PriceGuideValue}"
|
||||
IsReadOnly="False" />
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="PCGS #" Width="*"
|
||||
Binding="{Binding PCGSNo}"
|
||||
IsReadOnly="True" />
|
||||
|
||||
@@ -18,7 +18,7 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
|
||||
// this.WhenActivated(d => d(ViewModel!.ShowFindWindow.RegisterHandler(ShowFindWindowAsync)));
|
||||
}
|
||||
|
||||
public async Task ShowDeleteWindowAsync(InteractionContext<DeleteWindowViewModel, Boolean> interaction) {
|
||||
private async Task ShowDeleteWindowAsync(InteractionContext<DeleteWindowViewModel, Boolean> interaction) {
|
||||
var window = new DeleteWindow();
|
||||
window.DataContext = interaction.Input;
|
||||
|
||||
@@ -26,7 +26,7 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
|
||||
interaction.SetOutput(result);
|
||||
}
|
||||
|
||||
public async Task ShowFindWindowAsync(InteractionContext<FindWindowViewModel, int> interaction) {
|
||||
private async Task ShowFindWindowAsync(InteractionContext<FindWindowViewModel, int> interaction) {
|
||||
var window = new FindWindow();
|
||||
window.DataContext = interaction.Input;
|
||||
|
||||
@@ -34,7 +34,7 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
|
||||
interaction.SetOutput(result);
|
||||
}
|
||||
|
||||
public async Task ShowFilePickerAsync(InteractionContext<Unit, Uri> interationContext) {
|
||||
private async Task ShowFilePickerAsync(InteractionContext<Unit, Uri> interationContext) {
|
||||
var topLevel = GetTopLevel(this);
|
||||
var file = await topLevel.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions {
|
||||
Title = "Save CSV...",
|
||||
@@ -44,8 +44,6 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
|
||||
SuggestedStartLocation = await StorageProvider.TryGetWellKnownFolderAsync(WellKnownFolder.Documents)
|
||||
});
|
||||
|
||||
Stream stream;
|
||||
|
||||
if (file is not null) {
|
||||
interationContext.SetOutput(file.Path);
|
||||
}
|
||||
@@ -55,10 +53,11 @@ public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ShowErrorWindowAsync(InteractionContext<ErrorWindowViewModel, Unit> interaction) {
|
||||
private async Task ShowErrorWindowAsync(InteractionContext<ErrorWindowViewModel, Unit> interaction) {
|
||||
var window = new ErrorWindow();
|
||||
window.DataContext = interaction.Input;
|
||||
|
||||
await window.ShowDialog(this);
|
||||
interaction.SetOutput(Unit.Default);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user