public void SwitchView(UserControl view)
{
Dispatcher.Invoke(
new Action<UserControl>(delegate(UserControl control)
{
if (PlaceHolder.Children.Count > 0)
{
UIElement element = PlaceHolder.Children[0];
if (element != null)
{
element.Visibility = Visibility.Collapsed;
PlaceHolder.Children.RemoveAt(0);
}
}
// view.Height = PlaceHolder.ActualHeight;
PlaceHolder.Children.Add(view);
})
, System.Windows.Threading.DispatcherPriority.Normal, view);
}