mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-14 01:25:45 -05:00
--------------
FIX If a popup is opened, its window handle is now being set as the foreground.
This fixes an issue with certain controls being disabled on popups.
(thanks Andrew Smith for pointing me in the right direction!).
FIX Changed dispatcher access in order to work in WinForms scenarios, too.
ADD Added WinForms sample.
git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@118 9f600761-6f11-4665-b6dc-0185e9171623
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Samples
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for FancyPopup.xaml
|
|
/// </summary>
|
|
public partial class FancyPopup : UserControl
|
|
{
|
|
#region ClickCount dependency property
|
|
|
|
/// <summary>
|
|
/// The number of clicks on the popup button.
|
|
/// </summary>
|
|
public static readonly DependencyProperty ClickCountProperty =
|
|
DependencyProperty.Register("ClickCount",
|
|
typeof (int),
|
|
typeof (FancyPopup),
|
|
new FrameworkPropertyMetadata(0));
|
|
|
|
/// <summary>
|
|
/// A property wrapper for the <see cref="ClickCountProperty"/>
|
|
/// dependency property:<br/>
|
|
/// The number of clicks on the popup button.
|
|
/// </summary>
|
|
public int ClickCount
|
|
{
|
|
get { return (int) GetValue(ClickCountProperty); }
|
|
set { SetValue(ClickCountProperty, value); }
|
|
}
|
|
|
|
#endregion
|
|
|
|
public FancyPopup()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void OnButtonClick(object sender, RoutedEventArgs e)
|
|
{
|
|
//just increment a counter - will be displayed on screen
|
|
ClickCount++;
|
|
}
|
|
}
|
|
} |