Hi
I'm trying to implement RadDocking using DockingPanesFactory as per your examples (like this one).
I have set the PaneSource to a collection of viewmodels e.g. MyViewModel which has a property "Name".
I would like to bind the RadPane header to the "Name" property on the viewmodel. Ideally I would like to have a custom DataTemplate as well but I will settle for just getting the value to update with the ViewModel.
The CreatePaneFromItem method states that "...set any of the DataContext, Header, Title or Content based on the item as well as Style with bindings in the style setters to bind properties of the item to properties of the RadPane" however nothing I've tried seems to work.
I've tried setting a style with the setter properties like this:
var pane = new RadPane();
pane.DataContext = (MyViewModel)item;
Style style = new Style();
style.TargetType = typeof(RadPane);
Setter setter = new Setter();
setter.Property = RadPane.HeaderProperty;
setter.Value = new Binding("Name")
pane.Style = style;
Ideally I'd like to define a DataTemplate in a ResourceDictionary and retrieve and set that to the pane header but I'm not sure how to get that resource in the DockingPanesFactory
Can you offer any advice?
Jason
Hi Stenly,
I think this is my last question.
Then I'll will finish my PoC with the Telerik WPF controls.
Now I still know that I have to build my application with the Telerik controls without the embedded XAML.
I have still a problem to run the Docking controls with PRISM 8 without the XAML libs.
With the XAML libs everything ist fine.
My demo projects:
1.) Prism 8 default solution from Brian Lagunas template pack extended by the Telerik solution of using Docking with Prism 7 (from Telerik SDK Samples Browser).
Samles is using the embedded XAML version.
=> Everything works fine
Please have a look at the attached image
2.) Prism 8 default solution from Brian Lagunas template pack extended by the Telerik solution of using Docking with Prism 7 (from Telerik SDK Samples Browser).
Samles isn't (!) the embedded XAML version.
=> The RadDocking header are missing.
Please have a look at the attached image
I think I'm still missing to set any style somewhere.
Thanks
Dirk
<
Window
x:Class
=
"DockingTest.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Width
=
"525"
Height
=
"350"
>
<
Window.Resources
>
<
Style
x:Key
=
"ContextMenuStyle"
TargetType
=
"telerik:RadContextMenu"
>
<
Setter
Property
=
"FontSize"
Value
=
"11"
/>
</
Style
>
<
telerik:RadContextMenu
x:Key
=
"contextMenuCode"
Style
=
"{StaticResource ContextMenuStyle}"
>
<
telerik:RadContextMenu.Items
>
<!-- Visibility of menu items is controlled by RadContextMenu_Opened -->
<
telerik:RadMenuItem
Header
=
"View/Edit Abstracts"
/>
<
telerik:RadMenuSeparatorItem
/>
<
telerik:RadMenuItem
Header
=
"Set Admitting"
/>
<
telerik:RadMenuItem
Header
=
"Set Principal"
/>
<
telerik:RadMenuSeparatorItem
/>
<
telerik:RadMenuItem
Header
=
"Move Code"
>
<
telerik:RadMenuItem
Header
=
"Move Down"
/>
<
telerik:RadMenuItem
Header
=
"Move Up"
/>
</
telerik:RadMenuItem
>
</
telerik:RadContextMenu.Items
>
</
telerik:RadContextMenu
>
</
Window.Resources
>
<
telerik:RadDocking
x:Name
=
"DockingControl"
Grid.Row
=
"1"
MaxWidth
=
"5000"
MaxHeight
=
"5000"
Background
=
"Transparent"
BorderThickness
=
"0"
telerik:AnimationManager.AnimationSelector
=
"{x:Null}"
telerik:AnimationManager.IsAnimationEnabled
=
"False"
telerik:RadContextMenu.ContextMenu
=
"{StaticResource contextMenuCode}"
>
<
telerik:RadDocking.DocumentHost
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
x:Name
=
"PaneGroup"
telerik:RadDocking.SerializationTag
=
"PaneGroup"
>
<
telerik:RadPane
CanFloat
=
"False"
CanUserClose
=
"False"
ContextMenuTemplate
=
"{x:Null}"
Header
=
"Document"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking.DocumentHost
>
<
telerik:RadSplitContainer
InitialPosition
=
"DockedLeft"
Orientation
=
"Horizontal"
telerik:DockingPanel.InitialSize
=
"200,10"
>
<
telerik:RadSplitContainer
InitialPosition
=
"DockedLeft"
Orientation
=
"Vertical"
telerik:DockingPanel.InitialSize
=
"200,10"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
CanDockInDocumentHost
=
"False"
CanFloat
=
"True"
CanUserClose
=
"False"
CanUserPin
=
"True"
ContextMenuTemplate
=
"{x:Null}"
Header
=
"Test"
IsPinned
=
"False"
>
<
telerik:RadGridView
x:Name
=
"Grid"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Temp1}"
Header
=
"Temp1"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Temp2}"
Header
=
"Temp2"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Temp3}"
Header
=
"Temp3"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Temp4}"
Header
=
"Temp4"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
</
Window
>
We have an application that uses the docking mechanism, and have started seeing an exception when dragging the tab for the RadDocumentPane. This is difficult to reproduce but usually happens before the 100th attempt to drag the window (often under 10 attempts). The stack trace doesn't have any of our code in it and I'm stuck trying to understand what the Telerik control is attempting to do. Some help understanding would be useful.
This only seems to happen when attached to a new control (the microsoft automatic graph layout one) that uses a canvas underneath, I'm tempted to wonder whether the resize event is racing with the drag, but I only have a casual model of the Telerik control to try understand what's happening. I'd really just be happy to catch the exception somehow so the user doesn't see it, it doesn't seem to impact any other behaviour
[10:37:52 ERR] Unhandled exception occurred
System.ArgumentNullException: Value cannot be null.
Parameter name: current
at System.Windows.LogicalTreeHelper.GetParent(DependencyObject current)
at Telerik.Windows.Controls.InternalWindow.DragBehavior.IsLogicalAncestorOf(DependencyObject ancestor, DependencyObject descendant)
at Telerik.Windows.Controls.InternalWindow.DragBehavior.TryBeginDrag()
at Telerik.Windows.Controls.InternalWindow.DragBehavior.OnElementMouseMove(Object sender, MouseEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Hi,
I have a question for the problem related radpane resources.
In my project, radpane contains content which has sometimes more than 300mb of RAM for each instance(composed of telerik controls, GroupView etc.), so I really need to dispose radpane resources.
I followed instructions after searching some references, and it said that I should call radpane.RemoveFromParent(); for it to be garbage collected.
However, it is not working. The resources still remains same after even afeter calling the method.
The problem arises when radpane content is user control with only managed resources, which to be collected by GC.
Here is my code.
<RadDock>
<RadPaneGroup>
new <radpane> is created each time..
</RadPaneGroup>
</RadDock>
When radpane is closed...
RadDock.CloseEvent += RaiseRadpaneCloseEvent();
RaiseRadpaneCloseEvent(object sender, eventargs e)
{
// small codes to call radpane.....
// here is radPane code.
if (radPane != null)
{
radPane.RemoveFromParent();
radPane.Content = null;
radPane.Header = null;
radPane.DataContext = null;
radPane.IsActive = false;
radPane.IsEnabled = false;
radPane = null;
}
// this works fine. When the content is UserControl
// only some control is Idisposable, put only when unmanaged resources exist inside control .
MethodInfo method = this.userControl.GetType().GetMethod("Dispose");
if (method == null) return;
method.Invoke(this.userControl, null);
}
Hope to get an answer quickly. Thanks.
Hi,
I have a WPF application that uses a RadGridView placed inside a RadPane. The RadGridView contains data that has fixed groups on multiple columns (groups are defined in XAML). The ItemsSource of the RadGridView is bound to an ObservableCollection so the UI gets updated as new data becomes available.
The grouping and display of data works as expected. However, as soon as I rearrange the RadPanel that contains the RadGridView all groups are removed an I'm left with a flat list. How can I regroup or keep the groups in the RadGridView after moving the RadPanel?
I have attached a sample project that demonstrates this behavior:
Hi,
I am using RadNavigationViewControl with RadDocking inside in the mainWindow, main view.
like this:
<RadNavigationView>
<RadNavigationView.Content>
<RadDocking>
<RadDocking.DocumentHost>
<RadPaneGroup Name=mainPaneGroup/>
</RadDocking.DocumentHost>
</RadDocking>
</RadNavigationView.Content>
</RadNavigationView>
When I open the new menu, new RadPane is Created inside RadPaneGroup, and I want it to be isFloatable and isDockable.
But the problem is that when I unload radpane, the radpane unloaded is not "Dockable" to any of control.
When I remove RadNavigationView and put RadDocking independently, RadDocking itself and contents inside work fine.
Is there a way to implement RadDocking inside RadNavigationView Content?
I have a activeX control added to WindowsFormsHost which in turn loaded inside a RadPane. Everything works fine, but once you make the Radpane float. then its empty. Am I missing some settings here?
Hi,
I have a RadDocking with a Document.host and 2 RadSplitcontainer. Every parts of control has its own Header and they are shown correctly, but with different style as you could see in figure:
I haven't seen any settings in xaml about the style and I would like to use everywhere the left style.
This is the DataTemplate used:
<DataTemplate x:Key="{x:Static r:ResourcesKeys.TabContentSpectral}" DataType="WpfPlot">
<t:ProportionalStackPanel Orientation="Vertical">
<t:RadToolBar t:ProportionalStackPanel.ElementHeight="32">
<t:RadButton Command="{Binding ResetCommand}"
ToolTip="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.ResetMapTooltip}}">
<Image Source="/DeltaOhm.NsModules;component/Images/refresh.png"
Style="{StaticResource ResourceKey=TreeviewImageSize}"/>
</t:RadButton>
<t:RadButton x:Name="ToolbarSetAxisScale"
ToolTip="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.MISetAxisScale}}"
Loaded="ToolbarSetAxisScale_Loaded">
<Image Source="/DeltaOhm.NsModules;component/Images/ToolbarSetAxisScale.png"
Style="{StaticResource ResourceKey=TreeviewImageSize}"/>
</t:RadButton>
<t:RadButton
ToolTip="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.ColorPaletteTooltip}}"
Loaded="RadPathButton_Loaded">
<Image Source="/DeltaOhm.NsModules;component/Images/ToolbarColorPalette.png"
Style="{StaticResource ResourceKey=TreeviewImageSize}"/>
</t:RadButton>
<t:RadButton
x:Name="SonogrammaMinimi"
ToolTip="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.SonogrammaDeiMinimiTooltip}}"
Command="{Binding CalcolaSpettroDeiMinimiCommand}">
<Image Source="/DeltaOhm.NsModules;component/Images/SonogrammaDeiMinimi.png"
Style="{StaticResource ResourceKey=TreeviewImageSize}"/>
</t:RadButton>
</t:RadToolBar>
<t:RadDocking x:Name="DockingSpectral"
RetainPaneSizeMode="DockingAndFloating">
<t:RadDocking.DocumentHost>
<t:RadPaneGroup x:Name="RadPaneGroup1">
<t:RadPane x:Name="PaneSpectralColorMap" t:RadDocking.SerializationTag="PaneSpectralColorMap"
Loaded="PaneSpectralColorMap_Loaded">
<Grid x:Name="Grid1">
<local:SpectralColorMapControl Loaded="SpectralColorMapControl_Loaded" TabIndex="0"
SizeChanged="SpectralColorMapControl_SizeChanged"/>
</Grid>
</t:RadPane>
</t:RadPaneGroup>
</t:RadDocking.DocumentHost>
<t:RadSplitContainer
x:Name="SpectralTimeHistory" InitialPosition="DockedBottom"
MinHeight="180">
<t:RadPaneGroup >
<t:RadPane x:Name="PaneSpectralTimeHistory" t:RadDocking.SerializationTag="PaneSpectralTimeHistory"
Loaded="PaneSpectralTimeHistory_Loaded">
<Grid>
<local:SpectralTimeHistoryControl TabIndex="1"
Loaded="SpectralTimeHistoryControl_Loaded"
Frequency="{Binding FrequencySelected, Mode=TwoWay}"/>
</Grid>
</t:RadPane>
</t:RadPaneGroup>
</t:RadSplitContainer>
<t:RadSplitContainer x:Name="SpectralHistogram" InitialPosition="DockedRight"
MinWidth="225">
<t:RadPaneGroup x:Name="RadPaneGroup2">
<t:RadPane x:Name="PaneSpectralHistogram" t:RadDocking.SerializationTag="PaneSpectralHistogram"
Loaded="PaneSpectralHistogram_Loaded">
<Grid x:Name="Grid2">
<local:SpectralHistogramControl x:Name="SpectralHistogramControl1"
Loaded="SpectralHistogramControl_Loaded"
TimeStamp="{Binding MainVM.TabCursori.CursorV0DT, Mode=TwoWay}"
Intervallo="{Binding MainVM.TabCursori.CursorRange}"/>
</Grid>
</t:RadPane>
</t:RadPaneGroup>
</t:RadSplitContainer>
</t:RadDocking>
</t:ProportionalStackPanel>
</DataTemplate>
And this is the code that binding the header (in code behind because "Plot" is a dynamic value)
private void PaneSpectralColorMap_Loaded(object sender, RoutedEventArgs e)
{
if (sender is RadPane pane)
{
pane.SetBinding(HeaderedContentControl.HeaderProperty, new Binding("Plot.SpectralColorMapVM.Title"));
}
}
private void PaneSpectralTimeHistory_Loaded(object sender, RoutedEventArgs e)
{
if (sender is RadPane pane)
{
pane.SetBinding(HeaderedContentControl.HeaderProperty, new Binding("Plot.SpectralProfileVM.Title"));
}
}
private void PaneSpectralHistogram_Loaded(object sender, RoutedEventArgs e)
{
if (sender is RadPane pane)
{
pane.SetBinding(HeaderedContentControl.HeaderProperty, new Binding("Plot.SpectralHistogramVM.Title"));
}
}
I've been working with the yWorks for WPF technology for a few years now and have a chance to compare it to the Telerik WPF Diagramming framework and API sets; in my mind, these are complex and advanced UI frameworks. However, getting started is a long learning curve in many areas of geometry, some trigonometric calculations, systems programming, and some advanced animations work. We are working to create the following technologies using the Diagramming frameworks:
I've been using yWorks - a fantastic technology and product, but expensive; it would be great if there was a better set of samples and tutorials around the dynamic use of the Diagramming APIs set for runtime capabilities. I think I've seen what guidance Telerik has made available to date; are there some additional resources available and what type of "professional services" might be available.
Tavi