//button-click events private void Btn_AboutYou_Click(object sender, RoutedEventArgs e) { var win = new W_aboutYou(); win.Owner = this; //this window will be the owner win.StPnl_Details.DataContext = App._user.LastOrDefault(); Visibility = Visibility.Hidden; // win.Show(); //can create more than 1 windows win.ShowDialog(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { // App._items.Add(new Item { FoodItem = "Lemons", Calories = 29, Quantity = }); // App._activities.Add(new Activity { Act_name = "Running", Calories = 624, Speed = 6.67 }); bool newUser = Properties.Settings.Default.Usernew_; if (newUser | App._user.Count == 0) //checking for first time user entry { newUser = false; Properties.Settings.Default.Usernew_ = newUser; Properties.Settings.Default.Save(); var window = new W_aboutYou(); window.Owner = this; Visibility = Visibility.Hidden; window.ShowDialog(); } Lbx_Dates.ItemsSource = App._logs; }