public SessionReview() { if (Settings.Current.StartupMaximized) { WindowState = WindowState.Maximized; } InitializeComponent(); DataContext = new WindowViewModelBase(); }
public LoadingWindow() { logger.TraceResource("WinInit"); InitializeComponent(); DataContext = new WindowViewModelBase(); closeTimer.Elapsed += (s, e) => Dispatcher.Invoke(Close); Topmost = true; logger.TraceResource("WinInitD"); }
public LauncherWindow() { logger.TraceResource("WinInit"); InitializeComponent(); if (!String.IsNullOrEmpty(Settings.Current.BaseColorScheme) && !String.IsNullOrEmpty(Settings.Current.ColorScheme)) { App.Theme = ThemeManager.Current.ChangeTheme(App.Current, Settings.Current.BaseColorScheme, Settings.Current.ColorScheme); } DataContext = new WindowViewModelBase(); logger.TraceResource("WinInitD"); }
public NavigationWindow(ViewModelBase viewModel) { if (Settings.Current.StartupMaximized) { WindowState = WindowState.Maximized; } logger.TraceResource("WinInit"); InitializeComponent(); logger.TraceResource("WinInitD"); logger.TraceResource("ViewModelInit"); DataContext = new WindowViewModelBase(); this.viewModel = viewModel ?? throw new ArgumentNullException(nameof(viewModel)); }
public QuickCommandsDashboardControlViewModel(WindowViewModelBase windowViewModel) : base(windowViewModel) { this.commandOne = this.GetCommand(0); this.commandTwo = this.GetCommand(1); this.commandThree = this.GetCommand(2); this.commandFour = this.GetCommand(3); this.commandFive = this.GetCommand(4); this.CommandOneCommand = this.CreateCommand(async(parameter) => { await this.RunCommand(this.CommandOne); }); this.CommandTwoCommand = this.CreateCommand(async(parameter) => { await this.RunCommand(this.CommandTwo); }); this.CommandThreeCommand = this.CreateCommand(async(parameter) => { await this.RunCommand(this.CommandThree); }); this.CommandFourCommand = this.CreateCommand(async(parameter) => { await this.RunCommand(this.CommandFour); }); this.CommandFiveCommand = this.CreateCommand(async(parameter) => { await this.RunCommand(this.CommandFive); }); this.NotifyPropertiesChanged(); }
public GameQueueMainControlViewModel(WindowViewModelBase windowViewModel) : base(windowViewModel) { GlobalEvents.OnGameQueueUpdated += GlobalEvents_OnGameQueueUpdated; this.EnableDisableCommand = this.CreateCommand(async(x) => { if (this.IsEnabled) { await ChannelSession.Services.GameQueueService.Disable(); } else { await ChannelSession.Services.GameQueueService.Enable(); } this.NotifyPropertyChanges(); }); this.MoveUpCommand = this.CreateCommand(async(user) => { await ChannelSession.Services.GameQueueService.MoveUp((UserViewModel)user); this.NotifyPropertyChanges(); }); this.MoveDownCommand = this.CreateCommand(async(user) => { await ChannelSession.Services.GameQueueService.MoveDown((UserViewModel)user); this.NotifyPropertyChanges(); }); this.DeleteCommand = this.CreateCommand(async(user) => { await ChannelSession.Services.GameQueueService.Leave((UserViewModel)user); this.NotifyPropertyChanges(); }); this.ClearQueueCommand = this.CreateCommand(async(x) => { if (await DialogHelper.ShowConfirmation("Are you sure you want to clear the Game Queue queue?")) { await ChannelSession.Services.GameQueueService.Clear(); this.NotifyPropertyChanges(); } }); }
/// <summary> /// Initializes a new instance of the <see cref="Import3DModelView" /> /// </summary> /// <param name="viewModel">The view-model of the view</param> public Import3DModelView(WindowViewModelBase viewModel) { InitializeComponent(); DataContext = viewModel; viewModel.CloseView += (s, e) => Close(); }
public WindowControlViewModelBase(WindowViewModelBase windowViewModel) { this.WindowViewModel = windowViewModel; }
public LoadingWindowBase(WindowViewModelBase viewModel) : this() { this.DataContext = this.ViewModel = viewModel; }
public RedemptionStoreMainControlViewModel(WindowViewModelBase windowViewModel) : base(windowViewModel) { GlobalEvents.OnRedemptionStorePurchasesUpdated += GlobalEvents_OnRedemptionStorePurchasesUpdated; }
public ChatListControlViewModel(WindowViewModelBase windowViewModel) : base(windowViewModel) { this.SendMessageCommand = this.CreateCommand(async(parameter) => { if (!string.IsNullOrEmpty(this.SendMessageText)) { if (ChatAction.WhisperRegex.IsMatch(this.SendMessageText)) { Match whisperRegexMatch = ChatAction.WhisperRegex.Match(this.SendMessageText); string message = this.SendMessageText.Substring(whisperRegexMatch.Value.Length); Match userNameMatch = ChatAction.UserNameTagRegex.Match(whisperRegexMatch.Value); string username = userNameMatch.Value; username = username.Trim(); username = username.Replace("@", ""); await ChannelSession.Services.Chat.Whisper(StreamingPlatformTypeEnum.All, username, message, this.SendAsStreamer); } else if (ChatAction.ClearRegex.IsMatch(this.SendMessageText)) { await ChannelSession.Services.Chat.ClearMessages(); } else if (ChatAction.TimeoutRegex.IsMatch(this.SendMessageText)) { string[] splits = this.SendMessageText.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (splits.Length == 3) { string username = splits[1]; username = username.Trim(); username = username.Replace("@", ""); UserViewModel user = ChannelSession.Services.User.GetUserByUsername(username); if (user != null) { if (uint.TryParse(splits[2], out uint amount) && amount > 0) { await ChannelSession.Services.Chat.TimeoutUser(user, amount); } else { await ChannelSession.Services.Chat.AddMessage(new AlertChatMessageViewModel("The timeout amount specified must be greater than 0")); } } else { await ChannelSession.Services.Chat.AddMessage(new AlertChatMessageViewModel("No user could be found with that name")); } } } else if (ChatAction.BanRegex.IsMatch(this.SendMessageText)) { string[] splits = this.SendMessageText.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (splits.Length == 2) { string username = splits[1]; username = username.Trim(); username = username.Replace("@", ""); UserViewModel user = ChannelSession.Services.User.GetUserByUsername(username); if (user != null) { await ChannelSession.Services.Chat.BanUser(user); } } else { await ChannelSession.Services.Chat.AddMessage(new AlertChatMessageViewModel("No user could be found with that name")); } } else { await ChannelSession.Services.Chat.SendMessage(this.SendMessageText, sendAsStreamer: this.SendAsStreamer); } this.SentMessageHistory.Remove(this.SendMessageText); this.SentMessageHistory.Insert(0, this.SendMessageText); this.SentMessageHistoryIndex = -1; this.SendMessageText = string.Empty; this.MessageSentOccurred(this, new EventArgs()); } }); this.ScrollingLockCommand = this.CreateCommand((parameter) => { this.IsScrollingLocked = !this.IsScrollingLocked; this.ScrollingLockChanged(this, new EventArgs()); return(Task.FromResult(0)); }); GlobalEvents.OnChatVisualSettingsChanged += GlobalEvents_OnChatVisualSettingsChanged; ChannelSession.Services.Chat.ChatCommandsReprocessed += Chat_ChatCommandsReprocessed; }
public AlertsDashboardControlViewModel(WindowViewModelBase windowViewModel) : base(windowViewModel) { }
/// <summary> /// Creates a new oinstance of the EntityNameDialogView /// </summary> /// <param name="viewModel">The view-model to enter a name on the view</param> public EntityNameDialogView(WindowViewModelBase viewModel) { InitializeComponent(); DataContext = viewModel; viewModel.CloseView += (s, e) => Close(); }
public TwitchChannelPointsMainControlViewModel(WindowViewModelBase windowViewModel) : base(windowViewModel) { }