Hi,telerik.
Here is a problem of the Docking Loadlayout.
First, click the "Add New Item" button add some panel.
Second,click the "Save Layout".At this time,click "Add New Item" button can add a panel to Docking.
Now, click the "Load Layout" button,then click the "Add New Panel" button,there is no panel added to the Docking...
Oh,the Title should be:"Can't Add a new RadPane to Docking After LoadLayout"
Here is the xaml
And here is the cs code
Here is a problem of the Docking Loadlayout.
First, click the "Add New Item" button add some panel.
Second,click the "Save Layout".At this time,click "Add New Item" button can add a panel to Docking.
Now, click the "Load Layout" button,then click the "Add New Panel" button,there is no panel added to the Docking...
Oh,the Title should be:"Can't Add a new RadPane to Docking After LoadLayout"
Here is the xaml
<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="ISSUE.MainWindow" Title="MainWindow" Height="526" Width="762"> <Grid Background="{Binding Background,ElementName=Docking}"> <Grid.RowDefinitions> <RowDefinition Height="90" /> <RowDefinition Height="288*" /> </Grid.RowDefinitions> <telerik:RadDocking HasDocumentHost="True" Name="Docking" Grid.Row="2" > <!--DocumentHost--> <telerik:RadDocking.DocumentHost> <telerik:RadSplitContainer> <telerik:RadPaneGroup x:Name="GroupDocument"> </telerik:RadPaneGroup> </telerik:RadSplitContainer> </telerik:RadDocking.DocumentHost> <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="260,260" MaxWidth="400" Name="LeftContainer" InitialPosition="DockedLeft"> <telerik:RadPaneGroup x:Name="GroupLeft"> <telerik:RadPane Header="Test" telerik:RadDocking.SerializationTag="MENU" CanUserClose="False" /> </telerik:RadPaneGroup> </telerik:RadSplitContainer> <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="200,200" MaxWidth="400" x:Name="RightContainer" InitialPosition="DockedRight"> <telerik:RadPaneGroup x:Name="GroupRight"> </telerik:RadPaneGroup> </telerik:RadSplitContainer> <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="200,200" x:Name="BottomContainer" InitialPosition="DockedBottom"> <telerik:RadPaneGroup x:Name="GroupBottom"> <telerik:RadPane Header="Output" telerik:RadDocking.SerializationTag="OUTPUT" CanUserClose="False" /> </telerik:RadPaneGroup> </telerik:RadSplitContainer> </telerik:RadDocking> <Button Content="Load Layout" Height="64" HorizontalAlignment="Left" Margin="196,12,0,0" Name="button1" VerticalAlignment="Top" Width="178" Click="button1_Click" /> <telerik:RadButton Content="Add New Panel" Grid.Row="1" Height="49" HorizontalAlignment="Left" Margin="12,33,0,0" Name="radButton1" VerticalAlignment="Top" Width="107" Click="radButton1_Click" /> <Button Content="Save Layout" Height="64" HorizontalAlignment="Left" Margin="12,12,0,0" Name="button2" VerticalAlignment="Top" Width="178" Click="button2_Click" /> </Grid> </Window> And here is the cs code
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Telerik.Windows.Controls; using System.IO; namespace ISSUE { /// <summary> /// MainWindow.xaml 的交互逻辑 /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void radButton1_Click(object sender, RoutedEventArgs e) { RadPane rp = new RadPane(); rp.Header = DateTime.Now.ToString("yyyyMMddHHmmssfff"); rp.Title = rp.Header; RadDocking.SetSerializationTag(rp, rp.Header.ToString()); this.GroupDocument.Items.Add(rp); } string layout = string.Empty; private string SaveLayoutAsString() { MemoryStream stream = new MemoryStream(); this.Docking.SaveLayout(stream); stream.Seek(0, SeekOrigin.Begin); StreamReader reader = new StreamReader(stream); return reader.ReadToEnd(); } private void LoadLayoutFromString(string xml) { using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml))) { stream.Seek(0, SeekOrigin.Begin); this.Docking.LoadLayout(stream); } } private void button1_Click(object sender, RoutedEventArgs e) { LoadLayoutFromString(layout); } private void button2_Click(object sender, RoutedEventArgs e) { layout = SaveLayoutAsString(); } } }