public MainWindow() { ApplicationStartup(); DataContext = currentViewModel; currentViewModel.AddAllSequences(SequenceList.Deserialize()); InitializeComponent(); RegisterKinect(); InitiateDisplay(); SetBaseCSVPath(); CreateDataTables(); }
public static SequenceList Deserialize(string filename) { // Create an instance of the XmlSerializer. XmlSerializer serializer = new XmlSerializer(typeof(SequenceList)); // Declare an object variable of the type to be deserialized. SequenceList sequences = null; try { using (Stream reader = new FileStream(filename, FileMode.Open)) { // Call the Deserialize method to restore the object's state. sequences = (SequenceList)serializer.Deserialize(reader); } } catch (FileNotFoundException) { Debug.WriteLine("Sequence configuration file not found"); } return(sequences); }