Skip to content

Commit

Permalink
Added code to exit program
Browse files Browse the repository at this point in the history
  • Loading branch information
TimeTravelPenguin committed Dec 18, 2019
1 parent 2a4bf7c commit 59d6f43
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Project/EveryoneIsJohnTracker/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// File Name: MainViewModel.cs
//
// Current Data:
// 2019-12-18 5:07 PM
// 2019-12-18 7:51 PM
//
// Creation Date:
// 2019-12-16 9:37 AM
Expand Down Expand Up @@ -113,6 +113,7 @@ public string EditableItemName
public ActionCommand CommandSaveGame { get; }
public ActionCommand CommandNextTurn { get; }
public ActionCommand CommandExportChart { get; }
public ActionCommand CommandExitApplication { get; }

public int ComboboxLevelBinding
{
Expand Down Expand Up @@ -185,7 +186,16 @@ public MainViewModel()

CommandNextTurn = new ActionCommand(() => GameMaster.IncrementTurn(1));

CommandExportChart = new ActionCommand(() => GameMaster.ChartModel.ExportLiveChart());
CommandExportChart = new ActionCommand(GameMaster.ChartModel.ExportLiveChart);

CommandExitApplication = new ActionCommand(() =>
{
if (MessageBox.Show("Are you sure you wish to quit?", "Close application?",
MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
{
Application.Current.Shutdown();
}
});

SelectedVoiceModel = GameMaster.Voices.FirstOrDefault();
ListViewSelectedVoice = GameMaster.Voices.FirstOrDefault();
Expand Down

0 comments on commit 59d6f43

Please sign in to comment.