[c++]How to bind FontSize and specify font size as "pt", "in" and "cm"
Posted: 26 Sep 2019, 14:13
Hi,
I try to bind FontSize and specify "pt".
How to convert from NsString to float?
In WPF, it can convert from string to double by FontSizeConverter().
XAML
cpp
I try to bind FontSize and specify "pt".
How to convert from NsString to float?
In WPF, it can convert from string to double by FontSizeConverter().
XAML
Code: Select all
<TextBlock FontSize="{Binding FontSize}"... />Code: Select all
float GetFontSize() const{
NsString fontSizeString = "20pt";
float fontSize;
//Convert from NsString to float
return fontSize;
}