private void CommandButtons_EditClicked(object sender, RoutedEventArgs e) { TimerCommandModel command = ((CommandListingButtonsControl)sender).GetCommandFromCommandButtons <TimerCommandModel>(); if (command != null) { CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(command); window.CommandSaved += TimerWindow_CommandSaved; window.ForceShow(); } }
private async void CommandButtons_DeleteClicked(object sender, RoutedEventArgs e) { await this.Window.RunAsyncOperation(async() => { TimerCommandModel command = ((CommandListingButtonsControl)sender).GetCommandFromCommandButtons <TimerCommandModel>(); if (command != null) { ChannelSession.TimerCommands.Remove(command); ChannelSession.Settings.RemoveCommand(command); this.viewModel.RemoveCommand(command); await ChannelSession.SaveSettings(); await ChannelSession.Services.Timers.RebuildTimerGroups(); } }); }
public TimerCommandEditorWindowViewModel(TimerCommandModel existingCommand) : base(existingCommand) { this.SelectedCommandGroupChanged(); }