I have a RadPanelBar with a custom ItemTemplate and custom HierarchicalDataTemplate. I have the IsEnabled property hooked up through the ContainerBindingCollection.
If I do anything that causes a modal to popup, like using the RadBusyIndicator or showing a silverlight ChildWindow, the screen goes gray, and everything in the RadPanelBar gets disabled. I can set a breakpoint on the setter of IsEnabled and see that when the modal pops up, the setter is getting called with 'false' being set. When the modal goes away, the setter is never called again setting it back to true. The panel bar then stays disabled.
How can I fix this?
I don't want to have to manually set them back to enabled.
I'm using controls version 2011.1.0411.1040
Here is the code:
If I do anything that causes a modal to popup, like using the RadBusyIndicator or showing a silverlight ChildWindow, the screen goes gray, and everything in the RadPanelBar gets disabled. I can set a breakpoint on the setter of IsEnabled and see that when the modal pops up, the setter is getting called with 'false' being set. When the modal goes away, the setter is never called again setting it back to true. The panel bar then stays disabled.
How can I fix this?
I don't want to have to manually set them back to enabled.
I'm using controls version 2011.1.0411.1040
Here is the code:
<
UserControl
x:Class
=
"TelerikPanelTest.MainPage"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
>
<
UserControl.Resources
>
<
telerik:ContainerBindingCollection
x:Key
=
"BindingsCollection"
>
<
telerik:ContainerBinding
PropertyName
=
"IsExpanded"
Binding
=
"{Binding IsExpanded, Mode=TwoWay}"
/>
<
telerik:ContainerBinding
PropertyName
=
"IsEnabled"
Binding
=
"{Binding IsEnabled, Mode=TwoWay}"
/>
</
telerik:ContainerBindingCollection
>
</
UserControl.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
StackPanel
>
<
telerik:RadPanelBar
ItemsSource
=
"{Binding PanelBarItemData}"
>
<
telerik:RadPanelBar.ItemTemplate
>
<
telerik:HierarchicalDataTemplate
ItemsSource
=
"{Binding Items}"
telerik:ContainerBinding.ContainerBindings
=
"{StaticResource BindingsCollection}"
>
<
TextBlock
Text
=
"{Binding HeaderText, Mode=TwoWay}"
/>
<
telerik:HierarchicalDataTemplate.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
>
<
TextBox
/>
<
TextBlock
Text
=
"{Binding}"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:HierarchicalDataTemplate.ItemTemplate
>
</
telerik:HierarchicalDataTemplate
>
</
telerik:RadPanelBar.ItemTemplate
>
</
telerik:RadPanelBar
>
<
Button
Content
=
"Click Me"
Click
=
"Button_Click"
/>
</
StackPanel
>
</
Grid
>
</
UserControl
>
using
System;
using
System.Collections.Generic;
using
System.Collections.ObjectModel;
using
System.Linq;
using
System.Net;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Documents;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Animation;
using
System.Windows.Shapes;
namespace
TelerikPanelTest
{
public
partial
class
MainPage : UserControl
{
public
MainPage()
{
InitializeComponent();
DataContext =
new
MainPageViewModel();
}
private
void
Button_Click(
object
sender, RoutedEventArgs e)
{
var modal =
new
Modal();
modal.Show();
}
}
}
using
System;
using
System.Collections.ObjectModel;
using
System.Net;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Documents;
using
System.Windows.Ink;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Animation;
using
System.Windows.Shapes;
namespace
TelerikPanelTest
{
public
class
MainPageViewModel
{
private
readonly
ObservableCollection<PanelBarItemData> panelBarItemData =
new
ObservableCollection<PanelBarItemData>();
public
ObservableCollection<PanelBarItemData> PanelBarItemData
{
get
{
return
panelBarItemData; }
}
public
MainPageViewModel()
{
panelBarItemData.Add(
new
PanelBarItemData
{
IsEnabled =
true
,
HeaderText =
"Header Text"
,
});
}
}
}
using
System;
using
System.Collections.ObjectModel;
using
System.ComponentModel;
using
System.Net;
using
System.Windows;
using
System.Windows.Controls;
using
System.Windows.Documents;
using
System.Windows.Ink;
using
System.Windows.Input;
using
System.Windows.Media;
using
System.Windows.Media.Animation;
using
System.Windows.Shapes;
namespace
TelerikPanelTest
{
public
class
PanelBarItemData : INotifyPropertyChanged
{
private
bool
isEnabled;
private
bool
isExpanded =
true
;
private
string
headerText;
private
readonly
ObservableCollection<
string
> items =
new
ObservableCollection<
string
>();
public
bool
IsEnabled
{
get
{
return
isEnabled; }
set
{
isEnabled = value;
RaisePropertyChanged(
"IsEnabled"
);
}
}
public
bool
IsExpanded
{
get
{
return
isExpanded; }
set
{
isExpanded = value;
RaisePropertyChanged(
"IsExpanded"
);
}
}
public
string
HeaderText
{
get
{
return
headerText; }
set
{
headerText = value;
RaisePropertyChanged(
"HeaderText"
);
}
}
public
ObservableCollection<
string
> Items
{
get
{
return
items; }
}
public
event
PropertyChangedEventHandler PropertyChanged;
public
PanelBarItemData()
{
items.Add(
"one"
);
items.Add(
"two"
);
}
public
void
RaisePropertyChanged(
string
propertyName)
{
if
(PropertyChanged !=
null
)
{
PropertyChanged(
this
,
new
PropertyChangedEventArgs(propertyName));
}
}
}
}