예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            movieView        = new MovieView(videoStore);
            libraryView      = new LibraryView(videoStore);
            subscriptionPage = new SubscriptionPage(videoStore);
            helpPage         = new HelpPage();

            var sr = videoStore.Services.ToList();

            for (int i = 0; i < sr.Count; i++)
            {
                ServicesModel.addSerice(i, sr[i].ServiceName, sr[i].Price);
            }

            navigateFrame.Navigate(movieView);
            loginNameTextBox.Focus();

            menuList.SelectedIndex = 0;

            AppUpdate.ShowLoginDialog += LoginDialogOpen;
            AppUpdate.ChangeCash      += ChangeCash;
            AppUpdate.ShowLibrary     += ShowUserLibrary;
            AppUpdate.UpdateCash      += UpdateCash;
        }
예제 #2
0
        private void logoutButton_Click(object sender, RoutedEventArgs e)
        {
            CurrentUser.ResetUser();

            userInfoName.Text   = "";
            userInfo.Visibility = Visibility.Collapsed;

            logoutButton.Visibility = Visibility.Collapsed;
            loginButton.Visibility  = Visibility.Visible;

            libraryView      = new LibraryView(videoStore);
            subscriptionPage = new SubscriptionPage(videoStore);
            movieView        = new MovieView(videoStore);

            navigateFrame.Navigate(movieView);

            menuList.SelectedIndex = 0;
        }