public void SetAsAdder(ViewModelMainWindow mw)
 {
     Main = mw;
     if (!isSet) {
         ButtonLabel = "Add";
         ButtonClicked = new RelayCommand(ClickMeAdder);
         isSet = true;
         RaisePropertyChanged("ButtonClicked");
     }
 }
        public ViewModelSaveLoad()
        {
            SerializatorNames = new Collection<string>();
            SerializatorNames.Add("XML");
            SerializatorNames.Add("JSON");
            SerializatorNames.Add("Binarny");
            SerializatorNames.Add("Paskudny");

            Path = "File.file";

            SaveClicked = new RelayCommand(Save);
            LoadClicked = new RelayCommand(Load);
        }
        public ViewModelMainWindow()
        {
            Baza = new Baza(new RandomFiller(30), new XmlSerial("XML.xml"));

            AddReaderClicked = new RelayCommand(OpenReaderAdder);
            EditReaderClicked = new RelayCommand(OpenReaderEditor);
            RemoveReaderClicked = new RelayCommand(RemoveReader);

            AddBookClicked = new RelayCommand(OpenBookAdder);
            EditBookClicked = new RelayCommand(OpenBookEditor);
            RemoveBookClicked = new RelayCommand(RemoveBook);

            AddBorrowClicked = new RelayCommand(OpenBorrowAdder);
            RemoveBorrowClicked = new RelayCommand(RemoveBorrow);

            ExitClicked = new RelayCommand(Exit);
            SaveLoadClicked = new RelayCommand(OpenSaveLoad);
        }
 public void SetAsEditor(ViewModelMainWindow mw, Reader r)
 {
     Main = mw;
     if (!isSet) {
         Reader = r;
         Name = r.Imie;
         Surname = r.Nazwisko;
         ButtonLabel = "Save";
         ButtonClicked = new RelayCommand(ClickMeEditor);
         isSet = true;
         RaisePropertyChanged("ButtonClicked");
     }
 }
 public void SetAsEditor(ViewModelMainWindow mw, Book b)
 {
     Main = mw;
     if (!isSet) {
         Book = b;
         Title = b.Tytul;
         Author = b.Autor;
         IssueYear = b.IssueYear.ToString();
         ButtonLabel = "Save";
         ButtonClicked = new RelayCommand(ClickMeEditor);
         isSet = true;
         RaisePropertyChanged("ButtonClicked");
     }
 }