This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Add Selected VisualState for IndicatorView (#13534)
* [Controls] Add repo for issue #13515 * [Core] Add selected state to IndicatorView Fixes part of #13515
- Loading branch information
Showing
8 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Xamarin.Forms.Controls/GalleryPages/IndicatorViewGalleries/IndicatorsSample.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...in.Forms.Controls/GalleryPages/IndicatorViewGalleries/IndicatorsSampleMaximumVisible.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Forms.Controls/GalleryPages/IndicatorViewGalleries/IndicatorsSampleMaximumVisible.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Xamarin.Forms.Controls/GalleryPages/IndicatorViewGalleries/IndicatorsTemplateSample.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Xamarin.Forms.Controls.GalleryPages.IndicatorsTemplateSample"> | ||
<ContentPage.Resources> | ||
<OnPlatform x:Key="IonicsFontFamily" x:TypeArguments="x:String"> | ||
<On Platform="iOS" Value="Ionicons" /> | ||
<On Platform="Android" Value="fonts/ionicons.ttf#" /> | ||
<On Platform="UWP" Value="Assets/Fonts/ionicons.ttf#ionicons" /> | ||
</OnPlatform> | ||
<x:String x:Key="Indicator"></x:String> | ||
<Style x:Key="IndicatorLabelStyle" TargetType="Label"> | ||
<Setter Property="VisualStateManager.VisualStateGroups"> | ||
<VisualStateGroupList> | ||
<VisualStateGroup x:Name="CommonStates"> | ||
<VisualState x:Name="Normal" > | ||
<VisualState.Setters> | ||
<Setter Property="TextColor" | ||
Value="Red" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
<VisualState x:Name="Selected"> | ||
<VisualState.Setters> | ||
<Setter Property="TextColor" | ||
Value="LightSkyBlue" /> | ||
</VisualState.Setters> | ||
</VisualState> | ||
</VisualStateGroup> | ||
</VisualStateGroupList> | ||
</Setter> | ||
</Style> | ||
</ContentPage.Resources> | ||
<Grid Margin="20,20,20,20"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition></RowDefinition> | ||
<RowDefinition Height="Auto"></RowDefinition> | ||
<RowDefinition Height="Auto"></RowDefinition> | ||
</Grid.RowDefinitions> | ||
<CarouselView x:Name="carousel" ItemsSource="{Binding Items}" Grid.Row="0" Grid.RowSpan="3" IndicatorView="indicators"> | ||
<CarouselView.ItemTemplate> | ||
<DataTemplate> | ||
<Frame BackgroundColor="{Binding Color}"> | ||
<Grid HorizontalOptions="Center" VerticalOptions="Center"> | ||
<Label Text="{Binding Name}" FontSize="25"></Label> | ||
</Grid> | ||
</Frame> | ||
</DataTemplate> | ||
</CarouselView.ItemTemplate> | ||
</CarouselView> | ||
<IndicatorView x:Name="indicators" Grid.Row="1" IndicatorColor="Transparent" SelectedIndicatorColor="Transparent" HorizontalOptions="Center" > | ||
<IndicatorView.IndicatorTemplate> | ||
<DataTemplate> | ||
<Label Style="{StaticResource IndicatorLabelStyle}" | ||
Text="{StaticResource Indicator}" | ||
FontFamily="{StaticResource IonicsFontFamily}"/> | ||
</DataTemplate> | ||
</IndicatorView.IndicatorTemplate> | ||
</IndicatorView> | ||
</Grid> | ||
</ContentPage> |
17 changes: 17 additions & 0 deletions
17
Xamarin.Forms.Controls/GalleryPages/IndicatorViewGalleries/IndicatorsTemplateSample.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
using Xamarin.Forms; | ||
|
||
namespace Xamarin.Forms.Controls.GalleryPages | ||
{ | ||
public partial class IndicatorsTemplateSample : ContentPage | ||
{ | ||
public IndicatorsTemplateSample() | ||
{ | ||
InitializeComponent(); | ||
BindingContext = new GalleryPages.CollectionViewGalleries.CarouselViewGalleries.CarouselItemsGalleryViewModel(false, false); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters