/// <summary> /// Event handler that adds the cue banner to the control. /// </summary> /// <param name="sender">The object where the event handler is attached.</param> /// <param name="e">The event data.</param> private static void Control_Loaded(object sender, RoutedEventArgs e) { Control control = sender as Control; AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(control); CueBannerAdorner cueBannerAdorner = new CueBannerAdorner(control, CueBannerService.GetCueBanner(control)); adornerLayer.Add(cueBannerAdorner); CueBannerService.UpdateAdornerState(control); }
/// <summary> /// Event handler that updates the cue banner when the control's text is changed. /// </summary> /// <param name="sender">The object where the event handler is attached.</param> /// <param name="e">The event data.</param> private static void Control_TextChanged(object sender, TextChangedEventArgs e) { Control control = sender as Control; CueBannerService.UpdateAdornerState(control); }
/// <summary> /// Event handler that updates the cue banner when the control gets focus. /// </summary> /// <param name="sender">The object where the event handler is attached.</param> /// <param name="e">The event data.</param> private static void Control_GotFocus(object sender, RoutedEventArgs e) { Control control = sender as Control; CueBannerService.UpdateAdornerState(control); }