title: Load image from not refrenced dll in wpf
body: <p>I working on application with wpf that it works with multi languages. users can put language dll in Languages folder and program load dynamically them. i want to show assembly name with country flag from it. i wrote this code but flage image not show in combobox. how can i do this?</p>
  
  <pre><code>        var assemblies = dir.GetFiles("*.dll", SearchOption.AllDirectories);
          //for each found .dll we will create a model and set its properties and then add to list
          for (int i = 0; i &lt; assemblies.Count(); i++)
          {
              var assemblyName = assemblies[i].Name.Substring(0, assemblies[i].Name.LastIndexOf("."));
              string packUri = string.Format("pack://application:,,,/{0};component/Image/flag.png", assemblyName);
              Uri uri = new Uri(packUri, UriKind.Absolute);
  
              BitmapImage image = new BitmapImage();
              image.BeginInit();
              image.CacheOption = BitmapCacheOption.OnLoad;
  
              try
              {
                  image.UriSource = uri;
                  image.EndInit();
  
              }
              catch (Exception ex)
              {
                  var m = ex.Message;
              }
  
              CultureAssemblyModel model = new CultureAssemblyModel()
              {
                  DisplayText = assemblies[i].Name.Split('.', '_')[2],
                  Culture = assemblies[i].Name.Split('.', '_')[1],
                  Name = assemblies[i].Name,
                  XamlFileName = assemblies[i].Name.Substring(0,                      assemblies[i].Name.LastIndexOf(".")) + ".xaml",FlagImage=image
              };
  </code></pre>