BlipFace.HostWindow.SwitchView C# (CSharp) Method

SwitchView() public method

public SwitchView ( System.Windows.Controls.UserControl view ) : void
view System.Windows.Controls.UserControl
return void
        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);
        }