private void Showman_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(GameAccount.AccountType)) { UpdateShowman(); return; } if (e.PropertyName == nameof(GameAccount.SelectedAccount)) { if (_showman.SelectedAccount == _computerShowmans.Last()) // Новый ведущий { var account = new ComputerAccount { CanBeDeleted = true }; var newShowmanAccount = new ShowmanViewModel(account); newShowmanAccount.Add += NewShowmanAccount_Add; var contentBox = new ContentBox { Data = newShowmanAccount, Title = Resources.NewShowman, Cancel = _closeNewShowman }; Navigate?.Invoke(contentBox); return; } _model.Showman = _showman.SelectedAccount; CheckUniqueAccounts(); } }
/// <summary> /// Raises event 'Navigate' /// </summary> protected virtual void OnNavigate() { if (Navigate != null) { Navigate.Invoke(this, System.EventArgs.Empty); } }
private void NavViewEx_Loaded(object sender, RoutedEventArgs e) { if (FindStart() is NavigationViewItem i && i != null) { Navigate.Invoke(Frame, i.GetValue(NavProperties.PageTypeProperty) as Type); } IsPaneOpenChanged(this, null); UpdateBackButton(); UpdateHeader(); }
private void EditComputerAccount_Executed(object arg) { var computerAccount = (ComputerAccount)arg; var newComputerAccount = new ComputerAccountViewModel(computerAccount.Clone(), computerAccount); newComputerAccount.Add += NewComputerAccount_Edit; var contentBox = new ContentBox { Data = newComputerAccount, Title = Resources.ComputerPlayer }; Navigate?.Invoke(contentBox); }
private void OnSignIn(object obj) { if (!CodeAnalysisServiceClient.SignIn(SignInModel.UserName, SignInModel.Password)) { MessageBox.Show("Invalid Username or Password"); } else { UpdateUserName.Invoke(SignInModel.UserName); Navigate.Invoke(ViewPages.ToolRun); } }
public void NavigateTo(EAreaType areaType, Object data = null) { var eventData = new CAreaNavigateEventArgs(areaType, data); ContentControl control = GetContentControl(areaType); if (control.DataContext is ViewModelBase vm) { vm.OnNavigated(data); } Navigate?.Invoke(this, control); //_navigationItems.Push(new CNavigationHistoryItem(pageType, targetId)); }
private void InflateSubPages(List <Config.Node> subPages) { foreach (var page in subPages) { var view = new NavigatorView(page); view.Navigate += delegate(string url) { Navigate?.Invoke(url); }; SubPagesContainer.Children.Add(view); } FoldButton.Visibility = SubPagesContainer.Children.Count > 0 ? Visibility.Visible : Visibility.Collapsed; }
private void GetResult() { bool result; ToolStatusModel.StatusMessage = "Almost done. Minions are Putting Finishing Touches on the Report...."; ToolStatusModel.StatusImage = "../Images/GetResult.png"; if (!ToolRunModel.GateType) { result = CodeAnalysisServiceClient.GetResult(-1, ToolRunModel.SelectedTool, ToolRunModel.RepoPath, ToolRunModel.Branch); } else { result = CodeAnalysisServiceClient.GetResult(ToolRunModel.GateThreshold, ToolRunModel.SelectedTool, ToolRunModel.RepoPath, ToolRunModel.Branch); } UpdateResult(result); Navigate.Invoke(ViewPages.Results); }
public NavigatorView(Config.Node page) { InitializeComponent(); this.Name.Content = page.PageName; if (page.PageUrl != null) { Body.MouseEnter += Body_MouseEnter; Body.MouseLeave += Body_MouseLeave; Body.MouseDown += delegate(object sender, MouseButtonEventArgs e) { Navigate?.Invoke(page.PageUrl); e.Handled = true; }; } Body.Background = defaultBackgroundBrush; InflateSubPages(page.SubPages); }
private void SelectPackage_Executed(object arg) { var code = (PackageSourceTypes)arg; switch (code) { case PackageSourceTypes.Next: Package = new NextPackageSource(); break; case PackageSourceTypes.Random: Package = new RandomPackageSource(); break; case PackageSourceTypes.RandomServer: Package = new RandomServerPackageSource(); break; case PackageSourceTypes.Local: var packagePath = PlatformManager.Instance.SelectLocalPackage(); if (packagePath != null) { Package = new CustomPackageSource(packagePath); } break; case PackageSourceTypes.SIStorage: var contentBox = new ContentBox { Data = StorageInfo, Title = Resources.SIStorage }; StorageInfo.Init(); Navigate?.Invoke(contentBox); break; case PackageSourceTypes.VK: try { Process.Start(Resources.ThemesLink); } catch (Exception exc) { PlatformManager.Instance.ShowMessage(string.Format(Resources.VKThemesError + "\r\n{1}", Resources.ThemesLink, exc.Message), MessageType.Error); } break; } }
private void OnSignUp(object obj) { if (SignUpModel.Password == SignUpModel.ReenterPw) { if (CodeAnalysisServiceClient.SignUp(SignUpModel.UserName, SignUpModel.Password)) { Navigate.Invoke(ViewPages.SignIn); } else { MessageBox.Show("Invalid Sign In"); } } else { MessageBox.Show("Ensure Passwords are identical"); } }
private void Task_Navigate(object?sender, EventArgs e) { ThreadHelper.ThrowIfNotOnUIThread(); if (sender is not ResourceErrorTask task) { return; } var entry = task.Entry; if (entry == null) { return; } Navigate?.Invoke(entry); }
private void Item_PropertyChanged(object sender, PropertyChangedEventArgs e) { var acc = (GameAccount)sender; if (e.PropertyName == nameof(GameAccount.AccountType)) { UpdatePlayer(acc); } else if (e.PropertyName == nameof(GameAccount.SelectedAccount)) { var index = Players.IndexOf(acc); if (index > -1 && index < _model.Players.Length) { _model.Players[index] = acc.SelectedAccount; } if (acc.SelectedAccount == _computerPlayers.Last()) { var account = new ComputerAccount() { CanBeDeleted = true }; // Зададим ему рандомные характеристики account.Randomize(); var newComputerAccount = new ComputerAccountViewModel(account, null); newComputerAccount.Add += NewComputerAccount_Add; var contentBox = new ContentBox { Data = newComputerAccount, Title = Resources.NewPlayer, Cancel = _closeNewPlayer }; Navigate?.Invoke(contentBox); } CheckUniqueAccounts(); } }
private void viewModel_Navigate(object sender, NavigateCodeEventArgs e) { Navigate?.Invoke(this, e); Hide(); }
void NavigateButton_Click(object sender, EventArgs e) { Navigate.Invoke(this, new EventArgs()); }
private void OnSignUp(object obj) { Navigate.Invoke(ViewPages.SignUp); }
private void OnNavigate(object parameter) { Navigate?.Invoke(this, new EventArgs()); }
public static void NavigateTo(BaseViewModel viewModel) { Navigate.Invoke(null, new NavigationEventArgs(viewModel)); }
private void OnReturn(object obj) { Navigate.Invoke(ViewPages.ToolRun); }
private void OnLogout(object obj) { Navigate.Invoke(ViewPages.SignIn); }
private void OnToolTest(object obj) { Navigate.Invoke(ViewPages.ToolTest); }