mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-17 17:28:53 -05:00
--------- CHG Lot of plumbing, some fixes CHG Work on sample project. CHG Popups and ContextMenu now store coordinates - otherwise delayed opending may happen elsewhere. git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@55 9f600761-6f11-4665-b6dc-0185e9171623
80 lines
2.5 KiB
C#
80 lines
2.5 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for FancyToolTip.xaml
|
|
/// </summary>
|
|
public partial class FancyToolTip
|
|
{
|
|
#region InfoText dependency property
|
|
|
|
/// <summary>
|
|
/// The tooltip details.
|
|
/// </summary>
|
|
public static readonly DependencyProperty InfoTextProperty =
|
|
DependencyProperty.Register("InfoText",
|
|
typeof (string),
|
|
typeof (FancyToolTip),
|
|
new FrameworkPropertyMetadata("", InfoTextPropertyChanged));
|
|
|
|
/// <summary>
|
|
/// A property wrapper for the <see cref="InfoTextProperty"/>
|
|
/// dependency property:<br/>
|
|
/// The tooltip details.
|
|
/// </summary>
|
|
public string InfoText
|
|
{
|
|
get { return (string) GetValue(InfoTextProperty); }
|
|
set { SetValue(InfoTextProperty, value); }
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// A static callback listener which is being invoked if the
|
|
/// <see cref="InfoTextProperty"/> dependency property has
|
|
/// been changed. Invokes the <see cref="OnInfoTextPropertyChanged"/>
|
|
/// instance method of the changed instance.
|
|
/// </summary>
|
|
/// <param name="d">The currently processed owner of the property.</param>
|
|
/// <param name="e">Provides information about the updated property.</param>
|
|
private static void InfoTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
{
|
|
FancyToolTip owner = (FancyToolTip) d;
|
|
owner.OnInfoTextPropertyChanged(e);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Handles changes of the <see cref="InfoTextProperty"/> dependency property. As
|
|
/// WPF internally uses the dependency property system and bypasses the
|
|
/// <see cref="InfoText"/> property wrapper, updates of the property's value
|
|
/// should be handled here.
|
|
/// </summary
|
|
/// <param name="e">Provides information about the updated property.</param>
|
|
private void OnInfoTextPropertyChanged(DependencyPropertyChangedEventArgs e)
|
|
{
|
|
// string newValue = (string) e.NewValue;
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
public FancyToolTip()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
}
|
|
} |