コード例 #1
0
 public void Dispose()
 {
     Host.Children.Remove(_control);
     HostedControl.ParentWindow = null; //need to release the ref
     HostedControl = null;
     _control      = null;
 }
コード例 #2
0
        public void ShowPopup(IHostedControl control, string title, bool moveable, bool animate)
        {
            _popupContainer = new PopupContainer(control, title);

            var          overlay       = new WindowOverlay(DockPanelMainWindow);
            AdornerLayer parentAdorner = AdornerLayer.GetAdornerLayer(DockPanelMainWindow);

            if (parentAdorner == null)
            {
                return;
            }

            parentAdorner.Add(overlay);

            _popupContainer.Owner = this;
            _popupContainer.AnimateToCenterOnSizeChanged = animate;

            _popupContainer.ShowDialog();
            _popupContainer.Close();
            parentAdorner.Remove(overlay);

            _popupContainer = null;
        }
コード例 #3
0
        //private ScrollViewer _scroll;

        /// <summary>
        /// Initializes a new instance of the <see cref="PopupContainer"/> class.
        /// </summary>
        /// <param name="hostedControl">The hosted control.</param>
        /// <param name="title">The title.</param>
        public PopupContainer(IHostedControl hostedControl, string title) : this()
        {
            HostedControl = hostedControl;
            HostedControl.ParentWindow = this;
            Title = title;
        }