protected virtual DockableContentState GetDockWindowStateCore(DockWindow dockWindow)
        {
            DockingManager dockingManager = (Application.Current.MainWindow.Content as UserControl).FindName("DockManager") as DockingManager;

            if (dockingManager != null)
            {
                DockableContent dockableContent = dockingManager.DockableContents.FirstOrDefault(d => d.Content == dockWindow.Content);
                if (dockableContent != null)
                {
                    return(dockableContent.State);
                }
            }
            return(DockableContentState.None);
        }
        public static DockableContent ToDockableContent(DockWindow dockWindow)
        {
            DockableContent dockableContent = null;

            if (dockWindow != null && dockWindow.Content != null && dockWindow.Content.Parent is DockableContent)
            {
                dockableContent = dockWindow.Content.Parent as DockableContent;
            }
            else
            {
                dockableContent = new DockableContent();
            }
            dockableContent.Name = dockWindow.Name;
            SetDockableContentTitle(dockableContent, dockWindow.Title);
            dockableContent.Content      = dockWindow.Content;
            dockableContent.DockPosition = ConvertToDockPosition(dockWindow.Position);
            return(dockableContent);
        }
        protected virtual void ShowDockCore()
        {
            string newTitle = isEditable ? GisEditor.LanguageManager.GetStringResource("ViewDataEditDataTitle") : GisEditor.LanguageManager.GetStringResource("ViewDataViewDataTitle");

            if (!string.IsNullOrEmpty(title))
            {
                title = title.Replace("+", "_");
                title = title.Replace("/", "_");
                title = title.Replace("!", "_");
                title = title.Replace("@", "_");
                title = title.Replace("#", "_");
                title = title.Replace("$", "_");
                title = title.Replace("%", "_");
                title = title.Replace("^", "_");
                title = title.Replace("&", "_");
                title = title.Replace("*", "_");
                title = title.Replace("(", "_");
                title = title.Replace(")", "_");
                title = title.Replace("-", "_");
                title = title.Replace("=", "_");
                title = title.Replace("[", "_");
                title = title.Replace("{", "_");
                title = title.Replace("]", "_");
                title = title.Replace("}", "_");
                title = title.Replace("\\", "_");
                title = title.Replace("|", "_");
                title = title.Replace(";", "_");
                title = title.Replace(":", "_");
                title = title.Replace("'", "_");
                title = title.Replace("\"", "_");
                title = title.Replace(",", "_");
                title = title.Replace("<", "_");
                title = title.Replace(".", "_");
                title = title.Replace(">", "_");
                title = title.Replace("/", "_");
                title = title.Replace("?", "_");
                title = title.Replace("`", "_");
                title = title.Replace("~", "_");
                title = title.Replace("\r", "_");
                title = title.Replace("\n", "_");
                title = title.Replace("\r\n", "_");

                newTitle += " " + title;
            }
            else if (GisEditor.ActiveMap != null)
            {
                newTitle += " " + GisEditor.ActiveMap.Name;
            }

            var floatingSize = new Size(800, 600);

            if (Application.Current != null && Application.Current.MainWindow != null)
            {
                double floatingWidth  = Application.Current.MainWindow.ActualWidth - 100;
                double floatingHeight = Application.Current.MainWindow.ActualHeight - 100;
                if (floatingWidth < 800)
                {
                    floatingWidth = 800;
                }
                if (floatingHeight < 600)
                {
                    floatingHeight = 600;
                }

                floatingSize = new Size(floatingWidth, floatingHeight);
            }

            DockWindow newDockWindow = new DockWindow(this, DockWindowPosition.Bottom, newTitle);

            newDockWindow.FloatingSize = floatingSize;
            newDockWindow.Show(DockWindowPosition.Floating);
            this.isHighlightFeatureOnly = false;
        }
 /// <summary>
 /// Opens the dock window with specific position.
 /// </summary>
 /// <param name="dockWindow">The dock window.</param>
 /// <param name="dockWindowPosition">The dock window position.</param>
 public void OpenDockWindow(DockWindow dockWindow, DockWindowPosition dockWindowPosition)
 {
     OpenDockWindowCore(dockWindow, dockWindowPosition);
 }
 /// <summary>
 /// Opens the dock window.
 /// </summary>
 /// <param name="dockWindow">The dock window.</param>
 public void OpenDockWindow(DockWindow dockWindow)
 {
     OpenDockWindow(dockWindow, DockWindowPosition.Default);
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DockWindowOpenedDockWindowManagerEventArgs" /> class.
 /// </summary>
 /// <param name="dockWindow">The dock window.</param>
 /// <param name="dockWindowPosition">The dock window position.</param>
 public DockWindowOpenedDockWindowManagerEventArgs(DockWindow dockWindow, DockWindowPosition dockWindowPosition)
 {
     this.dockWindow         = dockWindow;
     this.DockWindowPosition = dockWindowPosition;
 }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DockWindowOpenedDockWindowManagerEventArgs" /> class.
 /// </summary>
 /// <param name="dockWindow">The dock window.</param>
 public DockWindowOpenedDockWindowManagerEventArgs(DockWindow dockWindow)
     : this(dockWindow, DockWindowPosition.Default)
 {
 }
 public DockableContentInfo(DockWindow dockableContent, DockWindowStartupMode dockWindowStartupMode)
 {
     this.DockWindow  = dockableContent;
     this.StartupMode = dockWindowStartupMode;
 }
 public DockableContentInfo(DockWindow dockWindow)
     : this(dockWindow, DockWindowStartupMode.Default)
 {
 }