12345678910111213141516171819202122232425262728 |
- using System;
- using System.Globalization;
- using System.Windows.Data;
- namespace InABox.WPF
- {
- public class RelativeFontSize : IValueConverter
- {
- // Create a ratio property
- // allows the converter to be used for different font ratios
- public double Ratio { get; set; }
- public object Convert(object value, Type targetType, object parameter,
- CultureInfo culture)
- {
- // add input parameter testing as needed.
- var originalFontSize = (double)value;
- var alteredFontSize = originalFontSize * Ratio;
- return alteredFontSize;
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|