Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
NullToUnset.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using System.Globalization;
5 using System.Windows;
6 
7 namespace SiliconStudio.Presentation.ValueConverters
8 {
9  /// <summary>
10  /// This converter will convert a null value to <see cref="DependencyProperty.UnsetValue"/>. If the given object is not null, it will be returned as it is.
11  /// </summary>
12  public class NullToUnset : OneWayValueConverter<NullToUnset>
13  {
14  /// <inheritdoc/>
15  public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
16  {
17  return value ?? DependencyProperty.UnsetValue;
18  }
19  }
20 }
This converter will convert a null value to DependencyProperty.UnsetValue. If the given object is not...
Definition: NullToUnset.cs:12
override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Definition: NullToUnset.cs:15