22<ContentPage
33 xmlns =" http://xamarin.com/schemas/2014/forms"
44 xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
5- xmlns : controls =" clr-namespace:TemplateUI.Controls;assembly=TemplateUI"
5+ xmlns : controls =" clr-namespace:TemplateUI.Controls;assembly=TemplateUI"
6+ xmlns : iconsB =" clr-namespace:FontAwesome.Brand;assembly=FontAwesome.Brand"
67 x : Class =" TemplateUI.Gallery.Views.SliderGallery"
78 Title =" Slider Gallery" >
89 <ContentPage .Content>
910 <StackLayout
10- Padding =" 12" >
11+ Padding =" 12" Spacing = " 0 " >
1112 <Label
1213 Text =" Getting Started" />
1314 <controls : Slider
1617 Value =" 5"
1718 ValueChanged =" OnSliderValueChanged" />
1819 <Label
19- Text =" Customize the background colors" />
20+ Text =" Customize the background colors" Margin = " 0,10,0,0 " />
2021 <controls : Slider
2122 Value =" 3"
2223 BackgroundColor =" LightCoral" />
2324 <Label
24- Text =" Customize the track colors" />
25+ Text =" Customize the track colors" Margin = " 0,10,0,0 " />
2526 <controls : Slider
2627 Minimum =" 0"
2728 MinimumTrackColor =" Red"
2829 Maximum =" 10"
2930 MaximumTrackColor =" Blue"
3031 Value =" 7" />
3132 <Label
32- Text =" Customize the thumb colors" />
33- <controls : Slider
34- ThumbColor =" Orange"
35- ThumbBorderColor =" Red"
36- Minimum =" 0"
37- MinimumTrackColor =" LightCoral"
38- Maximum =" 10"
39- MaximumTrackColor =" DarkOrange"
40- Value =" 4" />
41- <Label
42- Text =" Customize the track size" />
33+ Text =" Customize the track size" Margin =" 0,10,0,0" />
4334 <controls : Slider
4435 TrackSize =" 4"
45- ThumbColor =" Green"
4636 Minimum =" 0"
4737 MinimumTrackColor =" LightGreen"
4838 Maximum =" 10"
4939 MaximumTrackColor =" DarkGreen"
5040 Value =" 2" />
41+ <Label
42+ Text =" Customize the thumb" Margin =" 0,10,0,0" />
43+ <controls : Slider x : Name =" changingSlider"
44+ TrackSize =" 4"
45+ Minimum =" 2"
46+ MinimumTrackColor =" LightGreen"
47+ Maximum =" 10"
48+ MaximumTrackColor =" LightGreen"
49+ Value =" 12"
50+ Margin =" 0" >
51+ <controls : Slider .Thumb>
52+ <Frame BackgroundColor =" Black" CornerRadius =" 10" HeightRequest =" 60" WidthRequest =" 60" Padding =" 0" Margin =" 0" >
53+ <Grid >
54+ <Image Margin =" 5" VerticalOptions =" FillAndExpand" HorizontalOptions =" FillAndExpand" >
55+ <Image .Source>
56+ <iconsB : IconSource Icon =" GithubAlt" Color =" Red" />
57+ </Image .Source>
58+ </Image >
59+ <BoxView BackgroundColor =" Red" HeightRequest =" 10" WidthRequest =" 2" Margin =" 0" VerticalOptions =" End" HorizontalOptions =" Center" />
60+ </Grid >
61+ </Frame >
62+ </controls : Slider .Thumb>
63+ </controls : Slider >
64+
65+ <Grid Margin =" 0" Padding =" 0" >
66+ <Grid .ColumnDefinitions>
67+ <ColumnDefinition Width =" *" />
68+ <ColumnDefinition Width =" 2" />
69+ <ColumnDefinition Width =" *" />
70+ </Grid .ColumnDefinitions>
71+ <Grid .RowDefinitions>
72+ <RowDefinition Height =" auto" />
73+ <RowDefinition Height =" auto" />
74+ </Grid .RowDefinitions>
75+ <BoxView Grid.Column=" 1" BackgroundColor =" Red" HeightRequest =" 10" Margin =" 0" />
76+ <Label Text =" Center" Grid.Row=" 1" Grid.ColumnSpan=" 3" HorizontalOptions =" FillAndExpand" HorizontalTextAlignment =" Center" />
77+ </Grid >
78+
79+ <Label TextColor =" Black" FontAttributes =" Bold" Margin =" 0,10,0,0" >
80+ <Label .FormattedText>
81+ <FormattedString >
82+ <FormattedString .Spans>
83+ <Span Text =" Minimum: " />
84+ <Span Text =" {Binding Minimum, Source={x:Reference changingSlider}}" />
85+ <Span Text =" " />
86+ <Span Text =" Maximum: " />
87+ <Span Text =" {Binding Maximum, Source={x:Reference changingSlider}}" />
88+ <Span Text =" " />
89+ <Span Text =" Value: " />
90+ <Span Text =" {Binding Value, Source={x:Reference changingSlider}}" />
91+ </FormattedString .Spans>
92+ </FormattedString >
93+ </Label .FormattedText>
94+ </Label >
5195 </StackLayout >
5296 </ContentPage .Content>
53- </ContentPage >
97+ </ContentPage >
0 commit comments