-
Notifications
You must be signed in to change notification settings - Fork 3
/
Converters.cs
30 lines (27 loc) · 939 Bytes
/
Converters.cs
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
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace AppRTCDemo
{
public class InvertVisibilityConverter : IValueConverter
{
public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
{
if (targetType == typeof(Visibility))
{
Visibility vis = (Visibility)value;
return vis == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
}
throw new InvalidOperationException("Converter can only convert to value of type Visibility.");
}
public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)
{
throw new Exception("Invalid call - one way only");
}
}
}