Hi Telerik,
I'mu using a RadCarousel with a style applied to all Carousel Items. Sometimes, and randomly, the picture in the Carousel Item disappears (the border or the overlay are still present).
My Carousel :
<
telerik:RadCarousel
Grid.Column
=
"1"
x:Name
=
"InspectionCarousel"
ItemsSource
=
"{Binding TabDiagramsForActiveInspection}"
AutoGenerateDataPresenters
=
"False"
Background
=
"Transparent"
VerticalScrollBarVisibility
=
"Hidden"
HorizontalScrollBarVisibility
=
"Hidden"
SelectedItem
=
"{Binding SelectedItem}"
>
<
telerik:RadCarousel.ItemsPanel
>
<
ItemsPanelTemplate
>
<
telerik:RadCarouselPanel
Path
=
"{StaticResource horizontalPath}"
/>
</
ItemsPanelTemplate
>
</
telerik:RadCarousel.ItemsPanel
>
</
telerik:RadCarousel
>
My Carousel Item Style :
<
Style
TargetType
=
"telerik:CarouselItem"
>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Stretch"
/>
<
Setter
Property
=
"VerticalAlignment"
Value
=
"Stretch"
/>
<
Setter
Property
=
"Height"
Value
=
"{Binding Path=ActualHeight, ElementName=InspectionCarousel, Converter={conv:PercentageConverter}, ConverterParameter='0,9'}"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"telerik:CarouselItem"
>
<
Grid
>
<
Border
BorderThickness
=
"5"
CornerRadius
=
"4"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
>
<
Grid
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
>
<
Image
Source
=
"{Binding TabDiagram.DiagramAsImage.SerializedImage, Converter={StaticResource ImageConverter}}"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
/>
<
Grid
>
<
Grid.Style
>
<
Style
TargetType
=
"Grid"
>
<
Setter
Property
=
"Visibility"
Value
=
"Collapsed"
/>
<
Style.Triggers
>
<
DataTrigger
Binding
=
"{Binding State}"
Value
=
"{x:Static vm:InspectionState.NA}"
>
<
Setter
Property
=
"Visibility"
Value
=
"Visible"
/>
</
DataTrigger
>
</
Style.Triggers
>
</
Style
>
</
Grid.Style
>
<
Grid
Background
=
"LightGray"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Opacity
=
"0.6"
/>
<
TextBlock
Text
=
"N/A"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
FontSize
=
"68"
FontWeight
=
"SemiBold"
/>
</
Grid
>
</
Grid
>
<
Border.Style
>
<
Style
TargetType
=
"Border"
>
<
Setter
Property
=
"BorderBrush"
Value
=
"Black"
/>
<
Style.Triggers
>
<
DataTrigger
Binding
=
"{Binding State}"
Value
=
"{x:Static vm:InspectionState.ToBeDone}"
>
<
Setter
Property
=
"BorderBrush"
Value
=
"Black"
/>
</
DataTrigger
>
<
DataTrigger
Binding
=
"{Binding State}"
Value
=
"{x:Static vm:InspectionState.OK}"
>
<
Setter
Property
=
"BorderBrush"
Value
=
"Green"
/>
</
DataTrigger
>
<
DataTrigger
Binding
=
"{Binding State}"
Value
=
"{x:Static vm:InspectionState.KO}"
>
<
Setter
Property
=
"BorderBrush"
Value
=
"Red"
/>
</
DataTrigger
>
<
DataTrigger
Binding
=
"{Binding State}"
Value
=
"{x:Static vm:InspectionState.NA}"
>
<
Setter
Property
=
"BorderBrush"
Value
=
"Transparent"
/>
</
DataTrigger
>
</
Style.Triggers
>
</
Style
>
</
Border.Style
>
</
Border
>
</
Grid
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
Details :
- TabDiagram.DiagramAsImage.SerializedImage is an screenshot of a RadDiagram (as bytes)
- Converter={StaticResource ImageConverter} is <telerik:BinaryImageConverter x:Key="ImageConverter"/>
- when works.png is a screenshot when the style is correctly applied.
- when doesnt works.png is a screenshot of the behavior of the bug
- context.png is a global screen to show you how i'm using the RadCarousel and RadDiagram
=> Do you know why sometimes and randomly the picture disappears ?
Thank you