Skip to content

Commit

Permalink
moved enums into separate folder
Browse files Browse the repository at this point in the history
  • Loading branch information
arkein committed May 8, 2016
1 parent 395e5bc commit a5f3b02
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<UserControl.Resources>
<ObjectDataProvider x:Key="categoryEnum" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type Type="Models:CategoryEnum"/>
<x:Type Type="Enums:CategoryEnum"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</UserControl.Resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<UserControl.Resources>
<ObjectDataProvider x:Key="categoryEnum" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type Type="Models:CategoryEnum"/>
<x:Type Type="Enums:CategoryEnum"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<CollectionViewSource x:Key="TransactionsViewSource" Source="{Binding Transactions}">
Expand Down
15 changes: 15 additions & 0 deletions Hearthstone Treasury/Enums/CategoryEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;

namespace Hearthstone_Treasury.Enums
{
[Serializable]
public enum CategoryEnum
{
Pack,
Arena,
AdventureWing,
Daily,
Wins,
Other
}
}
1 change: 1 addition & 0 deletions Hearthstone Treasury/Hearthstone Treasury.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<Compile Include="Controls\TreasuryMenuItem.xaml.cs">
<DependentUpon>TreasuryMenuItem.xaml</DependentUpon>
</Compile>
<Compile Include="Enums\CategoryEnum.cs" />
<Compile Include="HearthstoneTreasuryPlugin.cs" />
<Compile Include="ViewModels\NewTransactionViewModel.cs" />
<Compile Include="ViewModels\StatisticsViewModel.cs" />
Expand Down
2 changes: 2 additions & 0 deletions Hearthstone Treasury/HearthstoneTreasuryPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using System.IO;
using System.Windows;
using ReactiveUI;
using Hearthstone_Treasury.Enums;
using System.Linq;

namespace Hearthstone_Treasury
{
Expand Down
3 changes: 2 additions & 1 deletion Hearthstone Treasury/ViewModels/NewTransactionViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ReactiveUI;
using Hearthstone_Treasury.Enums;
using ReactiveUI;
using ReactiveUI.Fody.Helpers;

namespace Hearthstone_Treasury.ViewModels
Expand Down
9 changes: 7 additions & 2 deletions Hearthstone Treasury/ViewModels/TransactionListViewModel.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -21,6 +21,11 @@ public TransactionListViewModel(ReactiveList<TransactionViewModel> transactionsL
TransactionTemplate.CreateTransaction.Subscribe(t => AddTransactionFromTemplate());
}

public void AddTransaction(TransactionViewModel transaction)
{
Transactions.Add(transaction);
}

private void AddTransactionFromTemplate()
{
Transactions.Add(new TransactionViewModel()
Expand Down
12 changes: 1 addition & 11 deletions Hearthstone Treasury/ViewModels/TransactionViewModel.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down

0 comments on commit a5f3b02

Please sign in to comment.