private void ThiefSelectedCommand_EditClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            CommandEditorWindow window = new CommandEditorWindow(FrameworkElementHelpers.GetDataContext <CustomCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { ((TreasureDefenseGameCommandEditorWindowViewModel)this.DataContext).ThiefSelectedCommand = (CustomCommandModel)command; };
            window.Show();
        }
Exemple #2
0
        private void UserOnlyChatCommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(FrameworkElementHelpers.GetDataContext <UserOnlyChatCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { this.viewModel.RefreshUserOnlyChatCommands(); };
            window.ForceShow();
        }
        private void MiddleThirdsSucceedCommand_EditClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(FrameworkElementHelpers.GetDataContext <CustomCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { ((HeistGameCommandEditorWindowViewModel)this.DataContext).MiddleThirdsSucceedCommand = (CustomCommandModel)command; };
            window.ForceShow();
        }
Exemple #4
0
        private void ExistingEntranceCommandButtons_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(FrameworkElementHelpers.GetDataContext <CommandModelBase>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { this.viewModel.EntranceCommand = command; };
            window.ForceShow();
        }
Exemple #5
0
        private void NewEventCommandButton_Click(object sender, RoutedEventArgs e)
        {
            CommandEditorWindow window = new CommandEditorWindow(FrameworkElementHelpers.GetDataContext <EventCommandItemViewModel>(sender).EventType);

            window.Closed += Window_Closed;
            window.Show();
        }
Exemple #6
0
        private void UserFailureCommand_EditClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(FrameworkElementHelpers.GetDataContext <CustomCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { ((WordScrambleGameCommandEditorWindowViewModel)this.DataContext).UserFailureCommand = (CustomCommandModel)command; };
            window.ForceShow();
        }
Exemple #7
0
        private void TradeCommand_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandEditorWindow window = new CommandEditorWindow(FrameworkElementHelpers.GetDataContext <CustomCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { this.viewModel.TradeCommand = command; };
            window.Show();
        }
        private void GiveawayUserJoinedCommand_EditClicked(object sender, RoutedEventArgs e)
        {
            CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(FrameworkElementHelpers.GetDataContext <CustomCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { ((GiveawayMainControlViewModel)this.DataContext).GiveawayUserJoinedCommand = command; };
            window.ForceShow();
        }
Exemple #9
0
        private void StatusCommand_EditClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            CommandEditorWindow window = new CommandEditorWindow(FrameworkElementHelpers.GetDataContext <CustomCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { ((CoinPusherGameCommandEditorWindowViewModel)this.DataContext).StatusCommand = (CustomCommandModel)command; };
            window.Show();
        }
        private void NotEnoughPlayersCommand_EditClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            CommandEditorWindow window = new CommandEditorWindow(FrameworkElementHelpers.GetDataContext <CustomCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { ((RussianRouletteGameCommandEditorWindowViewModel)this.DataContext).NotEnoughPlayersCommand = (CustomCommandModel)command; };
            window.Show();
        }
Exemple #11
0
        private void UserSelectedCommand_EditClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(FrameworkElementHelpers.GetDataContext <CustomCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) => { ((GameQueueMainControlViewModel)this.DataContext).GameQueueUserSelectedCommand = command; };
            window.ForceShow();
        }
Exemple #12
0
 private async void PlayButton_Click(object sender, RoutedEventArgs e)
 {
     await this.Window.RunAsyncOperation(async() =>
     {
         OverlayWidgetModel widget = FrameworkElementHelpers.GetDataContext <OverlayWidgetModel>(sender);
         await this.viewModel.PlayWidget(widget);
     });
 }
Exemple #13
0
 private async void UserOnlyChatCommandButtons_DeleteClicked(object sender, RoutedEventArgs e)
 {
     await this.RunAsyncOperation(async() =>
     {
         this.viewModel.RemoveUserOnlyChatCommand(FrameworkElementHelpers.GetDataContext <UserOnlyChatCommandModel>(sender));
         await ChannelSession.SaveSettings();
         ChannelSession.Services.Chat.RebuildCommandTriggers();
     });
 }
        private void Strike3Command_EditClicked(object sender, System.Windows.RoutedEventArgs e)
        {
            CommandEditorWindow window = CommandEditorWindow.GetCommandEditorWindow(FrameworkElementHelpers.GetDataContext <CustomCommandModel>(sender));

            window.CommandSaved += (object s, CommandModelBase command) =>
            {
                this.Strike3Command.DataContext = null;
                this.Strike3Command.DataContext = command;
            };
            window.ForceShow();
        }
        protected void OutcomeCommandButtons_CommandButtons(object sender, RoutedEventArgs e)
        {
            GameOutcomeViewModel outcome = FrameworkElementHelpers.GetDataContext <GameOutcomeViewModel>(sender);

            if (outcome.Command != null)
            {
                CommandEditorWindow window = new CommandEditorWindow(outcome.Command);
                window.CommandSaved += (object s, CommandModelBase command) => { outcome.Command = (CustomCommandModel)command; };
                window.Show();
            }
        }
Exemple #16
0
        private void EditButton_Click(object sender, RoutedEventArgs e)
        {
            OverlayWidgetModel widget = FrameworkElementHelpers.GetDataContext <OverlayWidgetModel>(sender);

            if (widget != null)
            {
                OverlayWidgetEditorWindow window = new OverlayWidgetEditorWindow(widget);
                window.Closed += Window_Closed;
                window.Show();
            }
        }
Exemple #17
0
 private async void DeleteButton_Click(object sender, RoutedEventArgs e)
 {
     await this.Window.RunAsyncOperation(async() =>
     {
         if (await DialogHelper.ShowConfirmation(MixItUp.Base.Resources.DeleteWidgetPrompt))
         {
             OverlayWidgetModel widget = FrameworkElementHelpers.GetDataContext <OverlayWidgetModel>(sender);
             await this.viewModel.DeleteWidget(widget);
             await this.viewModel.OnVisible();
         }
     });
 }
Exemple #18
0
 private async void DeleteButton_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     await this.Window.RunAsyncOperation(() =>
     {
         try
         {
             QueueUser queueUser = FrameworkElementHelpers.GetDataContext <QueueUser>(sender);
             this.viewModel.DeleteCommand.Execute(queueUser.user);
         }
         catch (Exception ex) { Logger.Log(ex); }
         return(Task.FromResult(0));
     });
 }
        private void EditButton_Click(object sender, RoutedEventArgs e)
        {
            CurrencyRankInventoryContainerViewModel item = FrameworkElementHelpers.GetDataContext <CurrencyRankInventoryContainerViewModel>(sender);

            if (item.Inventory != null)
            {
                InventoryWindow window = new InventoryWindow(item.Inventory);
                window.Closed += Window_Closed;
                window.Show();
            }
            else
            {
                CurrencyWindow window = new CurrencyWindow(item.Currency);
                window.Closed += Window_Closed;
                window.Show();
            }
        }
Exemple #20
0
 private async void EnableDisableToggleSwitch_Unchecked(object sender, RoutedEventArgs e)
 {
     await this.viewModel.DisableWidget(FrameworkElementHelpers.GetDataContext <OverlayWidgetModel>(sender));
 }
        protected void DeleteOutcomeButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            GameCommandEditorWindowViewModelBase viewModel = (GameCommandEditorWindowViewModelBase)this.DataContext;

            viewModel.DeleteOutcomeCommand.Execute(FrameworkElementHelpers.GetDataContext <GameOutcomeViewModel>(sender));
        }
Exemple #22
0
        private void DeleteQuestionButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            TriviaGameCommandEditorWindowViewModel viewModel = (TriviaGameCommandEditorWindowViewModel)this.DataContext;

            viewModel.DeleteQuestionCommand.Execute(FrameworkElementHelpers.GetDataContext <TriviaGameQuestionViewModel>(sender));
        }
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            CurrencyRankInventoryContainerViewModel item = FrameworkElementHelpers.GetDataContext <CurrencyRankInventoryContainerViewModel>(sender);

            this.viewModel.DeleteItem(item);
        }