Skip to content

Commit

Permalink
fixed deck selection dialog crashing the tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
epix37 committed Jul 6, 2014
1 parent 7f2040e commit 3c8e092
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
5 changes: 4 additions & 1 deletion Hearthstone Deck Tracker/Controls/DeckPicker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ private void ListboxPicker_SelectionChanged(object sender, SelectionChangedEvent
SelectedDeck.IsSelectedInGui = false;
newSelectedDeck.IsSelectedInGui = true;
ListboxPicker.Items.Refresh();
SelectedDeckChanged(this, newSelectedDeck);

if(SelectedDeckChanged != null)
SelectedDeckChanged(this, newSelectedDeck);

SelectedDeck = newSelectedDeck;
}
}
Expand Down
7 changes: 4 additions & 3 deletions Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Window x:Class="Hearthstone_Deck_Tracker.DeckSelectionDialog"
<controls:MetroWindow x:Class="Hearthstone_Deck_Tracker.DeckSelectionDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Hearthstone_Deck_Tracker"
Title="Wrong deck detected!" Height="265" Width="280" Topmost="True" WindowStyle="ToolWindow" Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" Closing="Window_Closing">
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="Wrong deck!" Height="265" Width="280" Topmost="True" WindowStyle="ToolWindow" Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" Closing="Window_Closing">
<Grid>
<local:DeckPicker x:Name="DeckPickerList" SelectionChanged="DeckPickerList_SelectionChanged" Height="auto" Margin="0,34,0,0"></local:DeckPicker>
<Label Content="Select your deck" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="14" FontWeight="Bold" Margin="10,0,0,0" />
</Grid>
</Window>
</controls:MetroWindow>
13 changes: 2 additions & 11 deletions Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
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 MahApps.Metro.Controls;

namespace Hearthstone_Deck_Tracker
{
Expand Down

0 comments on commit 3c8e092

Please sign in to comment.