Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
How to not use datacontext XamorgChart
posted

hello

here is my xaml 

<ig:XamOrgChart ItemsSource="{Binding SelectProClass}" DisplayMemberPath="Name">
       <ig:XamOrgChart.GlobalNodeLayouts>
              <ig:OrgChartNodeLayout Key="ProtocolClasses" TargetTypeName="ProtocolModel" DisplayMemberPath="Name">
                       <ig:OrgChartNodeLayout.ItemTemplate>
                             <DataTemplate>
                                    <TextBlock Text="{Binding Data.Name}"/>
                              </DataTemplate>
                        </ig:OrgChartNodeLayout.ItemTemplate>
             </ig:OrgChartNodeLayout>
     </ig:XamOrgChart.GlobalNodeLayouts>
</ig:XamOrgChart>

Binding Class is ObservableCollection<ProtocolClass> SelectProClass

but I can't see anything

Maybe it's because I'm not using datacontext.

However, because my viewmodel uses prism mvvm , it cannot be used as a data context.

Is there any way to do binding without using this?

                                         ↓

<ig:XamOrgChart.DataContext>

            <data:DepartmentViewModel />

</ig:XamOrgChart.DataContext>

  • 7555
    Verified Answer
    Offline posted

    Hello Kim,

    Thank you for your post. You have to bind the chant though the DataContext , this is how controls are designed to do binding .

    Here is our online help document of XamOrgChart if you want to have a look.