From a5f3b02363e4cd8c64c798c6a04bc6b73e9286ef Mon Sep 17 00:00:00 2001 From: arkein Date: Mon, 9 May 2016 01:57:50 +0300 Subject: [PATCH] moved enums into separate folder --- .../Controls/TransactionTemplateControl.xaml | 3 ++- .../Controls/TransactionsListingControl.xaml | 3 ++- Hearthstone Treasury/Enums/CategoryEnum.cs | 15 +++++++++++++++ Hearthstone Treasury/Hearthstone Treasury.csproj | 1 + Hearthstone Treasury/HearthstoneTreasuryPlugin.cs | 2 ++ .../ViewModels/NewTransactionViewModel.cs | 3 ++- .../ViewModels/TransactionListViewModel.cs | 9 +++++++-- .../ViewModels/TransactionViewModel.cs | 12 +----------- 8 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 Hearthstone Treasury/Enums/CategoryEnum.cs diff --git a/Hearthstone Treasury/Controls/TransactionTemplateControl.xaml b/Hearthstone Treasury/Controls/TransactionTemplateControl.xaml index d60a69a..76d9206 100644 --- a/Hearthstone Treasury/Controls/TransactionTemplateControl.xaml +++ b/Hearthstone Treasury/Controls/TransactionTemplateControl.xaml @@ -6,12 +6,13 @@ xmlns:local="clr-namespace:Hearthstone_Treasury.Controls" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:Models="clr-namespace:Hearthstone_Treasury.ViewModels" + xmlns:Enums="clr-namespace:Hearthstone_Treasury.Enums" xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls" mc:Ignorable="d"> - + diff --git a/Hearthstone Treasury/Controls/TransactionsListingControl.xaml b/Hearthstone Treasury/Controls/TransactionsListingControl.xaml index 6e92d7a..0db5e52 100644 --- a/Hearthstone Treasury/Controls/TransactionsListingControl.xaml +++ b/Hearthstone Treasury/Controls/TransactionsListingControl.xaml @@ -6,13 +6,14 @@ xmlns:local="clr-namespace:Hearthstone_Treasury.Controls" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:Models="clr-namespace:Hearthstone_Treasury.ViewModels" + xmlns:Enums="clr-namespace:Hearthstone_Treasury.Enums" xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> - + diff --git a/Hearthstone Treasury/Enums/CategoryEnum.cs b/Hearthstone Treasury/Enums/CategoryEnum.cs new file mode 100644 index 0000000..4e670aa --- /dev/null +++ b/Hearthstone Treasury/Enums/CategoryEnum.cs @@ -0,0 +1,15 @@ +using System; + +namespace Hearthstone_Treasury.Enums +{ + [Serializable] + public enum CategoryEnum + { + Pack, + Arena, + AdventureWing, + Daily, + Wins, + Other + } +} diff --git a/Hearthstone Treasury/Hearthstone Treasury.csproj b/Hearthstone Treasury/Hearthstone Treasury.csproj index 94f6eb4..a835717 100644 --- a/Hearthstone Treasury/Hearthstone Treasury.csproj +++ b/Hearthstone Treasury/Hearthstone Treasury.csproj @@ -123,6 +123,7 @@ TreasuryMenuItem.xaml + diff --git a/Hearthstone Treasury/HearthstoneTreasuryPlugin.cs b/Hearthstone Treasury/HearthstoneTreasuryPlugin.cs index 60173b4..037050e 100644 --- a/Hearthstone Treasury/HearthstoneTreasuryPlugin.cs +++ b/Hearthstone Treasury/HearthstoneTreasuryPlugin.cs @@ -4,6 +4,8 @@ using System.IO; using System.Windows; using ReactiveUI; +using Hearthstone_Treasury.Enums; +using System.Linq; namespace Hearthstone_Treasury { diff --git a/Hearthstone Treasury/ViewModels/NewTransactionViewModel.cs b/Hearthstone Treasury/ViewModels/NewTransactionViewModel.cs index 6a8432a..d33247f 100644 --- a/Hearthstone Treasury/ViewModels/NewTransactionViewModel.cs +++ b/Hearthstone Treasury/ViewModels/NewTransactionViewModel.cs @@ -1,4 +1,5 @@ -using ReactiveUI; +using Hearthstone_Treasury.Enums; +using ReactiveUI; using ReactiveUI.Fody.Helpers; namespace Hearthstone_Treasury.ViewModels diff --git a/Hearthstone Treasury/ViewModels/TransactionListViewModel.cs b/Hearthstone Treasury/ViewModels/TransactionListViewModel.cs index 3634603..05c110c 100644 --- a/Hearthstone Treasury/ViewModels/TransactionListViewModel.cs +++ b/Hearthstone Treasury/ViewModels/TransactionListViewModel.cs @@ -1,10 +1,10 @@ -using ReactiveUI; +using Hearthstone_Treasury.Enums; +using ReactiveUI; using ReactiveUI.Fody.Helpers; using System; using System.Linq; using System.Reactive; using System.Reactive.Linq; -using System.Windows; namespace Hearthstone_Treasury.ViewModels { @@ -21,6 +21,11 @@ public TransactionListViewModel(ReactiveList transactionsL TransactionTemplate.CreateTransaction.Subscribe(t => AddTransactionFromTemplate()); } + public void AddTransaction(TransactionViewModel transaction) + { + Transactions.Add(transaction); + } + private void AddTransactionFromTemplate() { Transactions.Add(new TransactionViewModel() diff --git a/Hearthstone Treasury/ViewModels/TransactionViewModel.cs b/Hearthstone Treasury/ViewModels/TransactionViewModel.cs index 67b1d01..804a7b4 100644 --- a/Hearthstone Treasury/ViewModels/TransactionViewModel.cs +++ b/Hearthstone Treasury/ViewModels/TransactionViewModel.cs @@ -1,20 +1,10 @@ using System; using ReactiveUI; using ReactiveUI.Fody.Helpers; +using Hearthstone_Treasury.Enums; namespace Hearthstone_Treasury.ViewModels { - [Serializable] - public enum CategoryEnum - { - Pack, - Arena, - AdventureWing, - Daily, - Wins, - Other - } - [Serializable] public class TransactionViewModel : ReactiveObject {