Our project uses Prism with great success. One of our Prism regions is a RadTabControl and we programmatically add and remove tabs via Prism. Each of our tabs needs to have a close button so we've defined a ClosableTabItemHeader that looks like this:
Our RadTabItems use our ClosableTabItemHeader as such...
For months this worked without any problems at all. Lately, however, we're noticing that we sometimes have to click the close button two or more times for the command to execute. We've gone over our code with a fine tooth comb and from what we can tell the bound command simply isn't being called. We're out of ideas so we're hoping that Telerik might have one or two.
Greg
<
UserControl
x:Class
=
"Infrastructure.Controls.ClosableTabItemHeader"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Screen.DisplayName}"
FontWeight
=
"DemiBold"
/>
<
telerik:RadButton
Width
=
"14"
Height
=
"14"
Margin
=
"5,0,0,0"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
Command
=
"{Binding Screen.CloseCommand}"
Padding
=
"0"
>
<
Image
Source
=
"pack://application:,,,/Resources;component/Glyphs/24/cross.png"
Height
=
"10"
Width
=
"10"
/>
</
telerik:RadButton
>
</
StackPanel
>
</
UserControl
>
Our RadTabItems use our ClosableTabItemHeader as such...
<
telerik:RadTabItem.Header
>
<
Controls:ClosableTabItemHeader
DataContext
=
"{Binding}"
/>
</
telerik:RadTabItem.Header
>
For months this worked without any problems at all. Lately, however, we're noticing that we sometimes have to click the close button two or more times for the command to execute. We've gone over our code with a fine tooth comb and from what we can tell the bound command simply isn't being called. We're out of ideas so we're hoping that Telerik might have one or two.
Greg