Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Excerpt

This section explains how to extract module icon that is displayed as module button on module bar.

 

There could be several ways of extracting icons from Noah 3 (.dll) for 4 (.exe) modules. Here is how Noah 4 GUI (Module Bar) extracts icon from Modules:

BusinessSystemExternalControlsLibrary.Converters defines a Converter class named as

ModuleImageConverter, which is used to extract the module icon of size 115 * 33.


Here is the usage example:

Xaml code:

<Image Name="imgLogoDLLPath" Width="115" Height="35"/>


C# code:

BitmapImage bi3 = new BitmapImage();

bi3.BeginInit();

bi3.UriSource = new Uri(firstModule.LogoDLLPath, UriKind.Relative);

bi3.EndInit();

ModuleImageConverter imageConverter = new ModuleImageConverter();

imgLogoDLLPath.Source = (ImageSource) imageConverter.Convert(firstModule.LogoDLLPath, null,

null, null);


You can also directly bind the converter in XAML, First define the declaration at the top of xaml file.


xmlns:converters="clr-namespace:BusinessSystemExternalControlsLibrary.Converters"


Than define the image tag with and remember to pass bindings.

<Image Source="{Binding Path=Module.LogoDLLPath, Converter={StaticResource

ModuleImageConverter}}"/>



...