Skip to content

Instantly share code, notes, and snippets.

@ChaseFlorell
Last active August 27, 2019 16:10
Show Gist options
  • Save ChaseFlorell/9cd8de1af937f5a4bde6e4f5ef1d50ce to your computer and use it in GitHub Desktop.
Save ChaseFlorell/9cd8de1af937f5a4bde6e4f5ef1d50ce to your computer and use it in GitHub Desktop.

Revisions

  1. ChaseFlorell revised this gist Aug 27, 2019. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions VisualState_CollectionView.xaml
    Original file line number Diff line number Diff line change
    @@ -25,6 +25,9 @@
    <VisualState x:Name="Normal" />
    <VisualState x:Name="Selected">
    <VisualState.Setters>
    <!-- ##########
    NEVER GETS SET
    ########## -->
    <Setter Property="TextColor" Value="{StaticResource White}" />
    </VisualState.Setters>
    </VisualState>
  2. ChaseFlorell created this gist Aug 27, 2019.
    37 changes: 37 additions & 0 deletions VisualState_CollectionView.xaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    <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>
    <Setter Property="TextColor" Value="{StaticResource White}" />
    </VisualState.Setters>
    </VisualState>
    </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
    </Label>
    </ContentView>
    </DataTemplate>
    </CollectionView.ItemTemplate>
    </CollectionView>