using System; using System.Collections.Generic; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Sample_Project { /// /// Interaction logic for FancyToolTip.xaml /// public partial class FancyToolTip { #region InfoText dependency property /// /// The tooltip details. /// public static readonly DependencyProperty InfoTextProperty = DependencyProperty.Register("InfoText", typeof (string), typeof (FancyToolTip), new FrameworkPropertyMetadata("", InfoTextPropertyChanged)); /// /// A property wrapper for the /// dependency property:
/// The tooltip details. ///
public string InfoText { get { return (string) GetValue(InfoTextProperty); } set { SetValue(InfoTextProperty, value); } } /// /// A static callback listener which is being invoked if the /// dependency property has /// been changed. Invokes the /// instance method of the changed instance. /// /// The currently processed owner of the property. /// Provides information about the updated property. private static void InfoTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FancyToolTip owner = (FancyToolTip) d; owner.OnInfoTextPropertyChanged(e); } /// /// Handles changes of the dependency property. As /// WPF internally uses the dependency property system and bypasses the /// property wrapper, updates of the property's value /// should be handled here. /// Provides information about the updated property. private void OnInfoTextPropertyChanged(DependencyPropertyChangedEventArgs e) { // string newValue = (string) e.NewValue; } #endregion public FancyToolTip() { this.InitializeComponent(); } } }