Esempio n. 1
0
 /// <summary>
 /// load our Resource file that contains styles and magic.
 /// </summary>
 /// <param name="filename"></param>
 /// <param name="control"></param>
 private void LoadResourceForWindow(string filename, UserControl control)
 {
     try
     {
         ResourceDictionary resource = WPF.LoadAndTransformXamlFile <ResourceDictionary>(filename);
         foreach (System.Collections.DictionaryEntry res in resource)
         {
             if (!control.Resources.Contains(res.Key))
             {
                 control.Resources.Add(res.Key, res.Value);
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Error("Error loading resources {0}", ex);
     }
 }