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

How to force control to initalize its control template and redraw?

$
0
0

I am working on a small custom control called MyControl and I wish the control to initalizes and redraws itself once IsExpanded set to TRUE but before I proceed to next step in my code.

MyControl containers an Expander and a Button. When Button clicked I set IsExpanded to true and in the next step I immediately try to find the TextBox which is inside Expander. But I cannot find it because MyControl is not up to date. When I click again I find the TextBox because then in the meanwhile the wpf had enough time to update everything.

So I wish to force MyControl when setting IsExpanded to true to init/load control template and redraw itself before I proceed to next step which is in my case finding the TextBox.

You can download my code here: https://github.com/devhedgehog/Examples

I hope somebody finds time to check this out and thanks in advance for ideas and solutions.



Viewing all articles
Browse latest Browse all 18858

Trending Articles