Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
187 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ArenaDraftAssistant | ||
{ | ||
class MainWindowViewModel : ViewModelBase | ||
{ | ||
public MainWindowViewModel() | ||
{ | ||
LoadSelectHeroClassPage(); | ||
} | ||
|
||
private ViewModelBase _currentViewModel; | ||
|
||
public ViewModelBase CurrentViewModel | ||
{ | ||
get { return _currentViewModel; } | ||
set | ||
{ | ||
_currentViewModel = value; | ||
OnPropertyChanged(nameof(CurrentViewModel)); | ||
} | ||
} | ||
|
||
private void LoadSelectHeroClassPage() => CurrentViewModel = new SelectHeroClassViewModel(new SelectHeroClassModel()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using ArenaDraftAssistant.Model; | ||
|
||
namespace ArenaDraftAssistant | ||
{ | ||
class SelectHeroClassModel | ||
{ | ||
// TODO add list of HeroClass to back a select box | ||
|
||
public HeroClass SelectedHeroClass { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<UserControl x:Class="ArenaDraftAssistant.SelectHeroClassView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:ArenaDraftAssistant" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" d:DesignWidth="300"> | ||
<Grid> | ||
<Label Content="Test"></Label> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
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.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace ArenaDraftAssistant | ||
{ | ||
/// <summary> | ||
/// Interaction logic for SelectHeroView.xaml | ||
/// </summary> | ||
public partial class SelectHeroClassView : UserControl | ||
{ | ||
public SelectHeroClassView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using ArenaDraftAssistant.Model; | ||
|
||
namespace ArenaDraftAssistant | ||
{ | ||
class SelectHeroClassViewModel : ViewModelBase | ||
{ | ||
public SelectHeroClassModel Model { get; private set; } | ||
|
||
public SelectHeroClassViewModel(SelectHeroClassModel model) | ||
{ | ||
Model = model; | ||
} | ||
|
||
public HeroClass SelectedHeroClass | ||
{ | ||
get { return Model.SelectedHeroClass; } | ||
set | ||
{ | ||
Model.SelectedHeroClass = value; | ||
OnPropertyChanged(nameof(SelectedHeroClass)); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ArenaDraftAssistant | ||
{ | ||
class ViewModelBase : INotifyPropertyChanged | ||
{ | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
protected void OnPropertyChanged(string propertyName) | ||
{ | ||
OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); | ||
} | ||
|
||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e) | ||
{ | ||
PropertyChanged?.Invoke(this, e); | ||
} | ||
} | ||
} |