我正在尝试创建一个类似于此here
的图表我有这样的xaml代码:
<Border Grid.Row="1" Margin="0 4 0 0" Background="White" BorderBrush="#FFD6D4D4" BorderThickness="0 0 1 1">
<Grid>
<Border BorderThickness="1 1 0 0" BorderBrush="#D6D6D6" />
<telerik:RadDiagram x:Name="diagram" GraphSource="{Binding GraphSource}"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollBarVisibility="Visible"
Zoom="{Binding ZoomFactor, Mode=TwoWay, Source={StaticResource repGpDataInstance}}" Height="800" />
</Grid>
</Border>
在我的代码中,我执行以下操作:(在初始化组件之后......等)
this.treeLayout.Layout(this.diagram, mymodel.ChildTreeLayoutViewModel.CurrentLayoutSettings);
然而,即使将布局类型设置为TreeDown,我也将所有节点放在彼此之上,而我看不到树结构。我怎么能以正确的方式做到这一点?我需要通过ObservableCollection<Object>
答案 0 :(得分:1)
基本上,您有两种选择来解决此类问题:
Dispatcher.BeginInvoke(()=&gt; this.treeLayout.Layout(...)