/// <summary> /// Opens the View for SetAlarm, either in New Alarm mode (default) or /// in Edit mode (if a BasicAlarm is passed). /// </summary> /// <param name="alarm">The alarm to edit. If null, then create a new alarm.</param> private void SetAlarmView(BasicAlarm alarm = null) { SetAlarm setAlarm; if (alarm == null) { // set new alarm setAlarm = new SetAlarm(); } else { // edit alarm setAlarm = new SetAlarm(alarm); } Main.Children.Add(setAlarm); }
private void setAlarm_Click(object sender, RoutedEventArgs e) { SetAlarm newSA = new SetAlarm(); (this.Parent as Panel).Children.Add(newSA); }