Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Which event should i subscribe to know when an object's corresponding DataTemplate is added to visual tree?

$
0
0

Hi,

I have a ContentControl and it's Content property is set to regular objects (not UI elements). These objects are visualized/realized by DataTemplates with their corresponding DataType properties specified.

As expected, this ContentControl switches to different DataTemplate when the Content's property changes. My question here is how do we know when the DataTemplate is loaded? Given that I do not have access to the DataTemplate, so I can't put a loaded event on the DataTemplate.

I need to do some logic on the UI when the Content changes and after the DataTemplate is added to the visual tree.

Thanks


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>