23 Answers, 1 is accepted
The desired by you functionality is not support by RadDocking out of the box. However, based on your provided description what we could suggest you is to consider using out RadTileView control. It provides the desired minimizing and maximizing functionality out of the box - that we believe will suit your requirement.
You could check the control in action from our Silverlight demos (they are the same for WPF):
http://demos.telerik.com/silverlight/#TileView/FirstLook
Hope this helps.
Regards,
Nasko
Telerik by Progress
The provided image has been deleted as requested.
If you have any additional questions or concerns regarding Telerik controls, please do not hesitate to contact us.
Regards,
Nasko
Telerik by Progress
I have RadPains in RadDocking as Prism regions. Please see below:
<
telerik:RadDocking
Grid.Row
=
"1"
Grid.Column
=
"0"
x:Name
=
"Docking"
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Скорость газа усреднённая"
prism:RegionManager.RegionName
=
"GasVelocityChartRegion"
IsHidden
=
"{Binding IsGasVelocityChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Скорость звука усреднённая"
prism:RegionManager.RegionName
=
"SoundVelocityChartRegion"
IsHidden
=
"{Binding IsSoundVelocityChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Объёмный расход при рабочих условиях"
prism:RegionManager.RegionName
=
"VolumeFlowRateAtWorkingRegion"
IsHidden
=
"{Binding IsWorkingVolumeFlowRateChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Объёмный расход при стандартных условиях"
prism:RegionManager.RegionName
=
"VolumeFlowRateAtStandartRegion"
IsHidden
=
"{Binding IsStandartVolumeFlowRateChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Скорость звука по каждому лучу"
prism:RegionManager.RegionName
=
"SoundVelocityPerBeamChartRegion"
IsHidden
=
"{Binding IsSoundVelocityPerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Скорость газа по каждому лучу"
prism:RegionManager.RegionName
=
"GasVelocityPerBeamChartRegion"
IsHidden
=
"{Binding IsGasVelocityPerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Коэффициент усиления по каждому лучу (AGC)"
prism:RegionManager.RegionName
=
"AGCPerBeamChartRegion"
IsHidden
=
"{Binding IsAGCPerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Отношение 'Сигнал/Шум' по каждому лучу (SNR)"
prism:RegionManager.RegionName
=
"SNRPerBeamChartRegion"
IsHidden
=
"{Binding IsSNRPerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Относительная турбулентность по каждому лучу"
prism:RegionManager.RegionName
=
"RelativeTurbulencePerBeamRegion"
IsHidden
=
"{Binding IsRelativeTurbulencePerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Производительность по каждому лучу"
prism:RegionManager.RegionName
=
"PerformancePerBeamRegion"
IsHidden
=
"{Binding IsPerformancePerBeamChartHiden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
So each Radpain is Prism region where specified chart view is. Can I do this way with RadTileView? Nasko, be a friend please, give me a similar example with RadTileView if possible.
The approach you have found in the forum post describes how to add Maximize and Restore buttons both when RadPane is floating and it is docked, but does not provide the described by you functionality of zooming in and out of the Panes. Also as stated in the forum post the provided approach for restoring the docked Pane might not work in same cases - as this is not a functionality provided out of the box but a custom implementation we could not guarantee you that it will work in all desired scenarios.
I am attaching the sample from the post for WPF. Please. check it and let us know if that works for you or we should continue with the approach of the TileView and try to provide you with an example of Prism.
Hope this helps.
Regards,
Nasko
Telerik by Progress
Hello, Nasko. I've tryed to use this approach (Maximize and Restore buttons) in my Prism modular application and it works. I've located 'MaximizeExtensions' class in common class library accessable from all modules and also from Shell project. I've located template for the button in ResourceDictionary in 'App.xaml' class in Shell project (please see below):
<
Application
x:Class
=
"FlowmeterConfigurator.App"
xmlns
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local
=
"clr-namespace:FlowmeterConfigurator"
xmlns:views
=
"clr-namespace:FlowmeterConfigurator.Views"
>
<
Application.Resources
>
<
ResourceDictionary
>
<
ResourceDictionary.MergedDictionaries
>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Chart.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Input.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Data.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Docking.xaml"
/>
<
ResourceDictionary
Source
=
"/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.GridView.xaml"
/>
</
ResourceDictionary.MergedDictionaries
>
<
Style
TargetType
=
"views:Shell"
BasedOn
=
"{StaticResource RadWindowStyle}"
/>
<!--Шаблон для кнопки 'Maximize', которая будет находится на RadPain-->
<
DataTemplate
x:Key
=
"TitleTemplate"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"20"
/>
</
Grid.ColumnDefinitions
>
<
ContentPresenter
Content
=
"{Binding}"
Margin
=
"0,0,75,0"
/>
<
telerik:RadButton
x:Name
=
"PART_MaximizeButton"
Grid.Column
=
"1"
Click
=
"OnClicked"
>
<
Path
Stroke
=
"Black"
Width
=
"14"
Height
=
"14"
Data
=
"M1.5,2.5 L12.5,2.5 12.5,11.5 1.5,11.5 Z M4.5,5.5 L9.5,5.5 9.5,8.5 4.5,8.5 Z"
/>
</
telerik:RadButton
>
</
Grid
>
</
DataTemplate
>
<
Style
TargetType
=
"telerik:RadPane"
>
<
Setter
Property
=
"TitleTemplate"
Value
=
"{StaticResource TitleTemplate}"
/>
</
Style
>
</
ResourceDictionary
>
</
Application.Resources
>
</
Application
>
And 'OnClicked' event handler I've located in App.xaml.cs file. So all works. BUT there are a few hangnails. 1) RadPain header is not displayed. Please see 'ChartWithoutHeader.PNG' file attached. 2) Button is shown not completely. Please see 'ChartWithoutHeader.PNG' file attached. 3) Context menu is not appeared and not displayed at all when I click with right mouse button. But in your example - 'RadDockingMaximizeRestore' all these things work perfectly well! I've run it and see it. On the off-chance, I show my preasent RadDocking XAML below:
<
telerik:RadDocking
Grid.Row
=
"1"
Grid.Column
=
"0"
x:Name
=
"Docking"
>
<
telerik:RadSplitContainer
Orientation
=
"Vertical"
telerik:DockingPanel.InitialSize
=
"318,200"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Скорость звука по каждому лучу"
prism:RegionManager.RegionName
=
"SoundVelocityPerBeamChartRegion"
IsHidden
=
"{Binding IsSoundVelocityPerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Скорость газа по каждому лучу"
prism:RegionManager.RegionName
=
"GasVelocityPerBeamChartRegion"
IsHidden
=
"{Binding IsGasVelocityPerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Производительность по каждому лучу"
prism:RegionManager.RegionName
=
"PerformancePerBeamRegion"
IsHidden
=
"{Binding IsPerformancePerBeamChartHiden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
Orientation
=
"Vertical"
telerik:DockingPanel.InitialSize
=
"385,200"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Коэффициент усиления по каждому лучу (AGC)"
prism:RegionManager.RegionName
=
"AGCPerBeamChartRegion"
IsHidden
=
"{Binding IsAGCPerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Отношение 'Сигнал/Шум' по каждому лучу (SNR)"
prism:RegionManager.RegionName
=
"SNRPerBeamChartRegion"
IsHidden
=
"{Binding IsSNRPerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Относительная турбулентность по каждому лучу"
prism:RegionManager.RegionName
=
"RelativeTurbulencePerBeamRegion"
IsHidden
=
"{Binding IsRelativeTurbulencePerBeamChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
Orientation
=
"Vertical"
telerik:DockingPanel.InitialSize
=
"1190,200"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Скорость газа усреднённая"
prism:RegionManager.RegionName
=
"GasVelocityChartRegion"
IsHidden
=
"{Binding IsGasVelocityChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Скорость звука усреднённая"
prism:RegionManager.RegionName
=
"SoundVelocityChartRegion"
IsHidden
=
"{Binding IsSoundVelocityChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Объёмный расход при рабочих условиях"
prism:RegionManager.RegionName
=
"VolumeFlowRateAtWorkingRegion"
IsHidden
=
"{Binding IsWorkingVolumeFlowRateChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
DataContext
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadDocking}}, Path=DataContext}"
Header
=
"Объёмный расход при стандартных условиях"
prism:RegionManager.RegionName
=
"VolumeFlowRateAtStandartRegion"
IsHidden
=
"{Binding IsStandartVolumeFlowRateChartHidden, Mode=TwoWay}"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
This XAML-markup is different from the one I used before and from the one in your example. May be this is the case of three abovementioned hangnails? In addition, I use in my application, 'Office 2013' theme. May be this is the case of the hangnails? Is it possible to correct 'Minimize/Restore' button definition for its perfectly working? I believe that in general, the approach with 'Maximize/Restore' button is not bad, but rather good. Plese help me to correct situation if possible.
Nasko, by the way, I did the following XAML-markup in the main window of your application example (RadDockingMaximizeRestore), please see below:
<
Window
x:Class
=
"RadDockingMaximizeRestore.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
x:Name
=
"LayoutRoot"
>
<
telerik:RadDocking
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
Header
=
"Pane"
/>
</
telerik:RadPaneGroup
>
<!--I ADDED THIS RadPainGroup HERE AND ALL WORKS PERFECTLY!-->
<
telerik:RadPaneGroup
>
<
telerik:RadPane
Header
=
"Pane_2"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
InitialPosition
=
"FloatingDockable"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
Header
=
"Floating Pane"
/>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
</
Grid
>
</
Window
>
As you can see, I added one more docable RadPainGroup in the first RadSplitContainer (in the manner of how it is done in my XAML-markup) and all continue to work perfectly well! So, why in my program are glitches?
As you are using the Office2013 theme the Style of the Pane that sets the Title Pane should be base on its default Style:
<
Style
TargetType
=
"telerik:RadPane"
BasedOn
=
"{StaticResource RadPaneStyle}"
>
<
Setter
Property
=
"TitleTemplate"
Value
=
"{StaticResource TitleTemplate}"
/>
</
Style
>
Thus the Header and the ContextMenu should be visualized as expected. For the size of the Button and in order to show it completely you might need to change the size of the Column inside which it is placed:
<
DataTemplate
x:Key
=
"TitleTemplate"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"25"
/>
</
Grid.ColumnDefinitions
>
...
</
Grid
>
</
DataTemplate
>
Hope this helps.
Regards,
Nasko
Telerik by Progress
Hello, Nasko. SOS-SOS-SOS! Yesterday I upgraded Dev.Craft Complete to the newest version and now the button for zooming/restoring of RadPain failures. When I press or click on it for RadPain zooming the following error occurs: System.IO.FileLoadException" in PresentationCore.dll. Additional information: Could not load file or assembly "Telerik.Windows.Controls.Docking, Version=2016.3.914.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7" or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040). Now (after upgrade) the version of the assembly is 2016.3.1024.45. When I run earlyer version of my application (with previouse version of DLLs) it runs perfectly. But there are many good updates in the current version of my application. So I'm interested to operate the current version of my application.
Plese help me to correct and eliminate this error. This is for me a matter of life and death! Seriously, please help me.
protected
virtual
void
OnClick()
{
RoutedEventArgs newEvent =
new
RoutedEventArgs(ButtonBase.ClickEvent,
this
);
RaiseEvent(newEvent);
// !!! HERE IS THE EXCEPTION OCCURS !!!
MS.Internal.Commands.CommandHelpers.ExecuteCommandSource(
this
);
}
Also the exception occurs in Application.cs file in Run method.
public
int
Run()
{
EEventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordGeneral | EventTrace.Keyword.KeywordPerf, EventTrace.Event.WClientAppRun);
return
this
.Run(
null
);
// HERE THE EXCEPTION OCCURS!
}
We have checked the sample with our latest official released version R3 2016 SP1 and it seems everything is working as expected - please, check the attached video that demonstrates that.
Mostly the observed by you error is caused due to assemblies mismatch. What you could try to do is to delete bin and obj folders in Windows Explorer and clean and rebuild the solution. If this doesn't help you can also try removing the ShadowCache of the designer. In order to achieve this, you should do the following - check if all assemblies are the same version and you are referencing the right one (if they are Xaml or NoXaml binaries):
1) Close all visual studio instances.
2) Go to C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\<visual_studio_version,for_example_12.0>\Designer\ShadowCache and delete the folders there - this is the cache of VisualStudio's designer.
I hope this will help you.
Regards,
Nasko
Telerik by Progress
Could you please confirm if all binaries you are referencing are the same version and are NoXaml - as you are using Implicit Styles all binaries should be NoXaml?
I am looking forward to hearing from you.
Regards,
Nasko
Telerik by Progress
That is definitely the reason for the observed by you issue - all Telerik binaries in the solution should be exact same version and should be referenced from the same folder.
The Upgrade Wizard should be able to find the Class Library that references the Telerik assemblies - check the attached imaged.
If the Upgrade Wizard is not able to find your Class Library reference the binaries by hand (delete the referenced binaries and use Add Reference to reference the right ones) - as mentioned above be aware that the binaries should be referenced from the same folder and should be the same version.
I really hope this will help you.
Regards,
Nasko
Telerik by Progress