Class SvgViewbox
- Namespace
- SharpVectors.Converters
- Assembly
- SharpVectors.Converters.Wpf.dll
This is a Viewbox control for viewing SVG
file in WPF
applications.
public class SvgViewbox : Viewbox, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, ISvgControl, IUriContext
- Inheritance
-
SvgViewbox
- Implements
- Inherited Members
Remarks
It wraps the drawing canvas, SvgDrawingCanvas, instead of image control, therefore any interactivity support implemented in the drawing canvas will be available in the Viewbox.
Constructors
- SvgViewbox()
Initializes a new instance of the SvgViewbox class.
Fields
- AppNameProperty
The DependencyProperty for the
AppName
property.
- MessageBackgroundProperty
The DependencyProperty for the MessageBackground property.
Flags: Can be used in style rules
Default Value: PapayaWhip
- MessageFillBrushProperty
The DependencyProperty for the MessageFillBrush property.
Flags: Can be used in style rules
Default Value: Gold
- MessageFontFamilyProperty
The DependencyProperty for the MessageFontFamily property.
Flags: Can be used in style rules
Default Value: System Dialog Font
- MessageFontSizeProperty
The DependencyProperty for the MessageFontSize property.
Flags: Can be used in style rules
Default Value: 48 pixels
- MessageOpacityProperty
The DependencyProperty for the MessageOpacity property.
Flags: Can be used in style rules
Default Value: 1 (full opacity)
- MessageStrokeBrushProperty
The DependencyProperty for the MessageStrokeBrush property.
Flags: Can be used in style rules
Default Value: Maroon
- MessageTextProperty
The DependencyProperty for the MessageText property.
Flags: Can be used in style rules
Default Value: "Loading..."
- SourceProperty
Identifies the Source dependency property.
- StreamSourceProperty
Identifies the StreamSource dependency property.
- SvgSourceProperty
Identifies the SvgSource dependency property.
- UriSourceProperty
Identifies the UriSource dependency property.
Properties
- AppName
Gets or sets the
name
of the parent assembly for this element.
- AppTitle
Gets or sets the application title, which is used to display the alert and error messages not handled by the user.
- AutoSize
Gets or sets a value indicating whether to automatically resize this Viewbox based on the size of the loaded drawing.
- BaseUri
Gets or sets the base URI of the current application context.
- CultureInfo
Gets or sets the main culture information used for rendering texts.
- DesignMode
Gets a value specifying whether the viewer control is in design-mode.
- DrawingCanvas
Gets the drawing canvas, which is the child of this Viewbox.
- Drawings
Gets the drawing from the SVG file conversion.
- EnsureViewboxPosition
Gets or sets a value to indicate applying a translate transform to the viewbox to ensure it is visible when rendered.
- EnsureViewboxSize
Gets or sets a value to indicate preserving the original viewbox size when saving images.
- IgnoreRootViewbox
Gets or sets a value to indicate turning off viewbox at the root of the drawing.
- IncludeRuntime
Gets or sets a value indicating whether the
SharpVectors.Runtime.dll
classes are used in the generated output.
- InteractiveMode
Gets or sets a value specifying the interactive mode, which controls the level of information attached to the generated drawing.
- MessageBackground
Gets or sets a brush that describes the background of a message text.
- MessageFillBrush
Gets or sets the brush with which to fill the message text. This is optional, and can be null. If the brush is null, no fill is drawn.
- MessageFontFamily
Gets or sets the font family of the desired font for the message text.
- MessageFontSize
Gets or sets the size of the desired font for the message text.
- MessageOpacity
Gets or sets the opacity factor applied to the entire message text when it is rendered in the user interface (UI).
- MessageStrokeBrush
Gets or sets the brush of the Pen with which to stroke the message text. This is optional, and can be null. If the brush is null, no stroke is drawn.
- MessageText
Gets or sets the content of the message.
- OptimizePath
Gets or sets a value indicating whether the path geometry is optimized using the StreamGeometry.
- StreamSource
Gets or sets the Stream to the SVG source to load into this Viewbox.
- TextAsGeometry
Gets or sets a value indicating whether the texts are rendered as path geometry.
Methods
- CreateDrawing()
Performs the conversion of a valid SVG source to the DrawingGroup.
- CreateDrawing(Stream, WpfDrawingSettings)
Performs the conversion of a valid SVG source stream to the DrawingGroup.
- CreateDrawing(string, WpfDrawingSettings)
Performs the conversion of a valid SVG source stream to the DrawingGroup.
- CreateDrawing(Uri, WpfDrawingSettings)
Performs the conversion of a valid SVG source file to the DrawingGroup.
- GetDrawingSettings()
Gets the rendering settings or options to be used in rendering the SVG in this control.
- Load(Stream, bool, bool)
This sets the source SVG for a SvgViewbox by accessing a stream and optionally processing the result asynchronously.
- Load(string, bool)
This sets the source SVG for a SvgViewbox by accessing text contents and optionally processing the result asynchronously.
- Load(Uri, bool)
This sets the source SVG for a SvgViewbox by using the supplied Uniform Resource Identifier (URI) and optionally processing the result asynchronously.
- LoadAsync(Stream, bool)
This sets the source SVG for a SvgViewbox by accessing a stream and processing the result asynchronously.
- LoadAsync(string)
This sets the source SVG for a SvgViewbox by accessing text contents and processing the result asynchronously.
- LoadAsync(Uri)
This sets the source SVG for a SvgViewbox by using the supplied Uniform Resource Identifier (URI) and processing the result asynchronously.
- OnAutoSizeChanged()
This handles changes in the automatic resizing property of this control.
- OnInitialized(EventArgs)
Raises the Initialized event. This method is invoked whenever IsInitialized is set to true.
- OnSettingsChanged()
This handles changes in the rendering settings of this control.
- Unload(bool, string)
This clears the SvgViewbox of any drawn diagram and optionally displays a message.
Events
- Alert
This event occurs when an alert message needs to be displayed.
- Error
This event occurs when an error message needs to be displayed.