Diagram.panel.scale

It is possible to access a diagram.panel.scale from xaml?

Thanks.

I think so – are you having a problem?
But remember that the Diagram.Panel does not exist until after the Diagram’s ControlTemplate has been applied, so any data binding on any DiagramPanel property will fail until the Diagram.TemplateApplied event has fired.

I need to access to scale property. Now i have implemented by code. When i explore the properties from de xaml, i can’t find a scale or panel property.

I’m looking for in :
<go:Diagram x:Name=“uxdgm_Diagram” Padding=“5” Grid.Row=“0”
Grid.RowSpan=“2”
NodeTemplateDictionary="{StaticResource NodesDataTemplateDictionary}"
LinkTemplateDictionary="{StaticResource DiagramLinkDataTemplateDictionary}"
MaximumSelectionCount=“1”
VerticalContentAlignment=“Stretch”
HorizontalContentAlignment=“Stretch”
AllowDrop=“True”
GridVisible=“True” GridSnapEnabled=“True”
AllowGroup=“False” AllowCopy=“False” AllowClipboard=“False”
AllowPrint=“False”
InitialPosition=“0,0”>

Thanks

As Walter pointed out, you can only access the Panel after the Diagram’s ControlTemplate has been applied, so you probably want to set up your data binding similar to the following:



uxdgm_Diagram.TemplateApplied += (s, e) =>
{
System.Windows.Data.Binding b = new System.Windows.Data.Binding(“Scale”);
b.Source = myDiagram.Panel;
b.Mode = System.Windows.Data.BindingMode.TwoWay;
SliderZoom.SetBinding(Slider.ValueProperty, b);
};

The above binds Slider.Value to Diagram.Panel.Scale for the slider named SliderZoom (defined in XAML).

Thanks!!!