you'd have to put two elements on the page, one for the integer part and one for the decimal part. Then style them as you would expect. Something like this:
<TextBlock x:Name="IntPart" Text="1234." FontSize="12" />
<TextBlock x:Name="DecPart" Text="456" Margin="0,0,0,3" FontSize="8" />
With Bindings:
<TextBlock Text="{Binding IntPart}" FontSize="12" />
<TextBlock Text="{Binding DecPart}" Margin="0,0,0,3" FontSize="8" />
With Bindings and converters
<my:IntPartConverter x:Key="MyIntPartConverter" />
<my:DecPartConverter x:Key="MyDecPartConverter" />
<TextBlock Text="{Binding MyNumber, Converter={StaticResource MyIntPartConverter}}" FontSize="12" />
<TextBlock Text="{Binding MyNumber, Converter={StaticResource MyDecPartConverter}}" Margin="0,0,0,3" FontSize="8" />
C#
public class IntPartConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (int)value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class DecPartConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (double)value - (int)value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}