private void handleViewModeChanged(AccountMode new_mode) { if (!credentials.isLoggedIn()) { Visible.Value = Visibility.Collapsed; return; } if (new_mode == Mode.Value) { return; } switch (new_mode) { case AccountMode.MAIN: CurrentView = new MainAccountView(credentials); return; case AccountMode.CHANGE_PASSWORD: CurrentView = new ChangePasswordView(credentials); return; case AccountMode.VIEW_RATINGS: CurrentView = createRatingView(); return; case AccountMode.REMOVE: CurrentView = new RemoveAccountView(credentials); return; } }
private void handleViewModeChanged(LoginMode new_mode) { if (credentials.isLoggedIn()) { Visible.Value = Visibility.Collapsed; } else if (new_mode != Mode.Value) { Visible.Value = Visibility.Visible; CurrentView = factory.createView(new_mode); } }