private void Edit_Click(object sender, RoutedEventArgs e)
 {
     if (datagrid_main.SelectedItems.Count > 0)
     {
         var bookWindow = new BookDataWindow(this, (BookModel)datagrid_main.SelectedItem, false);
         bookWindow.Show();
     }
 }
 private void Datagrid_main_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (datagrid_main.SelectedItems.Count > 0)
     {
         var bookWindow = new BookDataWindow(this, (BookModel)datagrid_main.SelectedItem, string.IsNullOrWhiteSpace(userToken));
         bookWindow.Show();
     }
 }
        private void New_Click(object sender, RoutedEventArgs e)
        {
            var bookWindow = new BookDataWindow(this);

            bookWindow.Show();
        }