Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LastColumnConverter: MarkupExtension, IValueConverter
- {
- public override object ProvideValue(IServiceProvider serviceProvider)
- {
- return this;
- }
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- var width=value as double?;
- double.TryParse(parameter?.ToString(), out var max);
- if (width.HasValue && max>0)
- {
- if(width< max)
- {
- return new GridLength(0);
- }
- else
- {
- return new GridLength( width.Value-max);
- }
- }
- return 0;
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement