private void Initialize(bool force = false)
{
if (this.initializeCalled && !force)
{
return;
}
this.initializeCalled = true;
// create the taskbar icon (it's a resource declared in TaskbarIconResources.xaml
var resourceDictionary = new ResourceDictionary
{
Source =
new Uri(
"/TaskbarIconResources.xaml",
UriKind.Relative)
};
Current.Resources.MergedDictionaries.Add(resourceDictionary);
this.Taskbar = (TaskbarIcon)FindResource("TaskbarIcon");
}