DECLINED: the issue is in the client's code. To reproduce: - add a dock with some windows - save the layout with this code: var stringWriter = new StringWriter(); radDock1.SaveToXml(stringWriter); savedLayoutString = stringWriter.ToString(); //with this line you can save the same stream to a file and observe that it is saved with UTF-16 - load the layout with the following code: using (var stream = new MemoryStream()) { var streamWriter = new StreamWriter(stream); streamWriter.Write(savedLayoutString); streamWriter.Flush(); stream.Position = 0; radDock1.LoadFromXml(stream); } Workaround - when reading the xml, replace utf-16 with utf-8 streamWriter.Write(File.ReadAllText("qqq.xml").Replace("utf-16", "utf-8"));
To reproduce: 1.Add a RadDock with a ToolWindow and a DocumentWindow. Add several controls to all windows. Use the following code: protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (System.IO.File.Exists(@"..\..\..\layoutTest.xml")) this.radDock1.LoadFromXml(@"..\..\..\layoutTest.xml"); } protected override void OnClosing(CancelEventArgs e) { this.radDock1.SaveToXml(@"..\..\..\layoutTest.xml"); base.OnClosing(e); } 2. Run the application and change the current layout. 3. Close the form and run the application again. The controls which belong to the RadDock's DocumentWindow disappear from the dialog. Workaround: class MyDock : RadDock { protected override void LoadFromXmlCore(System.Xml.XmlReader reader, bool oldXmlFormat) { //stop the base logic //base.LoadFromXmlCore(reader, oldXmlFormat); if (reader == null) { return; } this.ActiveWindow = null; FieldInfo prevActiveWindow = typeof(RadDock).GetField("prevActiveWindow", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField); prevActiveWindow.SetValue(this, null); //this.prevActiveWindow = null; FieldInfo attachedWindows = typeof(RadDock).GetField("attachedWindows", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); SortedList<string, DockWindow> _attachedWindows = attachedWindows.GetValue(this) as SortedList<string, DockWindow>; MethodInfo CleanAutoHideTabs = typeof(RadDock).GetMethod("CleanAutoHideTabs", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance); CleanAutoHideTabs.Invoke(this, new object[] { _attachedWindows.Values, true }); //this.CleanAutoHideTabs(this.attachedWindows.Values, true); MethodInfo ResetDesiredDockState = typeof(RadDock).GetMethod("ResetDesiredDockState", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance); ResetDesiredDockState.Invoke(this, null); //this.ResetDesiredDockState(); MethodInfo OnLoadingFromXML = this.DocumentManager.GetType().GetMethod("OnLoadingFromXML", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance); OnLoadingFromXML.Invoke(this.DocumentManager, null); //this.DocumentManager.OnLoadingFromXML(); if (oldXmlFormat) { this.BeginTransactionBlock(false); MethodInfo LoadFromOldXml = typeof(RadDock).GetMethod("LoadFromOldXml", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance); LoadFromOldXml.Invoke(this, new object[] {reader}); // this.LoadFromOldXml(reader); this.EndTransactionBlock(); } else { MethodInfo LoadFromNewXml = typeof(RadDock).GetMethod("LoadFromNewXml", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance); LoadFromNewXml.Invoke(this, new object[] { reader }); // this.LoadFromNewXml(reader); } this.EnsureInitialized(); this.OnLoadedFromXml(); } public override string ThemeClassName { get { return typeof(RadDock).FullName; } } }
To reproduce: - Add RadDock with couple of tool windows to a blank form - Subscribe to the ActiveWindowChanged event. - Run the application and close all windows in the dock. - You will notice that the despite that the ActiveWindow property is set to null the event is not fired.
To reproduce: Add a RadDock and two ToolWindows with many controls inside (~100). Drag out the one toolwindow and dock it back by dragging. Now drag it out again and dock it by clicking in its title bar and clicking Docked. You will notice that the second way is faster.
To reproduce: Add a RadDock and two ToolWindows. Drag the tool windows out and leave on on top of the RadDock, drag the other over the first tool window and you will notice drag hints from both - the RadDock and the ToolWindow
To reproduce: Add a RadDock to a Form, add two ToolWindows and dock them. Drag out one of the toolwindows to the edge of the other one until the drag hint is selected and continue dragging out of the form. You will notice that the drag hint is still selected.
To reproduce: Add RadDock and ToolWindow to the RadDock and dock it. Start the application and drag out the ToolWindow. You will notice that when you try to drag it back in the RadDock you are not able to.
To reproduce: 1.Add a RadDock with two ToolWindows, docked in a shared TabStrip. 2.Change the dock state of the first ToolWindow to "Floating". 3.Change the dock state of the second ToolWindow to "Autohide". 4.Save the layout. 5.Change the layout. 6.Load the layout. As a result both of the ToolWindow are autohidden.
To reproduce: add two ToolWindows and several DocumenWindows. Use the following code snippet: public Form1() { InitializeComponent(); this.toolWindow1.AutoHide(); this.toolWindow2.AutoHide(); while (this.documentTabStrip1.TabPanels.Count > 0) { documentTabStrip1.TabPanels.Remove(documentTabStrip1.TabPanels[0]); } TabPanel tabPanel = new TabPanel(); tabPanel.Text = @"New Tab"; documentTabStrip1.TabPanels.Add(tabPanel); } Run the application and hover one of the Autohidden ToolWindows. Workaround: do not add TabPanel. Use the desired DocumentWindow or ToolWindow instead
To reproduce: -add a RadDock with one ToolWindow; -add two RadButtons; Use the following code: const string Filename = "dock.xml"; public Form1() { InitializeComponent(); var positions = (DockPosition[])Enum.GetValues(typeof(DockPosition)); for (int i = 0; i < positions.Length; ++i) { RadButton btn = new RadButton(); btn.Text = "Steps" + (i + 1); var position = positions[i]; if (position == DockPosition.Fill) { radDock1.DockControl(btn, toolWindow1, position); } else { radDock1.DockControl(btn, position); } } } private void radButton1_Click(object sender, EventArgs e) { using (var stream = File.Create(Filename)) { radDock1.SaveToXml(stream); } } private void radButton2_Click(object sender, EventArgs e) { if (File.Exists(Filename)) { using (var stream = File.OpenRead(Filename)) { radDock1.LoadFromXml(stream); } } } Steps to reproduce: 1.Float the Steps1 window 2.Hide the Steps1 floating window 3.File --> Save Layout 4.File --> Load Layout 5.Note that the Steps1 window is docked where it was before it was floated 6.Click the Steps1 toggle button in the RadCommandBar 7.Note that the Steps1 window is floating in the correct position Workaround: private void radMenuItem3_Click(object sender, EventArgs e) { if (File.Exists(Filename)) { using (var stream = File.OpenRead(Filename)) { radDock1.LoadFromXml(stream); foreach (DockWindow window in this.radDock1.DockWindows.ToolWindows) { if (window.DockState == DockState.Hidden) { window.DockState = DockState.Docked; window.DockState = DockState.Hidden; } } } } }
To reproduce: Add a RadDock and a DockWindow, AutoHide it, add a RadPropertyGrid to its controls and dock it. Set the SelectedObject of the property grid to the current form and start the application. Edit the BackColor value and you will notice that the window will hide.
To reproduce: case #1 Dock a window to RadDock. Drag a window out of the Dock to make it floating. Check the FloatingWindowsCollection. Dock the window again, you will notice that the collection did not change. case #2 Have a RadDock with a docked ToolWindow. Undock the ToolWindow by double-clicking it and dock it back. Now undock it by dragging it. If you now check the FloatingWindows collection you will see that there are two windows with the same name. Resolution: The FloatingWindows property gets a list of the floating windows. Can contain duplicates, empty or hidden toolwindows which are used internally as re-dock targets. Use the ActiveFloatingWindows property instead of it.
To reproduce: -add a RadDock with several ToolWindows docked to one common container; -drag the container ouside the RadDock in order to create a FloatingForm, holding all of the ToolWindows; -close the FloatingForm via "X" button; -save the layout; -restart the application; -load the layout; -iterate through all of the ToolWindows and call their Show() method. Each ToolWindow is displayed in a separate FloatingForm; If you skip the step with restarting the application, all ToolWindows are shown in one common FloatingForm;
To reproduce: - add RadDock without document windows and five RadButtons with the following Click event handlers: private void radButton1_Click(object sender, EventArgs e) { this.radDock1.LoadFromXml(@"..\\..\\..\\layout1.xml"); } private void radButton2_Click(object sender, EventArgs e) { this.radDock1.LoadFromXml(@"..\\..\\..\\layout2.xml"); } //"Add" button private void radButton3_Click(object sender, EventArgs e) { this.documentContainer1.DockManager.AddDocument(new DocumentWindow(DateTime.Now.TimeOfDay.ToString())); } //Save layout 1 private void radButton4_Click(object sender, EventArgs e) { //add four document windows and save the layout 1 this.radDock1.SaveToXml(@"..\\..\\..\\layout1.xml"); } //Save layout 2 private void radButton5_Click(object sender, EventArgs e) { //add three document windows and save the layout 2 this.radDock1.SaveToXml(@"..\\..\\..\\layout2.xml"); } First add four document windows (via "Add" button click) and save layout 1 (via "Save layout 1" button click) on the RadDock and it creates 4 new Documents and save them in the xml. Restart the application and add three document windows (via "Add" button click) and save layout 2 (via "Save layout 2" button click). Load layout 1 (four document windows), then load layout 2. Everything is OK. But now load again layout 1. As a result ObjectDisposedException is thrown. Workaround: before loading the xml, remove all document windows: radDock1.RemoveAllDocumentWindows(); radDock1.LoadFromXml(@"..\\..\\..\\layout1.xml");
Add the ability to programatically show AutoHidden window
To reproduce: -add RadDock with several tabbed documents; -add four ToolWindows to each side: left, top, right, bottom; Use the following code: public Form1() { InitializeComponent(); toolWindow1.DockState = Telerik.WinControls.UI.Docking.DockState.AutoHide; toolWindow2.DockState = Telerik.WinControls.UI.Docking.DockState.AutoHide; toolWindow3.DockState = Telerik.WinControls.UI.Docking.DockState.AutoHide; toolWindow4.DockState = Telerik.WinControls.UI.Docking.DockState.AutoHide; toolWindow1.AutoHide(); toolWindow2.AutoHide(); toolWindow3.AutoHide(); toolWindow4.AutoHide(); } When you run the project, you will notice that all of the ToolWindows are auto hidden and positioned to the left side which is wrong. Some other wrong behavior is when you try to dock again some of the ToolWindows after that, all of them are docked back to their initial positions. Workaround: instead of using AutoHide() method, use the following code: Type type = this.radDock1.GetType(); MethodInfo methodInfo = type.GetMethod("CloseAutoHidePopup", BindingFlags.Instance | BindingFlags.NonPublic); methodInfo.Invoke(this.radDock1, null);
To reproduce: Add RadDock to a form. Add a few DocumentWindows. Drag a tab among the other tabs and you will see how the cursor is a different, that is normal. Drag a tab to the content area of the document window and you will see the docking guides. Now if you drag the tab again over the other tabs you will see that the docking guides are still visible and the cursor is not changing (except if you drag outside of the dock). Resolution: 1. Inherit RadPageViewInDockDragDropService and override the UpdateCursor virtual method. class MyDragDropService : RadPageViewInDockDragDropService { RadPageViewElement owner; public MyDragDropService(RadPageViewElement owner) : base(owner) { this.owner = owner; } protected override void UpdateCursor(Point mousePos) { RadPageViewStripElement stripElement = this.owner as RadPageViewStripElement; if (stripElement == null) { return; } if (!this.processing) { //Cursor.Current = Cursors.Default; return; } Point mousePt = Control.MousePosition; if (this.owner.IsInValidState(true)) { mousePt = this.owner.ElementTree.Control.PointToClient(mousePt); } else { mousePt = mousePos; } if (!stripElement.ItemContainer.ControlBoundingRectangle.Contains(mousePt)) { Cursor.Current = Cursors.Default; base.HintWindow.BackgroundImage = null; base.HintWindow.Hide(); this.processing = false; } } } 2. Change the nested PageView in RadDock public Form2() { InitializeComponent(); radDock1.GetService<DragDropService>().Starting += (sender, args) => { if ((sender as DragDropService).DragDropContext == DragDropContext.DocumentWindow) { args.Cancel = true; } }; foreach (Control child in ControlHelper.EnumChildControls(this.radDock1, true)) { DocumentTabStrip docStrip = child as DocumentTabStrip; if (docStrip != null) { RadPageViewElement pageViewElement = docStrip.TabStripElement; pageViewElement.ItemDragService = new MyDragDropService(pageViewElement); } } }
To reproduce: - Add 2 DockWindows and dock it Add about 10 controls in one of the windows. AutoHide them and show them one after another, you will notice that the old one is visible somewhere in the middle of the animation. - Also you will notice that AutoHideWindowDisplayed and AutoHideWindowDisplaying events are fired twice.
Add the ability to easily turn on/off the DockingGuides
To reproduce: -add a RadDock with a ToolWindow -add some controls inside the ToolWindow and anchor them to Left, Bottom, Right -use RadDock Advanced layout designer to set the ToolWindow as unpinned. -run the project and notice that when showing the ToolWindow its child controls are not positioned correctly (compared to at design time). Workaround: use RadPanel docked to the ToolWindow as parent container and position all anchored controls inside it