Useful Tip: Solution for known issue with Merged Dictionaries in App.xaml (VS 2010 RTM)

יום שישי, אפריל 23, 2010

At last days many .Net developers upgraded their Visual Studio to RTM 2010. There are some “Known Issues” in this release.After painful upgrade we discovered problem in our WPF project: Some Dynamic Resources from Merged Dictionaries that referenced in App.xaml stopped working (although this code worked without any problems in Beta-2).We found some workaround: Add some style without specific key for unused element in Resource Dictionary and this will trigger WPF to load resources from Merged Dictionaries. Example: <Application x:Class="SomeNamespace.App"              xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">       <Application.Resources>             <ResourceDictionary>                   <ResourceDictionary.MergedDictionaries>                         <ResourceDictionary Source="/SomeNamespace;Component/Styles.xaml"/>                         <ResourceDictionary Source="/SomeNamespace;Component/Brushes.xaml"/>                   </ResourceDictionary.MergedDictionaries>                                 <Style TargetType="{x:Type Line}"/>...

Single Instance Application Manager

יום שבת, פברואר 13, 2010

Some .Net applications are required to run as single instance process (at startup, each process “ensures” that he’s unique). This requirement may come from licensing issues, technical and/or other reasons. Quick search in Google will provide a variety of solutions, most of them are based on WindowsFormsApplicationBase object from VB.Net, usage of Mutex object and other techniques. I don’t like mixing VB with C#, and also Win-Forms solution isn’t “pure” enough for WPF applications. So I wrote my version of “Single Instance Manager”… This post will provide short description about this small project and links to download the...