-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] FontImageSource defaults and style #13474
Comments
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
I would like to set the FontImageSource color, font family in global control styling in resource dictionary.
But not working. |
I would like that too |
Same here... |
same here... |
Same here |
I can set many FontImageSource properties in Button Style : <Style TargetType="Button" x:Key="ButtonPrimary" BasedOn="{StaticResource ButtonBase}">
<Setter Property="TextColor" Value="{DynamicResource Neutral-50}" />
<Setter Property="Background" Value="{DynamicResource ButtonPrimaryBackgroundColor}" />
<Setter Property="ImageSource">
<Setter.Value>
<FontImageSource FontFamily="MaterialIcons-Regular" Size="20"/>
</Setter.Value>
</Setter>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Disabled"/>
<VisualState x:Name="PointerOver" />
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style> I can't set the Color property of FontImageSource in Style. But I set the color in the code-behind the custom control (ContentView): private static void UpdateButtonStyle(BindableObject bindable, object oldValue, object newValue)
{
// CustomButton = my custom control (ContentView)
// MyButton = the button inside the custom control
if (bindable is CustomButton button && button.MyButton.ImageSource is FontImageSource fontImageSource)
{
fontImageSource.Color = Colors.Red;
}
} |
This is work around. But we need this basic feature to reduce the code. |
Same here... |
Same now even it worked yesterday!! |
That would be nice to have. |
I am also waiting for it, it will help to reduce the code size |
Same here, global / local settings .... |
Description
This is a reproduction of a highly voted on feature request from Xamarin.Forms
Description, Public API changes and Intended Use case are copied from the original ticket:
Summary
FontImageSource
is amazing! Well done team for the implementation.Now that we're in it and using it, I'd like to propose that there be the ability to set the FontFamily and Color defaults and also make it styleable.
note: i do recognize that making it styleable might negate the need for the default statics, but I thought it might be nice akin to
Color.SetAccent(Color accent);
Public API Changes
Intended Use-Case
Styling would make it far simpler to make reusable font images without having to define them one for each style.
Static default methods will make it so that we only have to define FontFamily or (less important) Color once at startup and we can use that FontFamily as the default throughout the app.
The text was updated successfully, but these errors were encountered: