public PDFReader(string pdf, CatParameters selectedCat) { _pdf = pdf; _selectedCat = selectedCat; InitializeComponent(); WebBrowser webBrowser = new WebBrowser(); webBrowser.Navigate(new Uri(_pdf)); PDF.Content = webBrowser; }
private void ShowCat_Click(object sender, RoutedEventArgs e) { if (catsList.SelectedItem != null) { string name = catsList.SelectedItem.ToString(); CatParameters selectedCat = _catsList.Find(selCat => selCat.catName == name); var newWPF = new CatDetails(selectedCat); newWPF.CatDetail(); newWPF.Show(); } else { MessageBox.Show("Choose a cat!", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void NewCat_Click(object sender, RoutedEventArgs e) { try { var res = MessageBox.Show("Is " + newCatName.Text + " male?", "One more thing", MessageBoxButton.YesNo, MessageBoxImage.Question); if (res == MessageBoxResult.Yes) { catSex = true; } CatParameters newCat = new CatParameters(newCatName.Text, newCatRace.Text, Convert.ToInt32(newCatMass.Text), food.Text, catSex); newCat.weightDate = DateTime.Now; _catsList.Add(newCat); catsList.Items.Add(newCat.catName); Directory.CreateDirectory(appPath + @"\" + newCatName.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public CatDetails(CatParameters selectedCat) { _selectedCat = selectedCat; }