public void OnTeachingTipClosing(TeachingTip sender, TeachingTipClosingEventArgs args) { if (lstTeachingTipEvents != null) { lstTeachingTipEvents.Items.Add(lstTeachingTipEvents.Items.Count.ToString() + ") " + args.ToString() + " Reason: " + args.Reason.ToString()); lstTeachingTipEvents.ScrollIntoView(lstTeachingTipEvents.Items.Last <object>()); } CheckBox cancelClosesCheckBox = null; if (sender == TeachingTipInResources) { cancelClosesCheckBox = CancelClosesCheckBoxInResources; } else { cancelClosesCheckBox = CancelClosesCheckBoxInVisualTree; } if (cancelClosesCheckBox != null && cancelClosesCheckBox.IsChecked == true) { deferral = args.GetDeferral(); args.Cancel = true; timer = new DispatcherTimer(); timer.Tick += Timer_Tick; timer.Interval = new TimeSpan(0, 0, 1); timer.Start(); } }
public void OnTeachingTipClosing(object sender, TeachingTipClosingEventArgs args) { lstTeachingTipEvents.Items.Add(lstTeachingTipEvents.Items.Count.ToString() + ") " + args.ToString() + " Reason: " + args.Reason.ToString()); lstTeachingTipEvents.ScrollIntoView(lstTeachingTipEvents.Items.Last <object>()); if (CancelClosesCheckBox.IsChecked == true) { deferral = args.GetDeferral(); args.Cancel = true; timer = new DispatcherTimer(); timer.Tick += Timer_Tick; timer.Interval = new TimeSpan(0, 0, 1); timer.Start(); } }