Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Custom NamedSize for Label's FontSize

$
0
0

I want to be able to do this:

<Label FontSize="Large+2"/>

And be able to parse Large+2 as:

Device.GetNamedSize (NamedSize.Large, typeof(Label)) + 2

The closest I'm to this is via x:Static and it looks like this:

<Label FontSize="{x:Static local:MyNamedSize.LargeP2}">

where MyNamedSize is a class with a static property LargeP2 which returns:

Device.GetNamedSize (NamedSize.Large, typeof(Label)) + 2

Of course the parsing is not the problem. The problem is how do I tell xaml that "Large+2" should be parsed by my custom parser/TypeConverter/ValueConverter or whatever it should be.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>