Hello,
I'm trying to migrate from CollectionView to RadListView and one of the challenges I'm facing is that the Selected visual state is not applied to the cell. For example, consider the following code:
<
ContentPage
>
<
ContentPage.Resources
>
<
ResourceDictionary
>
<
DataTemplate
x:Key
=
"itemTemplate"
>
<
Frame
>
<
VisualStateManager.VisualStateGroups
>
<
VisualStateGroupList
>
<
VisualStateGroup
x:Name
=
"CommonStates"
>
<
VisualState
x:Name
=
"Normal"
/>
<
VisualState
x:Name
=
"Selected"
>
<
VisualState.Setters
>
<
Setter
TargetName
=
"someSignature"
Property
=
"controls:SignaturePadView.IsEnabled"
Value
=
"True"
/>
<
Setter
TargetName
=
"someSignature"
Property
=
"controls:SignaturePadView.SignatureLineColor"
Value
=
"#FF4081"
/>
</
VisualState.Setters
>
</
VisualState
>
</
VisualStateGroup
>
</
VisualStateGroupList
>
</
VisualStateManager.VisualStateGroups
>
<
StackLayout
>
<
Label
Text
=
"Name:"
/>
<
Label
Text
=
"{Binding Path=Name}"
/>
<
controls:SignaturePadView
x:Name
=
"someSignature"
IsEnabled
=
"False"
>
</
controls:SignaturePadView
>
</
StackLayout
>
</
Frame
>
</
DataTemplate
>
</
ResourceDictionary
>
</
ContentPage.Resources
>
<
telerikDataControls:RadListView
x:Name
=
"listView"
ItemsSource
=
"{Binding Path=Items}"
ItemTemplate
=
"{StaticResource itemTemplate}"
SelectedItem
=
"{Binding Path=SelectedItem"
>
<
telerikDataControls:RadListView.SelectedItemStyle
>
<
telerikListView:ListViewItemStyle
BackgroundColor
=
"LightSkyBlue"
/>
</
telerikDataControls:RadListView.SelectedItemStyle
>
</
telerikDataControls:RadListView
>
</
ContentPage
>
In the example, I only want to enable the signature pad when the cell is selected. However, since the Selected visual state is not applied to the parent view of the DataTemplate, the code does not work. This is contrary to the behavior of the Microsoft collection view controls, i.e. ListView and CollectionView.
Is there a way I can have RadListView apply the Selected visual state to the view I define in the DataTemplate? If not, what can I trigger off of?
Thanks,
Josh