Skip to content

Instantly share code, notes, and snippets.

@ChaseFlorell
Last active August 27, 2019 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChaseFlorell/9cd8de1af937f5a4bde6e4f5ef1d50ce to your computer and use it in GitHub Desktop.
Save ChaseFlorell/9cd8de1af937f5a4bde6e4f5ef1d50ce to your computer and use it in GitHub Desktop.
<CollectionView ItemsSource="{Binding Addresses}"
VerticalOptions="Start"
SelectionMode="Single"
HeightRequest="350"
SelectionChanged="OnItemSelected">
<CollectionView.EmptyView>
<Label Text="No Results (l10n)" TextColor="{StaticResource OsloGrey}" Margin="10" />
</CollectionView.EmptyView>
<CollectionView.ItemTemplate>
<DataTemplate>
<ContentView>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{StaticResource AgExpertBlue}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Label Text="{Binding .}" Margin="10,25" VerticalOptions="Center" VerticalTextAlignment="Center" >
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Selected">
<VisualState.Setters>
<!-- ##########
NEVER GETS SET
########## -->
<Setter Property="TextColor" Value="{StaticResource White}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Label>
</ContentView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment