예제 #1
0
        public void SuppressCloseEvent()
        {
            object container = DockTarget.GetDockContainer(this);

            if (container is Window)
            {
                (container as Window).Closed -= DockContent_Closed;
            }
            else if (container is DockedWindow)
            {
                (container as DockedWindow).Closed -= DockContent_Closed;
            }
        }
예제 #2
0
        public void Close()
        {
            object dockContainer = DockTarget.GetDockContainer(this);

            if (dockContainer is UndockedWindow)
            {
                ((UndockedWindow)dockContainer).Close();
            }
            else if (dockContainer is DockedWindow)
            {
                ((DockedWindow)dockContainer).Close();
            }
        }
예제 #3
0
        private void DockContent_Loaded(object sender, RoutedEventArgs e)
        {
            object container = DockTarget.GetDockContainer(this);

            if (container is Window)
            {
                Window window = container as Window;
                window.Closed -= DockContent_Closed;
                window.Closed += DockContent_Closed;
            }
            else if (container is DockedWindow)
            {
                DockedWindow docked = container as DockedWindow;
                docked.Closed -= DockContent_Closed;
                docked.Closed += DockContent_Closed;
            }
        }