When I have my RadPane's IsHidden property bound to a boolean ViewModel property which is set to true, I get an exception from within Telerik's RadDocking code:
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
Source=Telerik.Windows.Controls.Docking
StackTrace:
at Telerik.Windows.Controls.RadDocking.OnRadPaneClose(Object sender, StateChangeCommandEventArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 834
InnerException:
Right now this is preventing me from implementing a full MVVM using your controls. I'm hoping this is something I've done wrong but if not, is there any workaround that I can use to get me past this before this bug is fixed (it is a bug)?
From my sample project with only this in it:
Here's my View XAML:
And here's my ViewModel code:
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
Source=Telerik.Windows.Controls.Docking
StackTrace:
at Telerik.Windows.Controls.RadDocking.OnRadPaneClose(Object sender, StateChangeCommandEventArgs args) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 834
InnerException:
Right now this is preventing me from implementing a full MVVM using your controls. I'm hoping this is something I've done wrong but if not, is there any workaround that I can use to get me past this before this bug is fixed (it is a bug)?
From my sample project with only this in it:
Here's my View XAML:
<
Window
x:Class
=
"Telerik_IsHidden_RadPane_Bug.MainView"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
DataContext
=
"{Binding Main, Source={StaticResource Locator}}"
>
<
Grid
>
<!-- Main Window Docking Container (stretch to fill grid) -->
<
telerik:RadDocking
Grid.Row
=
"1"
HasDocumentHost
=
"false"
HorizontalAlignment
=
"Stretch"
Margin
=
"0,0,0,32"
Name
=
"radDockingMainWindow"
VerticalAlignment
=
"Stretch"
>
<!-- Split container that holds all of the accordion panels -->
<
telerik:RadSplitContainer
telerik:DockingPanel.InitialSize
=
"300, 200"
Name
=
"AccordionContainer"
InitialPosition
=
"DockedLeft"
Orientation
=
"Vertical"
VerticalAlignment
=
"Stretch"
>
<!-- Panes must be in pane groups, even if there is just 1 -->
<
telerik:RadPaneGroup
MaxWidth
=
"300"
x:Name
=
"ToolWindow1Group"
>
<
telerik:RadPane
x:Name
=
"ToolWindow1"
Title
=
""
CanUserClose
=
"False"
CanUserPin
=
"False"
CanFloat
=
"True"
>
<
Button
Content
=
"Example"
/>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
<
telerik:RadSplitContainer
InitialPosition
=
"FloatingDockable"
telerik:RadDocking.FloatingLocation
=
"450, 250"
telerik:RadDocking.FloatingSize
=
"300, 220"
x:Name
=
"uxWindowRadSplitContainer"
>
<
telerik:RadPaneGroup
>
<
telerik:RadPane
Header
=
"Intellifolders"
CanDockInDocumentHost
=
"False"
IsHidden
=
"{Binding Path=ToolWindowProp}"
x:Name
=
"uxToolWindowRadPane"
>
<
TextBlock
Text
=
"Hi"
/>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking
>
</
Grid
>
</
Window
>
And here's my ViewModel code:
using
GalaSoft.MvvmLight;
namespace
Telerik_IsHidden_RadPane_Bug
{
/// <summary>
/// This class contains properties that a View can data bind to.
/// <para>
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
/// </para>
/// <para>
/// </para>
/// </summary>
public
class
MainViewModel : ViewModelBase
{
public
bool
ToolWindowProp
{
get
;
set
; }
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public
MainViewModel()
{
ToolWindowProp =
true
;
}
}
}