From 3c8e092cae8bf973448526be72037eb891289050 Mon Sep 17 00:00:00 2001 From: epix37 Date: Sun, 6 Jul 2014 19:25:33 +0200 Subject: [PATCH] fixed deck selection dialog crashing the tracker --- .../Controls/DeckPicker.xaml.cs | 5 ++++- .../Windows/DeckSelectionDialog.xaml | 7 ++++--- .../Windows/DeckSelectionDialog.xaml.cs | 13 ++----------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Hearthstone Deck Tracker/Controls/DeckPicker.xaml.cs b/Hearthstone Deck Tracker/Controls/DeckPicker.xaml.cs index 828a482060..06450b9309 100644 --- a/Hearthstone Deck Tracker/Controls/DeckPicker.xaml.cs +++ b/Hearthstone Deck Tracker/Controls/DeckPicker.xaml.cs @@ -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; } } diff --git a/Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml b/Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml index 3dcb662840..4f00332acc 100644 --- a/Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml +++ b/Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml @@ -1,10 +1,11 @@ - + 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"> - + diff --git a/Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml.cs b/Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml.cs index 08caa127e4..62c48b5020 100644 --- a/Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml.cs +++ b/Hearthstone Deck Tracker/Windows/DeckSelectionDialog.xaml.cs @@ -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 {