blob: dcad22f9a2354acdaaf316d18fe57d6a20d1f627 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
using System;
using System.Collections;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;
namespace Xamarin.PropertyEditing.Windows
{
internal class HasItemsToVisibilityConverter : MarkupExtension, IValueConverter
{
public object Convert (object value, Type targetType, object parameter, CultureInfo culture) =>
(value is ICollection enumerable)
? (enumerable.Count > 0 ? Visibility.Visible : Visibility.Collapsed)
: Visibility.Visible;
public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException ();
}
public override object ProvideValue (IServiceProvider serviceProvider) => this;
}
}
|