我制作了一个应用程序,它根据 xml 文件中的值绘制组织树。
xaml 文件如下所示:
<Window.Resources>
<!-- The Org Chart Data-->
<XmlDataProvider x:Key="organization" Source="model.xml" />
<SolidColorBrush x:Key="ListBorder" Color="#FF7F9DB9"/>
<!-- The Style for Nodes -->
<Style TargetType="{x:Type draw:Node}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Template">
---------------------------------------------------------
我希望能够通过从 openfiledialog 中选择一个 xml 文件(如单击按钮)在运行时更改源我该怎么做?