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
1855
picture associated with xamdatatree item
posted

I understand how to add pictures to nodes of my tree using this code.

       <ig:NodeLayout Key="sectionKey" TargetTypeName="Sections" IsDraggable="True" IsDropTarget="True"
                       CheckBoxMemberPath="IsChecked" DisplayMemberPath="SectionName">


                    <!--<ig:NodeLayout.CollapsedIconTemplate>
                        <DataTemplate>
                            <Image Source="my picture"  >
                        </DataTemplate>
                    </ig:NodeLayout.CollapsedIconTemplate>-->


                </ig:NodeLayout>

 

 

 

what i do not know how to do is dynamically add the pics at run time. i have chart items and graph items, each needs a different picture. Using the code above it only allows me to associate one picture with all items added to my xamdatatree. Any help would be appreciated, thanks in advance

Parents
No Data
Reply
  • 27093
    posted

    Hello petetataliba,

     

    I have been looking into your requirement and what I can suggest is use a DataTemplate like this one:

     

    ig:NodeLayout.ExpandedIconTemplate>

        <DataTemplate >

            <Image Height="32" Width="32"  Source="{Binding Path=Data.ExpandImage}"/>

        </DataTemplate>

    </ig:NodeLayout.ExpandedIconTemplate>

     

    And add a property to your underlying object of type string, or Uri, or BitmapImage called ExpandImage, which you can set dynamically.

     

    Please let me know if you require any further assistance on this matter.

Children