ResourceDictionaryWriter Class |
Namespace: Ab2d.Utility.ReaderWmf
public class ResourceDictionaryWriter
The ResourceDictionaryWriter type exposes the following members.
Name | Description | |
---|---|---|
ResourceDictionaryWriter |
Constructor.
|
Name | Description | |
---|---|---|
GeometrySettings |
GeometrySettings that are used to read metafiles as geometries.
| |
UsedReaderWmf |
Ab2d.ReaderWmf instance that is used to read metafiles.
| |
XamlWriterSettings |
BaseXamlWriterSettings that is used for GetXaml method.
|
Name | Description | |
---|---|---|
AddFile |
Adds a metafile to the ResourceDictionary as WPF Shapes.
| |
AddGeometryFile |
Adds a metafile file to the ResourceDictionary as Geometry.
| |
AddGeometryStream |
Adds a metafile from stream to the ResourceDictionary as Geometry.
| |
AddStream |
Adds a metafile from stream to the ResourceDictionary as WPF Shapes.
| |
GetXaml |
Gets the xaml string of the ResourceDictionary with all added metafile objects as resources.
| |
Reset |
Resets the collected metafiles so a new ResourceDictionary can be created.
|
GeometrySettings settings = GeometrySettings.BasicOptimization; ResourceDictionaryWriter resourceWriter = new ResourceDictionaryWriter(); resourceWriter.AddGeometryFile("matafile1.wmf", settings); resourceWriter.AddGeometryFile("matafile2.wmf", settings); resourceWriter.AddGeometryFile("matafile3.wmf", settings); string xaml = resourceWriter.GetXaml();
The following code shows how to derive a class from ResourceDictionaryWriter to create a Silverlight ResourceDictionaryWriter with custom NumberFormatString.
public class SilverlightResourceDictionaryWriter : Ab2d.Utility.ReaderWmf.ResourceDictionaryWriter { protected override BaseXamlWriterSettings CreateXamlWriterSettings() { SilverlightXamlWriterSettings newSilverlightXamlWriterSettings; newSilverlightXamlWriterSettings = new SilverlightXamlWriterSettings(); // format decimal numbers to show only one decimal newSilverlightXamlWriterSettings.NumberFormatString = "0.#"; return newSilverlightXamlWriterSettings; } }