<Style ApplyToDerivedTypes="True" CanCascade="True" TargetType="numericupdown:SfNumericUpDown"> <Setter Property="TextColor" Value="#36AF32" /> <Setter Property="FontSize" Value="{StaticResource Key=LargeFont}" /> <Setter Property="SpinButtonAlignment" Value="Both" /> <Setter Property="AutoReverse" Value="True" /> <Setter Property="SelectAllOnFocus" Value="True" /> <Setter Property="EnableGroupSeparator" Value="True" /> <Setter Property="SpinValidation" Value="Tapped" /> <!--<Setter Property="BackgroundColor" Value="{StaticResource Key=cBackgroundColor}" />--> <Setter Property="UpDownButtonColor" Value="{StaticResource Key=cHilightColor}" /> <Setter Property="FontFamily" Value="{StaticResource Key=Baloo2-Regular}" /> <Setter Property="IncrementButtonView"> <Setter.Value> <Grid HeightRequest="14" WidthRequest="14"> <Image Aspect="AspectFit" Source="{StaticResource Key=icoincrement}" /> </Grid> </Setter.Value> </Setter> <Setter Property="IncrementButtonSettings"> <numericupdown:UpDownButtonSettings ButtonHeight="15" ButtonWidth="15" /> </Setter> <Setter Property="DecrementButtonSettings"> <numericupdown:UpDownButtonSettings ButtonHeight="15" ButtonWidth="15" /> </Setter> <Setter Property="DecrementButtonView"> <Setter.Value> <Grid HeightRequest="14" WidthRequest="14"> <Image Aspect="AspectFit" Source="{StaticResource Key=icodecrement}" /> </Grid> </Setter.Value> </Setter> <Style.Triggers> <Trigger TargetType="numericupdown:SfNumericUpDown" Property="IsFocused" Value="True"> <Setter Property="BackgroundColor" Value="{StaticResource Key=cActiveBackgroundColor}" /> </Trigger> </Style.Triggers> </Style>
<Style TargetType="{x:Type combobox:DropDownButtonSettings}"> <Setter Property="Height" Value="17" /> <Setter Property="Width" Value="17" /> <Setter Property="FontColor" Value="{StaticResource Key=primary-title-color}" /> <Setter Property="HighlightedBackgroundColor" Value="{StaticResource Key=cHilightColor}" /> <Setter Property="Image" Value="{StaticResource Key=icoDropDown}" /> </Style>
<Style ApplyToDerivedTypes="True" CanCascade="True" TargetType="numericupdown:SfNumericUpDown"> <Setter Property="TextColor" Value="{StaticResource Key=cTextColor}" /> <Setter Property="FontSize" Value="{StaticResource Key=DataFont}" /> <Setter Property="SpinButtonAlignment" Value="Both" /> <Setter Property="AutoReverse" Value="True" /> <Setter Property="SelectAllOnFocus" Value="True" /> <Setter Property="EnableGroupSeparator" Value="True" /> <Setter Property="SpinValidation" Value="Tapped" /> <Setter Property="UpDownButtonColor" Value="{StaticResource Key=cHilightColor}" /> <Setter Property="FontFamily" Value="{StaticResource Key=Baloo2-Regular}" /> <Setter Property="IncrementButtonSettings"> <Setter.Value> <numericupdown:UpDownButtonSettings ButtonHeight="15" ButtonWidth="15" /> </Setter.Value> </Setter> <Setter Property="IncrementButtonView"> <Setter.Value> <Grid HeightRequest="18" WidthRequest="18"> <Image Aspect="AspectFit" Source="{StaticResource Key=icoGPS}" /> </Grid> </Setter.Value> </Setter> <Setter Property="DecrementButtonSettings"> <Setter.Value> <numericupdown:UpDownButtonSettings ButtonHeight="15" ButtonWidth="15" /> </Setter.Value> </Setter> <Setter Property="DecrementButtonView"> <Setter.Value> <Grid HeightRequest="14" WidthRequest="14"> <Image Aspect="AspectFit" Source="{StaticResource Key=icoGPS}" /> </Grid> </Setter.Value> </Setter> <Style.Triggers> <Trigger TargetType="numericupdown:SfNumericUpDown" Property="IsFocused" Value="True"> <Setter Property="BackgroundColor" Value="{StaticResource Key=cActiveBackgroundColor}" /> </Trigger> </Style.Triggers> </Style>
This should work as best as I can tell. Is the control just not able to be styled from a `<Style>` tag?
Thanks again!
|
<ContentPage.Resources>
<updown:UpDownButtonSettings x:Key="DecrementButtonSettingsStyle" ButtonHeight="15" ButtonWidth="15">
</updown:UpDownButtonSettings>
<updown:UpDownButtonSettings x:Key="IncrementButtonSettingsStyle" ButtonHeight="15" ButtonWidth="15">
</updown:UpDownButtonSettings>
<Style
ApplyToDerivedTypes="True"
CanCascade="True"
TargetType="updown:SfNumericUpDown">
<Setter Property="TextColor" Value="Red" />
<Setter Property="FontSize" Value="20" />
..
</Style>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout Margin="10">
<updown:SfNumericUpDown Margin="10"
IncrementButtonSettings="{StaticResource IncrementButtonSettingsStyle}"
DecrementButtonSettings="{StaticResource DecrementButtonSettingsStyle}">
</updown:SfNumericUpDown>
</StackLayout>
</ContentPage.Content> |
<numericupdown:UpDownButtonSettings x:Key="DecrementButtonSettingsStyle" ButtonHeight="15" ButtonWidth="15"> <numericupdown:UpDownButtonSettings.ButtonView> <Grid HeightRequest="15" WidthRequest="15"> <Image Aspect="AspectFit" Source="{StaticResource Key=icoDownArrow}" /> Grid> numericupdown:UpDownButtonSettings.ButtonView> numericupdown:UpDownButtonSettings> <numericupdown:UpDownButtonSettings x:Key="IncrementButtonSettingsStyle" ButtonHeight="15" ButtonWidth="15"> <numericupdown:UpDownButtonSettings.ButtonView> <Grid HeightRequest="15" WidthRequest="15"> <Image Aspect="AspectFit" Source="{StaticResource Key=icoUpArrow}" /> Grid> numericupdown:UpDownButtonSettings.ButtonView> numericupdown:UpDownButtonSettings>
........
<numericupdown:SfNumericUpDown x:Name="BarrelLen" AutoReverse="True" DecrementButtonSettings="{DynamicResource Key=DecrementButtonSettingsStyle}" HeightRequest="50" IncrementButtonSettings="{DynamicResource Key=IncrementButtonSettingsStyle}" Maximum="32" MaximumDecimalDigits="2" Minimum="0.5" SelectAllOnFocus="True" SpinValidation="Tapped" StepValue="0.25" ValueChangeMode="OnLostFocus" VerticalOptions="End" Watermark="Length" WidthRequest="100" Value="{Binding Path=MyWeapon.BarrelLen, Mode=TwoWay}" />
<numericupdown:SfNumericUpDown x:Name="RoundCount" AutoReverse="False" DecrementButtonSettings="{DynamicResource Key=DecrementButtonSettingsStyle}" HeightRequest="50" Maximum="250000" MaximumDecimalDigits="0" Minimum="0" SelectAllOnFocu="True" SpinValidation="Tapped" StepValue="1" ValueChangeMode="OnLostFocus" Watermark="Length" WidthRequest="110" Value="{Binding Path=MyWeapon.RoundCount, Mode=TwoWay}" />
|
<Style x:Key="IncrementButtonSettingsStyle" TargetType="numericupdown:UpDownButtonSettings" >
<Setter Property="ButtonHeight" Value="15"/>
<Setter Property="ButtonWidth" Value="15"/>
..
</Style>
<Style x:Key="DecrementButtonSettingsStyle" TargetType="numericupdown:UpDownButtonSettings" >
<Setter Property="ButtonHeight" Value="25"/>
<Setter Property="ButtonWidth" Value="25"/>
..
</Style>
<Style x:Key="SfNumericUpDownStyle" TargetType="numericupdown:SfNumericUpDown" >
<Setter Property="TextColor" Value="Red"/>
..
</Style>
|
|
<StackLayout Margin="10">
<numericupdown:SfNumericUpDown Style="{StaticResource SfNumericUpDownStyle}">
<numericupdown:SfNumericUpDown.IncrementButtonSettings>
<numericupdown:UpDownButtonSettings Style="{StaticResource IncrementButtonSettingsStyle}"/>
</numericupdown:SfNumericUpDown.IncrementButtonSettings>
<numericupdown:SfNumericUpDown.DecrementButtonSettings>
<numericupdown:UpDownButtonSettings Style="{StaticResource DecrementButtonSettingsStyle}"/>
</numericupdown:SfNumericUpDown.DecrementButtonSettings>
</numericupdown:SfNumericUpDown>
<numericupdown:SfNumericUpDown Style="{StaticResource SfNumericUpDownStyle}">
<numericupdown:SfNumericUpDown.IncrementButtonSettings>
<numericupdown:UpDownButtonSettings Style="{StaticResource IncrementButtonSettingsStyle}"/>
</numericupdown:SfNumericUpDown.IncrementButtonSettings>
<numericupdown:SfNumericUpDown.DecrementButtonSettings>
<numericupdown:UpDownButtonSettings Style="{StaticResource DecrementButtonSettingsStyle}"/>
</numericupdown:SfNumericUpDown.DecrementButtonSettings>
</numericupdown:SfNumericUpDown>
</StackLayout> |
<Style ApplyToDerivedTypes="True" CanCascade="True" TargetType="numericupdown:SfNumericUpDown"> <Setter Property="TextColor" Value="{StaticResource Key=cTextColor}" /> <Setter Property="FontSize" Value="{StaticResource Key=DataFont}" /> <Setter Property="SpinButtonAlignment" Value="Both" /> <Setter Property="AutoReverse" Value="True" /> <Setter Property="SelectAllOnFocus" Value="True" /> <Setter Property="EnableGroupSeparator" Value="True" /> <Setter Property="SpinValidation" Value="Default" /> <Setter Property="UpDownButtonColor" Value="{StaticResource Key=cHilightColor}" /> <Setter Property="FontFamily" Value="{StaticResource Key=Baloo2-Regular}" /> </Style>
<Setter Property="IncrementButtonSettings"> <Setter.Value> <numericupdown:UpDownButtonSettings ButtonHeight="14" ButtonWidth="14" /> </Setter.Value> </Setter> <Setter Property="IncrementButtonView"> <Setter.Value> <Grid HeightRequest="15" WidthRequest="15"> <Image Aspect="AspectFit" Source="icoGear" /> </Grid> </Setter.Value> </Setter> <Setter Property="DecrementButtonSettings"> <Setter.Value> <numericupdown:UpDownButtonSettings ButtonHeight="14" ButtonWidth="14" /> </Setter.Value> </Setter> <Setter Property="DecrementButtonView"> <Setter.Value> <Grid HeightRequest="15" WidthRequest="15"> <Image Aspect="AspectFit" Source="{StaticResource Key=icoGear}" /> </Grid> </Setter.Value> </Setter> </Style>
|
<Style x:Key="IncrementButtonSettingsStyle" TargetType="numericupdown:UpDownButtonSettings" >
<Setter Property="ButtonHeight" Value="15"/> <Setter Property="ButtonWidth" Value="15"/> <Setter Property="ButtonImage" Value="Plus"/> //Button custom image view </Style> <Style x:Key="DecrementButtonSettingsStyle" TargetType="numericupdown:UpDownButtonSettings" >
<Setter Property="ButtonHeight" Value="15"/> <Setter Property="ButtonWidth" Value="15"/> <Setter Property="ButtonImage" Value="Minus"/> //Button custom image view </Style> <Style x:Key="SfNumericUpDownStyle" TargetType="numericupdown:SfNumericUpDown" >
<Setter Property="TextColor" Value="red" />
..
</Style>
..
<StackLayout Margin="10"> <numericupdown:SfNumericUpDown Style="{StaticResource SfNumericUpDownStyle}">
<numericupdown:SfNumericUpDown.IncrementButtonSettings>
<numericupdown:UpDownButtonSettings Style="{StaticResource IncrementButtonSettingsStyle}"/>
</numericupdown:SfNumericUpDown.IncrementButtonSettings>
<numericupdown:SfNumericUpDown.DecrementButtonSettings>
<numericupdown:UpDownButtonSettings Style="{StaticResource DecrementButtonSettingsStyle}"/>
</numericupdown:SfNumericUpDown.DecrementButtonSettings>
</numericupdown:SfNumericUpDown>
<numericupdown:SfNumericUpDown Style="{StaticResource SfNumericUpDownStyle}">
<numericupdown:SfNumericUpDown.IncrementButtonSettings>
<numericupdown:UpDownButtonSettings Style="{StaticResource IncrementButtonSettingsStyle}"/>
</numericupdown:SfNumericUpDown.IncrementButtonSettings>
<numericupdown:SfNumericUpDown.DecrementButtonSettings>
<numericupdown:UpDownButtonSettings Style="{StaticResource DecrementButtonSettingsStyle}"/>
</numericupdown:SfNumericUpDown.DecrementButtonSettings>
</numericupdown:SfNumericUpDown>
</StackLayout> |