Skip to content
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

Add FontSize markup extension #613

Closed
wants to merge 9 commits into from

Conversation

GeertvanHorrik
Copy link
Member

Working on a new idea to allow for "relative" font sizes in any control. The reason is the need to be able to increase the app-wide font size in an application, but it's hard to scale "predefined font size" values (e.g. controls with FontSize 16).

With this markup extension, instead of using

FontSize="16"

we can use

FontSize="{orctheming:FontSize Delta=4}"

(default font size is 12).

Scaling (%):

<Label Content="This is 1.2"
       FontSize="{orctheming:FontSize Scale=1.2}" />

Absolute delta (e.g. +2 font size):

<Label Content="This is +2"
       FontSize="{orctheming:FontSize Delta=2}" />

Example screenshot

image

Copy link
Contributor

@ceo1647 ceo1647 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solution is flexible but, still I would rather use StaticResource/DynamicResource for these purposes (my personal opinion).
Other looks good, maybe lack of tests

@GeertvanHorrik GeertvanHorrik deleted the feature/font-size-markup branch October 17, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants