Beispiel #1
0
 public AppViewModel()
 {
     this.Schule      = new Schule();
     sfd.AddExtension = true;
     sfd.Filter       = "Schule Files | *.schule";
     ofd.AddExtension = true;
     ofd.Filter       = "Schule Files | *.schule";
     this.saveCommand = new RCommand(saveBtnClick, () => { return(true); });
     this.openCommand = new RCommand(openBtnClick, () => { return(true); });
 }
Beispiel #2
0
 private void openBtnClick()
 {
     if (ofd.ShowDialog() == true)
     {
         if (ofd.FileName != "")
         {
             StreamReader  ff  = System.IO.File.OpenText(ofd.FileName);
             XmlSerializer ser = new XmlSerializer(typeof(Schule));
             this.Schule = (Schule)ser.Deserialize(ff);
         }
     }
 }