GraphZoomAndScaleControl in WPF app

Oct 7, 2013 at 6:06 PM

First, thanks for the work your team has put into this control. It's well-done, easy-to-modify, and straightforward to use.

I've been trying to the NodeXL GraphZoomAndScaleControl in a WPF app by instantiating the control in XAML with a WindowsFormHost:
    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        <nodexl:NodeXLControl x:Name="LinkGraph" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
        <WindowsFormsHost Grid.Row="1" Height="28">
            <nodeutil:GraphZoomAndScaleControl x:Name="ZoomScale" Anchor="Left" Visible="True"/>
In my code-behind, I initialize the ZoomAndScale control with:
this.ZoomScale.NodeXLControl = this.LinkGraph;
The graph displays just fine but I can't seem to get the zoom and scale control to display.

Is it possible to use this control in WPF? Did I miss something really obvious?

Thanks far any help.

Oct 8, 2013 at 6:42 AM

I've never tried that myself, but I don't know of any reason why it wouldn't work. Have you tried any debugging yet? For example, if you substitute a WPF TextBox for the GraphZoomAndScaleControl, does the TextBox show up properly in your Grid? That would help determine whether it's a GraphZoomAndScaleControl problem or a general layout problem.

-- Tony
Oct 8, 2013 at 2:18 PM
Thanks for your really quick reply Tony.

The problem appears to be related to the fact that I'm using Caliburn.Micro as an MVVM framework (which I didn't show in my code snippet because it would have confused matters), so I've relented and created my own scale and zoom controls directly in WPF. Not a really hard thing to do at all.