I have an docking control and adding panes dynamically. But "Loaded" events of the controls called twice. Am I doing something wrong ?
Here's the XAML:
Here's the code to add a pane:
Does this mean a control embedded in a RadPane loaded twice ?
Here's the XAML:
| <Telerik:RadDocking Grid.Row="1" Name="xamDockManager1"> |
| <Telerik:RadSplitContainer InitialPosition="DockedBottom"> |
| <Telerik:RadPaneGroup> |
| <Telerik:RadDocumentPane Header="Mesajlar" CanUserPin="True" CanFloat="False" CanUserClose="False" IsPinned="False" > |
| <TextBox Style="{StaticResource StyleTextBoxMessages}" AutoWordSelection="True" Name="TextBoxMessages" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="0" IsReadOnly="True"> |
| <TextBox.ContextMenu> |
| <ContextMenu Name="MenuItemMessages"> |
| <MenuItem Name="MenuItemMessagesClear" Click="MenuItemMessagesClear_Click" Header="Temizle"></MenuItem> |
| <MenuItem Name="MenuItemMessagesSave" Click="MenuItemMessagesSave_Click" Header="Kaydet"></MenuItem> |
| </ContextMenu> |
| </TextBox.ContextMenu> |
| </TextBox> |
| </Telerik:RadDocumentPane> |
| </Telerik:RadPaneGroup> |
| </Telerik:RadSplitContainer> |
| <Telerik:RadDocking.DocumentHost> |
| <Telerik:RadSplitContainer> |
| <Telerik:RadPaneGroup Name="documentPaneGroup" SelectionChanged="documentPaneGroup_SelectionChanged"> |
| </Telerik:RadPaneGroup> |
| </Telerik:RadSplitContainer> |
| </Telerik:RadDocking.DocumentHost> |
| </Telerik:RadDocking> |
Here's the code to add a pane:
| public RadPane AddPane(UserControl control, bool canBeClosed = true) |
| { |
| RadPane contentPane = new RadPane(); |
| contentPane.Content = control; |
| //contentPane.Header = control.Title; |
| contentPane.IsSelected = true; |
| contentPane.CanFloat = false; |
| contentPane.CanUserPin = false; |
| documentPaneGroup.AddItem(contentPane, Telerik.Windows.Controls.Docking.DockPosition.Center); |
| return contentPane; |
| } |
Does this mean a control embedded in a RadPane loaded twice ?