Reformatted and cleaned up code across whole project.
This commit is contained in:
1 parent
42a7871ed4
commit
99cb9268dd
25 files changed
+272
-319
No files matched your search
@@ -7,18 +7,18 @@
|
||||
Width="325" Height="100" WindowStartupLocation="CenterOwner"
|
||||
Title="DeleteWindow">
|
||||
<Grid ColumnDefinitions="*, *" RowDefinitions="*, *">
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="10"
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="10"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Content="Are you sure you want to delete this item?"/>
|
||||
<Button Grid.Row="1" Grid.Column="0" Margin="5"
|
||||
Content="Are you sure you want to delete this item?" />
|
||||
<Button Grid.Row="1" Grid.Column="0" Margin="5"
|
||||
Width="100"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Content="Yes" Command="{Binding OkCommand}"/>
|
||||
Content="Yes" Command="{Binding OkCommand}" />
|
||||
<Button Grid.Row="1" Grid.Column="1" Margin="5"
|
||||
Width="100"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Content="No" Command="{Binding CancelCommand}"/>
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="Center"
|
||||
Content="No" Command="{Binding CancelCommand}" />
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -5,10 +5,8 @@ using System;
|
||||
|
||||
namespace PcgsInvUi.Views;
|
||||
|
||||
public partial class DeleteWindow : ReactiveWindow<DeleteWindowViewModel>
|
||||
{
|
||||
public DeleteWindow()
|
||||
{
|
||||
public partial class DeleteWindow : ReactiveWindow<DeleteWindowViewModel> {
|
||||
public DeleteWindow() {
|
||||
InitializeComponent();
|
||||
this.WhenActivated(d => d(ViewModel!.OkCommand.Subscribe(Close)));
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
x:Class="PcgsInvUi.Views.FindWindow"
|
||||
Title="FindWindow">
|
||||
<Grid ColumnDefinitions="Auto, *" RowDefinitions="*, *">
|
||||
<Label Content="PCGS #:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5"/>
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="5"/>
|
||||
<Label Content="PCGS #:" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5" />
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="5" />
|
||||
<Button Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Content="Find"
|
||||
HorizontalAlignment="Center" Margin="5" Width="75"/>
|
||||
HorizontalAlignment="Center" Margin="5" Width="75" />
|
||||
</Grid>
|
||||
</Window>
|
||||
</Window>
|
||||
@@ -5,10 +5,8 @@ using System;
|
||||
|
||||
namespace PcgsInvUi.Views;
|
||||
|
||||
public partial class FindWindow : ReactiveWindow<FindWindowViewModel>
|
||||
{
|
||||
public FindWindow()
|
||||
{
|
||||
public partial class FindWindow : ReactiveWindow<FindWindowViewModel> {
|
||||
public FindWindow() {
|
||||
InitializeComponent();
|
||||
this.WhenActivated(d => d(ViewModel!.OkCommand.Subscribe(Close)));
|
||||
}
|
||||
|
||||
@@ -9,11 +9,12 @@
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<SplitView IsPaneOpen="True"
|
||||
DisplayMode="Inline"
|
||||
PanePlacement="Right" >
|
||||
PanePlacement="Right">
|
||||
<SplitView.Pane>
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<UserControl Grid.Row="0" Margin="10, 20, 10, 10" VerticalAlignment="Center" Content="{Binding SidebarContent}"/>
|
||||
<TextBox Grid.Row="1" Margin="5" Watermark="Notes..."/>
|
||||
<UserControl Grid.Row="0" Margin="10, 20, 10, 10" VerticalAlignment="Center"
|
||||
Content="{Binding SidebarContent}" />
|
||||
<TextBox Grid.Row="1" Margin="5" Watermark="Notes..." />
|
||||
</Grid>
|
||||
</SplitView.Pane>
|
||||
<Grid RowDefinitions="*, Auto" ShowGridLines="False">
|
||||
@@ -26,51 +27,56 @@
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Series" Width="*"
|
||||
Binding="{Binding SeriesName}"
|
||||
IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="Year"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Year"
|
||||
Binding="{Binding Year}"
|
||||
IsReadOnly="True"/>
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Mint" Width="*"
|
||||
Binding="{Binding MintMark}"
|
||||
IsReadOnly="True"/>
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Denomination" Width="*"
|
||||
Binding="{Binding Denomination}"
|
||||
IsReadOnly="True"/>
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Variety" Width="*"
|
||||
Binding="{Binding MajorVariety}"
|
||||
IsReadOnly="True"/>
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Grade" Width="*"
|
||||
Binding="{Binding Grade}"
|
||||
IsReadOnly="True"/>
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Designation" Width="*"
|
||||
Binding="{Binding Designation}"
|
||||
IsReadOnly="True"/>
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Est. Price" Width="*"
|
||||
Binding="{Binding PriceGuideValue}"
|
||||
IsReadOnly="False"/>
|
||||
Binding="{Binding PriceGuideValue}"
|
||||
IsReadOnly="False" />
|
||||
<DataGridTextColumn Header="PCGS #" Width="*"
|
||||
Binding="{Binding PCGSNo}"
|
||||
IsReadOnly="True"/>
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn Header="Quantity" Width="*"
|
||||
Binding="{Binding Quantity}"
|
||||
IsReadOnly="False"/>
|
||||
Binding="{Binding Quantity}"
|
||||
IsReadOnly="False" />
|
||||
<DataGridTextColumn Header="Total Price" Width="*"
|
||||
Binding="{Binding TotalPrice, StringFormat='${0:0.00}'}"
|
||||
IsReadOnly="True" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<DockPanel Grid.Row="1">
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" ColumnDefinitions="Auto, Auto" DockPanel.Dock="Left">
|
||||
<Button Grid.Column="0" Margin="5" Width="100" HorizontalContentAlignment="Center" Content="Delete"
|
||||
Command="{Binding DeleteCommand}"/>
|
||||
<Button Grid.Column="1" Margin="5" Width="100" HorizontalContentAlignment="Center" Content="Find..."
|
||||
Command="{Binding FindCommand}"/>
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="5" ColumnDefinitions="Auto, Auto"
|
||||
DockPanel.Dock="Left">
|
||||
<Button Grid.Column="0" Margin="5" Width="100" HorizontalContentAlignment="Center" Content="Delete"
|
||||
Command="{Binding DeleteCommand}" />
|
||||
<Button Grid.Column="1" Margin="5" Width="100" HorizontalContentAlignment="Center"
|
||||
Content="Find..."
|
||||
Command="{Binding FindCommand}" />
|
||||
</Grid>
|
||||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5" ColumnDefinitions="Auto, Auto" DockPanel.Dock="Right">
|
||||
<Label Grid.Column="0" Margin="5" VerticalAlignment="Center" Content="{Binding TotalValue, StringFormat='Total Value: ${0:0.00}'}" />
|
||||
<Button Grid.Column="1" Margin="5" Width="150" HorizontalContentAlignment="Center" Content="Export to CSV..." />
|
||||
<Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5" ColumnDefinitions="Auto, Auto"
|
||||
DockPanel.Dock="Right">
|
||||
<Label Grid.Column="0" Margin="5" VerticalAlignment="Center"
|
||||
Content="{Binding TotalValue, StringFormat='Total Value: ${0:0.00}'}" />
|
||||
<Button Grid.Column="1" Margin="5" Width="150" HorizontalContentAlignment="Center"
|
||||
Content="Export to CSV..." />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</SplitView>
|
||||
</Window>
|
||||
</Window>
|
||||
@@ -6,26 +6,22 @@ using ReactiveUI;
|
||||
|
||||
namespace PcgsInvUi.Views;
|
||||
|
||||
public partial class MainWindow : ReactiveWindow<MainWindowViewModel>
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
public partial class MainWindow : ReactiveWindow<MainWindowViewModel> {
|
||||
public MainWindow() {
|
||||
InitializeComponent();
|
||||
this.WhenActivated(d => d(ViewModel!.ShowDeleteWindow.RegisterHandler(ShowDeleteWindowAsync)));
|
||||
this.WhenActivated(d => d(ViewModel!.ShowFindWindow.RegisterHandler(ShowFindWindowAsync)));
|
||||
}
|
||||
|
||||
public async Task ShowDeleteWindowAsync(InteractionContext<DeleteWindowViewModel, Boolean> interaction)
|
||||
{
|
||||
public async Task ShowDeleteWindowAsync(InteractionContext<DeleteWindowViewModel, Boolean> interaction) {
|
||||
var window = new DeleteWindow();
|
||||
window.DataContext = interaction.Input;
|
||||
|
||||
var result = await window.ShowDialog<bool>(this);
|
||||
interaction.SetOutput(result);
|
||||
}
|
||||
|
||||
public async Task ShowFindWindowAsync(InteractionContext<FindWindowViewModel, int> interaction)
|
||||
{
|
||||
|
||||
public async Task ShowFindWindowAsync(InteractionContext<FindWindowViewModel, int> interaction) {
|
||||
var window = new FindWindow();
|
||||
window.DataContext = interaction.Input;
|
||||
|
||||
|
||||
@@ -7,19 +7,20 @@
|
||||
x:Class="PcgsInvUi.Views.NewView" x:DataType="viewmodels:NewViewModel">
|
||||
<DockPanel>
|
||||
<Grid DockPanel.Dock="Top" ColumnDefinitions="Auto, *" RowDefinitions="*, *, *">
|
||||
<Label Grid.Column="0" Grid.Row="0" Margin="5, 5, 20, 5" VerticalAlignment="Center" Content="PCGS #:"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Margin="5, 5, 10, 5" Text="{Binding PcgsNumber}"/>
|
||||
<Label Grid.Column="0" Grid.Row="1" Margin="5, 5, 20, 5" VerticalAlignment="Center" Content="Grade:"/>
|
||||
<ComboBox Name="GradeChoices" Grid.Column="1" Grid.Row="1" SelectedIndex="0" Margin="5, 5, 10, 5" Width="150"
|
||||
ItemsSource="{Binding GradesList}" SelectedItem="{Binding Grade}"/>
|
||||
<Label Grid.Column="0" Grid.Row="2" Margin="5, 5, 20, 5" VerticalAlignment="Center" Content="Quantity:"/>
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Margin="5, 5, 10, 5" Text="{Binding Quantity}"/>
|
||||
<Label Grid.Column="0" Grid.Row="0" Margin="5, 5, 20, 5" VerticalAlignment="Center" Content="PCGS #:" />
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Margin="5, 5, 10, 5" Text="{Binding PcgsNumber}" />
|
||||
<Label Grid.Column="0" Grid.Row="1" Margin="5, 5, 20, 5" VerticalAlignment="Center" Content="Grade:" />
|
||||
<ComboBox Name="GradeChoices" Grid.Column="1" Grid.Row="1" SelectedIndex="0" Margin="5, 5, 10, 5"
|
||||
Width="150"
|
||||
ItemsSource="{Binding GradesList}" SelectedItem="{Binding Grade}" />
|
||||
<Label Grid.Column="0" Grid.Row="2" Margin="5, 5, 20, 5" VerticalAlignment="Center" Content="Quantity:" />
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Margin="5, 5, 10, 5" Text="{Binding Quantity}" />
|
||||
</Grid>
|
||||
<Grid DockPanel.Dock="Bottom" ColumnDefinitions="*, *">
|
||||
<Button Grid.Column="0" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Width="90" HorizontalContentAlignment="Center" Content="OK" Command="{Binding OkCommand}"/>
|
||||
<Button Grid.Column="1" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
<Button Grid.Column="0" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Width="90" HorizontalContentAlignment="Center" Content="OK" Command="{Binding OkCommand}" />
|
||||
<Button Grid.Column="1" Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
Width="90" HorizontalContentAlignment="Center" Content="Clear" Command="{Binding ClearCommand}" />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -4,10 +4,8 @@ using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace PcgsInvUi.Views;
|
||||
|
||||
public partial class NewView : UserControl
|
||||
{
|
||||
public NewView()
|
||||
{
|
||||
public partial class NewView : UserControl {
|
||||
public NewView() {
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user