Skip to content

Commit

Permalink
Added basic ManaCostSelectorControl and added it to the ArenaDraftVie…
Browse files Browse the repository at this point in the history
…w for mana costs 1, 2, 3, 4, 5 and 6.
  • Loading branch information
skiwi2 committed Dec 28, 2016
1 parent fa245f0 commit a13ff45
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ArenaDraftAssistant/ArenaDraftAssistant.csproj
Expand Up @@ -87,6 +87,9 @@
<Compile Include="DelegateCommand.cs" />
<Compile Include="HeroClassValueConverter.cs" />
<Compile Include="MainWindowViewModel.cs" />
<Compile Include="ManaCostSelectorControl.xaml.cs">
<DependentUpon>ManaCostSelectorControl.xaml</DependentUpon>
</Compile>
<Compile Include="SelectHeroClassModel.cs" />
<Compile Include="SelectHeroClassViewModel.cs" />
<Compile Include="SelectHeroClassView.xaml.cs">
Expand All @@ -109,6 +112,10 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="ManaCostSelectorControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SelectHeroClassView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
8 changes: 8 additions & 0 deletions ArenaDraftAssistant/ArenaDraftView.xaml
Expand Up @@ -12,6 +12,14 @@
<StackPanel>
<Label Content="Selected Hero Class"/>
<Label Content="{Binding Path=SelectedHeroClass, Converter={StaticResource HeroClassValueConverter}}"/>
<local:ManaCostSelectorControl ManaCost="1"/>
<local:ManaCostSelectorControl ManaCost="2"/>
<local:ManaCostSelectorControl ManaCost="3"/>
<local:ManaCostSelectorControl ManaCost="4"/>
<local:ManaCostSelectorControl ManaCost="5"/>
<local:ManaCostSelectorControl ManaCost="6"/>
</StackPanel>
</UserControl>



14 changes: 14 additions & 0 deletions ArenaDraftAssistant/ManaCostSelectorControl.xaml
@@ -0,0 +1,14 @@
<UserControl x:Class="ArenaDraftAssistant.ManaCostSelectorControl"
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">
<StackPanel Orientation="Horizontal">
<CheckBox>
<Label Content="{Binding Path=ManaCost, StringFormat='\{0\} Mana'}"/>
</CheckBox>
</StackPanel>
</UserControl>
38 changes: 38 additions & 0 deletions ArenaDraftAssistant/ManaCostSelectorControl.xaml.cs
@@ -0,0 +1,38 @@
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 ManaCostSelector.xaml
/// </summary>
public partial class ManaCostSelectorControl : UserControl
{
public ManaCostSelectorControl()
{
InitializeComponent();

DataContext = this;
}

public static readonly DependencyProperty ManaCostProperty = DependencyProperty.Register(nameof(ManaCost), typeof(int), typeof(ManaCostSelectorControl));

public int ManaCost
{
get { return (int) GetValue(ManaCostProperty); }
set { SetValue(ManaCostProperty, value); }
}
}
}

0 comments on commit a13ff45

Please sign in to comment.