コード例 #1
0
 public void SetAsAdder(ViewModelMainWindow mw)
 {
     Main = mw;
     if (!isSet) {
         ButtonLabel = "Add";
         ButtonClicked = new RelayCommand(ClickMeAdder);
         isSet = true;
         RaisePropertyChanged("ButtonClicked");
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 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");
     }
 }
コード例 #5
0
 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");
     }
 }