|
@@ -14,12 +14,13 @@ namespace SASDesktop
|
|
|
class Navigation
|
|
|
{
|
|
|
#region Команды
|
|
|
- public static DelegateCommand ToDriverCreate { get; set; } = new DelegateCommand(ToDriverCreateExecuted);
|
|
|
- public static DelegateCommand ToDriverList { get; set; } = new DelegateCommand(ToDriverListExecuted);
|
|
|
+ public static DelegateCommand ToDriverCreate { get; set; } = new DelegateCommand(ToDriverCreateExecuted);
|
|
|
+ public static DelegateCommand ToDriverList { get; set; } = new DelegateCommand(ToDriverListExecuted);
|
|
|
public static DelegateCommand ToTransportCreate { get; set; } = new DelegateCommand(ToTransportCreateExecuted);
|
|
|
- public static DelegateCommand ToTransportList { get; set; } = new DelegateCommand(ToTransportListExecuted);
|
|
|
+ public static DelegateCommand ToTransportList { get; set; } = new DelegateCommand(ToTransportListExecuted);
|
|
|
+ public static DelegateCommand Logout { get; set; } = new DelegateCommand(LogoutExecuted);//shotup
|
|
|
#endregion
|
|
|
-
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Возвращает главный фрейм приложения
|
|
|
/// </summary>
|
|
@@ -27,7 +28,23 @@ namespace SASDesktop
|
|
|
{
|
|
|
return (App.Current.MainWindow as MainWindow).ContentBody;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Показывает кнопку выхода
|
|
|
+ /// </summary>
|
|
|
+ public static void ShowLogoutButton()
|
|
|
+ {
|
|
|
+ (App.Current.MainWindow as MainWindow).LogoutButton.Visibility = System.Windows.Visibility.Visible;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Скрывает кнопку выхода
|
|
|
+ /// </summary>
|
|
|
+ public static void HideLogoutButton()
|
|
|
+ {
|
|
|
+ (App.Current.MainWindow as MainWindow).LogoutButton.Visibility = System.Windows.Visibility.Hidden;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Переводит на главную страницу приложения
|
|
|
/// </summary>
|
|
@@ -67,5 +84,16 @@ namespace SASDesktop
|
|
|
{
|
|
|
throw new NotImplementedException();
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Выполняет выход из приложенияя
|
|
|
+ /// </summary>
|
|
|
+ public static void LogoutExecuted()
|
|
|
+ {
|
|
|
+ AuthState.CurrentUser = null;
|
|
|
+ AuthState.LogoutButtonVisible = false;
|
|
|
+ HideLogoutButton();
|
|
|
+ GetMainFrame().Navigate(new Views.Auth());
|
|
|
+ }
|
|
|
}
|
|
|
}
|