Initial Commit
This commit is contained in:
49
View/Dialogs/AddTransactionView.xaml
Normal file
49
View/Dialogs/AddTransactionView.xaml
Normal file
@@ -0,0 +1,49 @@
|
||||
<Window x:Class="DebtMgr.View.Dialogs.AddTransactionView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:c="clr-namespace:CurrencyTextBoxControl;assembly=CurrencyTextBoxControl"
|
||||
mc:Ignorable="d"
|
||||
Icon="../../Content/moneybag.ico"
|
||||
Name="AddTransactionViewWindow"
|
||||
Title="{Binding WindowTitle}" Height="300" Width="300"
|
||||
KeyUp="Window_OnKeyUp">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Orientation="Vertical">
|
||||
<Label Content="{Binding ElementName=AddTransactionViewWindow, Path=Title}" FontWeight="Bold" FontSize="18"></Label>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="10 0">
|
||||
<c:CurrencyTextBox KeyUp="TextBox_OnKeyUp" Name="Amount" Number="{Binding AmountTextBoxText}" StringFormat="0.00 Eur" FontSize="16" Margin="0 0 0 -5"></c:CurrencyTextBox>
|
||||
<Label Content="Amount in EUR"></Label>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="2" Orientation="Vertical" Margin="10 0">
|
||||
<TextBox KeyUp="TextBox_OnKeyUp" Name="Description" Text="{Binding DescriptionTextBoxText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 -5"></TextBox>
|
||||
<Label Content="Description"></Label>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="3" Orientation="Vertical" Margin="10 0">
|
||||
<DatePicker KeyUp="TextBox_OnKeyUp" SelectedDate="{Binding DatePickerSelectedDate}"></DatePicker>
|
||||
<Label Content="Date"></Label>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="4" Orientation="Vertical" Margin="10 0">
|
||||
<ComboBox KeyUp="TextBox_OnKeyUp" Name="PersonComboBox" ItemsSource="{Binding PersonComboBoxItemSource}" SelectedItem="{Binding PersonComboBoxSelectedItem}">
|
||||
</ComboBox>
|
||||
<Label Content="Person"></Label>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="1" Content="Add Deposit" FontSize="14" Padding="5" Margin="10 -10" Command="{Binding AddTransactionButtonClickCommand}"></Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
58
View/Dialogs/AddTransactionView.xaml.cs
Normal file
58
View/Dialogs/AddTransactionView.xaml.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using DebtMgr.Extensions;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using DebtMgr.Model;
|
||||
|
||||
namespace DebtMgr.View.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für AddTransactionView.xaml
|
||||
/// </summary>
|
||||
public partial class AddTransactionView : Window
|
||||
{
|
||||
public AddTransactionView(TransactionType transactionType, Person preselectedPerson)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.CenterOnParent();
|
||||
|
||||
App.Locator.AddTransactionView.ClearView();
|
||||
|
||||
App.Locator.AddTransactionView.DialogMode = transactionType;
|
||||
App.Locator.AddTransactionView.PreselectedPerson = preselectedPerson;
|
||||
App.Locator.AddTransactionView.SetModeSpecificStrings();
|
||||
|
||||
App.Locator.AddTransactionView.RequestClose += (s, e) => Close();
|
||||
|
||||
DataContext = App.Locator.AddTransactionView;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// <summary> Event handler. Called by TextBox for on key up events. </summary>
|
||||
///
|
||||
/// <remarks> Andre Beging, 09.09.2017. </remarks>
|
||||
///
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Key event information. </param>
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
private void TextBox_OnKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key.Equals(Key.Enter) || e.Key.Equals(Key.Return))
|
||||
App.Locator.AddTransactionView.AddTransactionButtonClickCommand.Execute(null);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// <summary> Event handler. Called by Window for on key up events. </summary>
|
||||
///
|
||||
/// <remarks> Andre Beging, 09.09.2017. </remarks>
|
||||
///
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Key event information. </param>
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
private void Window_OnKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key.Equals(Key.Escape))
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
30
View/Dialogs/DatabaseSelectorDialogView.xaml
Normal file
30
View/Dialogs/DatabaseSelectorDialogView.xaml
Normal file
@@ -0,0 +1,30 @@
|
||||
<Window x:Class="DebtMgr.View.Dialogs.DatabaseSelectorDialogView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Title="Debt Manager - Select Database" Height="250" Width="400"
|
||||
KeyUp="Window_OnKeyUp">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="1*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="Select existing Database" FontWeight="Bold" FontSize="18" Margin="0 20 0 0"></Label>
|
||||
<TextBox Grid.Row="1" Grid.Column="0" FontSize="14" Margin="5 5 0 5" IsEnabled="False" Text="{Binding SelectDatabasePathText}"></TextBox>
|
||||
<Button Grid.Row="1" Grid.Column="1" FontSize="14" Content="Browse" Margin="5" Command="{Binding SelectDatabaseButtonClick}"></Button>
|
||||
<Separator Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 20"></Separator>
|
||||
<Label Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Content="Create new Database" FontWeight="Bold" FontSize="18"></Label>
|
||||
<TextBox Grid.Row="4" Grid.Column="0" FontSize="14" Margin="5 5 0 5" IsEnabled="False"></TextBox>
|
||||
<Button Grid.Row="4" Grid.Column="1" FontSize="14" Content="Create" Margin="5" Command="{Binding CreateDatabaseButtonClick}"></Button>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
40
View/Dialogs/DatabaseSelectorDialogView.xaml.cs
Normal file
40
View/Dialogs/DatabaseSelectorDialogView.xaml.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
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.Shapes;
|
||||
using DebtMgr.Extensions;
|
||||
|
||||
namespace DebtMgr.View.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für DatabaseSelectorDialogView.xaml
|
||||
/// </summary>
|
||||
public partial class DatabaseSelectorDialogView : Window
|
||||
{
|
||||
public DatabaseSelectorDialogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.CenterOnParent();
|
||||
|
||||
App.Locator.DatabaseSelectorDialogView.RequestClose += (s, e) => Close();
|
||||
DataContext = App.Locator.DatabaseSelectorDialogView;
|
||||
}
|
||||
|
||||
private void Window_OnKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key.Equals(Key.Escape))
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
View/Dialogs/NewPersonDialogView.xaml
Normal file
36
View/Dialogs/NewPersonDialogView.xaml
Normal file
@@ -0,0 +1,36 @@
|
||||
<Window x:Class="DebtMgr.View.Dialogs.NewPersonDialogView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:DebtMgr.View.Dialogs"
|
||||
mc:Ignorable="d"
|
||||
Name="NewPersonDialogViewWindow"
|
||||
Icon="../../Content/addperson.ico"
|
||||
Title="New Person" Height="205" Width="300"
|
||||
KeyUp="Window_KeyUp">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Grid.Row="0" Content="New Person" FontWeight="Bold" FontSize="18"></Label>
|
||||
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="10 0">
|
||||
<TextBox KeyUp="TextBox_OnKeyUp" Name="FirstNameTextBox" Text="{Binding FirstNameTextBoxText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 -5"></TextBox>
|
||||
<Label Content="First name"></Label>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="2" Orientation="Vertical" Margin="10 5">
|
||||
<TextBox KeyUp="TextBox_OnKeyUp" Text="{Binding LastNameTextBoxText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 -5"></TextBox>
|
||||
<Label Content="Last name"></Label>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="1" Content="Create Person" FontSize="14" Padding="5" Margin="10 -10" Command="{Binding CreatePersonButtonClickCommand}"></Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
51
View/Dialogs/NewPersonDialogView.xaml.cs
Normal file
51
View/Dialogs/NewPersonDialogView.xaml.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using DebtMgr.Extensions;
|
||||
|
||||
namespace DebtMgr.View.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für NewPersonDialogView.xaml
|
||||
/// </summary>
|
||||
public partial class NewPersonDialogView : Window
|
||||
{
|
||||
public NewPersonDialogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.CenterOnParent();
|
||||
|
||||
App.Locator.NewPersonDialogView.RequestClose += (s, e) => Close();
|
||||
DataContext = App.Locator.NewPersonDialogView;
|
||||
|
||||
FirstNameTextBox.Focus();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// <summary> Event handler. Called by TextBox for on key up events. </summary>
|
||||
///
|
||||
/// <remarks> Andre Beging, 09.09.2017. </remarks>
|
||||
///
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Key event information. </param>
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
private void TextBox_OnKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key.Equals(Key.Enter) || e.Key.Equals(Key.Return))
|
||||
App.Locator.NewPersonDialogView.CreatePersonButtonClickCommand.Execute(null);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// <summary> Event handler. Called by Window for key up events. </summary>
|
||||
///
|
||||
/// <remarks> Andre Beging, 09.09.2017. </remarks>
|
||||
///
|
||||
/// <param name="sender"> Source of the event. </param>
|
||||
/// <param name="e"> Key event information. </param>
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
private void Window_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key.Equals(Key.Escape))
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user