I would like to dynamically change the font size of a particular instance of XamDataTree at run-time without creating new xaml style files. If I apply the Metro theme, then setting FontSize on the control is ignored.
I see other examples here in the forum where GetDescendantFromName() is used, but I'm not sure how to apply that to XamDataTree. Any suggestions?
Thanks,
Arthur
Hello Haimai,
I am just checking if you require any further assistance on the matter.
Hi Arthur,
Thank you for your reply. The described behavior is expected because the XamDataTree does not generate an instance for node which is not in View because of its virtualization. If this is your scenario, the best approach is to apply a style for the XamDataTreeNodeControl like e.g.:
<ig:XamDataTree.Resources>
<Style TargetType="ig:XamDataTreeNodeControl">
<Setter Property="FontSize" Value="20"/>
</Style>
</ig:XamDataTree.Resources>
Let me know, if you need any further assistance on this matter.
Thank you for the example. I want to set all nodes to a particular font size. However, the nodes that are off screen or not visible do not have a valid value for Control. Can you think of a workaround for that?
Hi Haimai,
Thank you for contacting us. I have been looking into your requirement and you could set the font size of the visual element of the node which is the XamDataTreeNodeControl. You access it like e.g.:
this.xamDataTree.Nodes[0].Control
I am attaching a sample application(DataTreeNodeFontSize.zip) that shows how to change the font size of the selected node.