节点不支持拖动操作
需要在C1OrgChart的Loaded事件中动态设置:
- public MainPage()
- {
- InitializeComponent();
-
- _orgChart.RenderTransform = new ScaleTransform();
- _orgChart.Loaded += new RoutedEventHandler(_orgChart_Loaded);
- }
- void _orgChart_Loaded(object sender, RoutedEventArgs e)
- {
- double scale = _orgChart.ActualWidth > 800.0? 800.0/_orgChart.ActualWidth:_orgChart.ActualWidth/800.0;
- (_orgChart.RenderTransform as ScaleTransform).ScaleX = scale;
- (_orgChart.RenderTransform as ScaleTransform).ScaleY = scale;
- }
复制代码
需要遍历_orgChart.ChildNodes节点进行查找 |