Binding a Viewport to ZoomPanel
#1
Hello

I want to show a customized svg in a ZoomPanel with a customized Viewport, while having a clean MVVM pattern.

I'm currently loading an svg in the ViewModel like so: 
Code:
var readerSvg = new Ab2d.ReaderSvg();
svgViewbox = readerSvg.Read(svgFilePath);

This gives me a System.Windows.Controls.Viewbox, which I need to loop through its Children to find customize certain parts of the SVG. This works perfectly.

After that, I could add the svgViewbox to a ZoomPanel, via the Content-Tag:

Code:
<ab2d:ZoomPanel x:Name="MyZoomPanel" Content="{Binding SvgViewbox}" />


But
 then how to set a Viewport in the form of a Rect?
Code:
Rect rectViewport = new Rect(xFactor, yFactor, widthFactor, heightFactor)

I already know the method SetViewboxNow(rectViewport);
But i want to bind this rectViewport in XAML, to stay true to MVVM pattern.
Thanks in advance.
  


Forum Jump:


Users browsing this thread:
2 Guest(s)