Hi All
How can I keep a usercontrol alive and prevent the onloaded event to be called. I have make a simple example to let you know what I mean, this is only a test ;-)
private bool _first;
private readonly MyTest _test1 = new MyTest() {Height = 50, Width = 50, Background = Brushes.Green};
private readonly MyTest _test2 = new MyTest() { Height = 50, Width = 50, Background = Brushes.Blue };
private void Button_Click(object sender, RoutedEventArgs e)
{
root.Children.Clear();
root.Children.Add(_first ? _test2 : _test1);
_first = !_first;
}
My problem is in the real project I have a timer inside the u
View Complete Post