Exemplo n.º 1
0
 private void SearchEnter_Method()
 {
     AccountPhoto AccountPhoto = new AccountPhoto(MainFrame);
     AccountPhotoModelView AccountPhotoModelView = 
         new AccountPhotoModelView(SearchCollection[SelectedIndex],MainFrame);
     AccountPhoto.DataContext = AccountPhotoModelView;
     MainFrame.NavigationService.Navigate(AccountPhoto, UriKind.Relative);
 }
        private void Loaded_Method()
        {
            Login login = new Login();
            LoginViewModel lvm = new LoginViewModel();
            login.DataContext = lvm;
            login.ShowDialog();

            try
            {
                LoginAccount = lvm.Account;
                AccountName = lvm.Account.AccountName;
                MainModel.MainAccount = lvm.Account;
                AccountPhoto AccountPhotoView = new AccountPhoto(MainFrame);
                AccountPhotoModelView AccountPhotoModelView = new AccountPhotoModelView(MainModel.MainAccount, MainFrame);
                AccountPhotoView.DataContext = AccountPhotoModelView;
                MainFrame.NavigationService.Navigate(AccountPhotoView, UriKind.Relative);
                SearhcEnable = true;
                MainFrame.NavigationService.RemoveBackEntry();
                while (MainFrame.CanGoBack)
                {
                    MainFrame.RemoveBackEntry();
                }
            }
            catch (NullReferenceException)
            {
                AccountName = "Нажмите чтобы войти";
                SearhcEnable = false;
                MainModel.MainAccount = null;
                while (MainFrame.CanGoBack)
                {
                    MainFrame.RemoveBackEntry();
                }
            }
        }