public MainWindow()
 {
     viewModel   = new ApplicationViewModel();
     DataContext = viewModel;
     viewModel.Refresh();
     InitializeComponent();
     if (viewModel.CheckAdmin())
     {
         MainFrame.Content               = new AdminBooksPage(ref viewModel);
         editButton.Visibility           = Visibility.Visible;
         getButton.Visibility            = Visibility.Collapsed;
         increaseAmountButton.Visibility = Visibility.Visible;
         //AddBookField.Visibility = Visibility.Visible;
     }
     else
     {
         //AddBookField.Visibility = Visibility.Collapsed;
         addBook.Visibility    = Visibility.Collapsed;
         MainFrame.Content     = new ClientPage(ref viewModel);
         getButton.Visibility  = Visibility.Visible;
         editButton.Visibility = Visibility.Collapsed;
     }
     settingsButton.ContextMenu.IsEnabled = false;
     infoButton.ContextMenu.IsEnabled     = false;
 }
 private void ListBoxItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (viewModel.CheckAdmin())
     {
         MainFrame.Content               = new AdminBooksPage(ref viewModel);
         editButton.Visibility           = Visibility.Visible;
         getButton.Visibility            = Visibility.Collapsed;
         increaseAmountButton.Visibility = Visibility.Visible;
     }
     else
     {
         MainFrame.Content     = new ClientPage(ref viewModel);
         getButton.Visibility  = Visibility.Visible;
         editButton.Visibility = Visibility.Collapsed;
     }
     viewModel.Refresh();
     headerName.Text        = "Books";
     infoPanel.Visibility   = Visibility.Visible;
     searchField.Visibility = Visibility.Visible;
 }