<Application.Resources>
<ResourceDictionary>
<Style x:Key="baseSegmentedStyle" TargetType="sfButtons:SfSegmentedControl">
<Setter Property="VisibleSegmentsCount" Value="2" />
<Setter Property="CornerRadius" Value="20" />
<Setter Property="FontColor" Value="Red" />
<Setter Property="BorderColor" Value="DarkGreen" />
</Style>
<Style x:Key="SegmentedControlPrimaryStyle" BasedOn="{StaticResource baseSegmentedStyle}" TargetType="sfButtons:SfSegmentedControl">
<Setter Property="SelectionTextColor"
Value="{DynamicResource SecondaryColor}" />
<Setter Property="BackgroundColor"
Value="{DynamicResource TransparentColor}" />
<Setter Property="Color"
Value="{DynamicResource TransparentColor}" />
<Setter Property="FontColor"
Value="{DynamicResource PrimaryColor}" />
<Setter Property="BorderColor"
Value="{DynamicResource PrimaryColor}" />
</Style>
<Style x:Key="SegmentedControlSecondaryStyle" BasedOn="{StaticResource baseSegmentedStyle}" TargetType="sfButtons:SfSegmentedControl">
<Setter Property="SelectionTextColor" Value="DeepPink" />
<Setter Property="BackgroundColor" Value="LightPink"/>
</Style>
</ResourceDictionary>
</Application.Resources>
plication> |
<ContentPage.Resources>
<ResourceDictionary>
<Style x:Key="SegmentedControlDerivedStyle" BasedOn="{StaticResource SegmentedControlSecondaryStyle}" TargetType="sfButtons:SfSegmentedControl">
<Setter Property="SelectionTextColor" Value="Blue" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
. . .
<sfButtons:SfSegmentedControl Style="{DynamicResource SegmentedControlPrimaryStyle}" >
. . .
</sfButtons:SfSegmentedControl>
<sfButtons:SfSegmentedControl Style="{DynamicResource SegmentedControlDerivedStyle}" />
|