I am trying to load few ContentPanels @ runtime. SelectTemplate is firing only for the first Panel.
How can I fire SelectTemplate for all added Panels?. I want to load all Panels content when they are added.
Attached file has sample code I am using.
To Reproduce the issue:
1. Copy the MainWindow.xaml code to MainWindow.xaml file and MainWindow.xaml.cs code to MainWindow.xaml.cs file
2. Copy UserControl1.xaml code to UserControl1.xaml.cs file.
3. Put a break point in SelectTemplate method.
4. Run the code
5. SelectTemplate fires only one time for first Panel.
6. If you click on Second Panel, then it is firing SelectTemplate for the second one.
7. I want SelectTemplate to be fired for all added Panels.
Thanks
Is this possible?
Hello options007,
Thank you for your post!
I have been looking into it. Using the code snippets you have provided I have created a small sample application to test the behavior you have mentioned.
After been further researching this behavior and it is the expected behavior for the DataTempletaSelector. Every time you navigate through the panes, the content of the pane might change and the template selector is fires, in order to change the template according to the data, that is in the pane.
Please do not hesitate to let me know if you have any further questions on this matter.