Versions Compared

Key

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

...

The DrawingImageSourceFromResource method takes the path to a xaml-defined vector image file and the key of the image within that file. If you return a value from DeviceImage, it will take precedence over the DeviceImageSource property.

Custom Resource Dictionaries

In 16.1R3 and higher, you can add your own resource dictionaries to the main application styles dictionary. If you’ve created an assembly containing a shared resource dictionary (ie, the styles are defined in a different assembly), you must use a specific overload in your UI constructor.

Typically your UI constructor uses the XamlInitializer.Initialize(this) call. Instead, use the overload with the following signature: XamlInitializer.Initialize(this, typeof(your_resource_dictionary), Func<your_resource_dictionary>);

Code Block
languagec#
        public MyDeviceUi()
        {
            XamlInitializer.Initialize(this,
                                       typeof(my_resource_dictionary),
                                       () => new my_resource_dictionary());
        }

        public MyDeviceUi(MyDeviceConfiguration config, IDeviceUIParams deviceUIParams) : this()
        {
            ...
        }