diff --git a/Source/Changelog.txt b/Source/Changelog.txt
index 086df01..95b7bf7 100644
--- a/Source/Changelog.txt
+++ b/Source/Changelog.txt
@@ -5,7 +5,16 @@ Contact and Information: http://www.hardcodet.net
----------------------------------------------------------------------------
-1.0.1
+1.0.2 (2009.05.18)
+*****
+FIX Late-bound DataContext did not coerce properly with ContextMenu, thus
+ assigning it the TaskbarIcon rather than the TaskbarIcon's DataContext.
+ Thanks Nic Pillinger for discovering the issue.
+
+
+----------------------------------------------------------------------------
+
+1.0.1 (2009.05.15)
*****
CHG DataContext is also assigned to ContextMenu (thanks Nic Pilllinger),
and properly coerced for ToolTips and Popups. Also checks whether
diff --git a/Source/NotifyIconWpf/Properties/AssemblyInfo.cs b/Source/NotifyIconWpf/Properties/AssemblyInfo.cs
index e49731a..c6bb619 100644
--- a/Source/NotifyIconWpf/Properties/AssemblyInfo.cs
+++ b/Source/NotifyIconWpf/Properties/AssemblyInfo.cs
@@ -53,5 +53,5 @@ using System.Windows.Markup;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.1.0")]
-[assembly: AssemblyFileVersion("1.0.1.0")]
+[assembly: AssemblyVersion("1.0.2.0")]
+[assembly: AssemblyFileVersion("1.0.2.0")]
diff --git a/Source/NotifyIconWpf/TaskbarIcon.Declarations.cs b/Source/NotifyIconWpf/TaskbarIcon.Declarations.cs
index 60e7606..32d2996 100644
--- a/Source/NotifyIconWpf/TaskbarIcon.Declarations.cs
+++ b/Source/NotifyIconWpf/TaskbarIcon.Declarations.cs
@@ -568,7 +568,13 @@ namespace Hardcodet.Wpf.TaskbarNotification
///
private void UpdateDataContext(FrameworkElement target, object oldDataContextValue, object newDataContextValue)
{
- if (target != null && !target.IsDataContextDataBound() && Equals(oldDataContextValue, target.DataContext))
+ //if there is no target or it's data context is determined through a binding
+ //of its own, keep it
+ if (target == null || target.IsDataContextDataBound()) return;
+
+ //if the target's data context is the NotifyIcon's old DataContext or the NotifyIcon itself,
+ //update it
+ if (ReferenceEquals(this, target.DataContext) || Equals(oldDataContextValue, target.DataContext))
{
//assign own data context, if available. If there is no data
//context at all, assign NotifyIcon itself.
diff --git a/Source/Sample Project/Main.xaml b/Source/Sample Project/Main.xaml
index 410cb08..1a3ca52 100644
--- a/Source/Sample Project/Main.xaml
+++ b/Source/Sample Project/Main.xaml
@@ -31,7 +31,7 @@
FontStyle="Italic"
FontWeight="Bold"
TextWrapping="Wrap">
+ Text="WPF NotifyIcon 1.0.2 - Samples" />
-
-
+
+
-
+
diff --git a/Source/Sample Project/Main.xaml.cs b/Source/Sample Project/Main.xaml.cs
index be8700f..dddf7f7 100644
--- a/Source/Sample Project/Main.xaml.cs
+++ b/Source/Sample Project/Main.xaml.cs
@@ -1,17 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
+using System.Diagnostics;
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.Shapes;
-using Hardcodet.Wpf.TaskbarNotification;
using Samples.Tutorials;
using Samples.Tutorials.Balloons;
using Samples.Tutorials.Commands;
@@ -34,7 +22,6 @@ namespace Samples
}
-
///
/// Sets and
/// properties of a dialog that
@@ -109,6 +96,5 @@ namespace Samples
Process.Start(e.Uri.ToString());
e.Handled = true;
}
-
}
-}
+}
\ No newline at end of file
diff --git a/Source/Sample Project/Showcase/ShowcaseWindow.xaml b/Source/Sample Project/Showcase/ShowcaseWindow.xaml
index ce16da5..279f917 100644
--- a/Source/Sample Project/Showcase/ShowcaseWindow.xaml
+++ b/Source/Sample Project/Showcase/ShowcaseWindow.xaml
@@ -396,7 +396,7 @@
FontWeight="Bold"
FontSize="16"
HorizontalAlignment="Left">
+ Text="WPF NotifyIcon 1.0.2" />