public void CreateMainWindow(User user) { MainWindowView mainWindowView = new MainWindowView(); mainWindowView.CurrentUser = user; mainWindowView.Show(); this.Close(); }
public void OneTimeLoadRecords(MainWindowView mw) { CallerMainWindow = mw; string usersPath = Path.Combine(User.Username, "records.ser"); Stream stream = File.Open(usersPath, FileMode.Open); var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); CallerMainWindow.Dict = (Dictionary <string, double>)binaryFormatter.Deserialize(stream); }
public void LoadRecords(MainWindowView mw) { if (mw != null) { CallerMainWindow = mw; ListBox box = mw.Start_Listbox; Dictionary <string, double> localDic = mw.Dict; foreach (var e in localDic) { StackPanel stack = new StackPanel(); stack.Orientation = Orientation.Horizontal; stack.Children.Add(new Label { Content = e.Key + ": " }); stack.Children.Add(new Label { Content = DoubleToTime(e.Value) }); box.Items.Add(stack); } } }