diff --git a/samples/XamlTestApplicationPcl/ScrollBar.paml b/samples/XamlTestApplicationPcl/ScrollBar.paml index d6a4e3f38b..ebd01c1511 100644 --- a/samples/XamlTestApplicationPcl/ScrollBar.paml +++ b/samples/XamlTestApplicationPcl/ScrollBar.paml @@ -8,7 +8,7 @@ Value="{TemplateBinding Path=Value, Mode=TwoWay}" ViewportSize="{TemplateBinding ViewportSize}" Orientation="{TemplateBinding Orientation}"> - + diff --git a/samples/XamlTestApplicationPcl/StringNullOrEmpty.cs b/samples/XamlTestApplicationPcl/StringNullOrEmpty.cs new file mode 100644 index 0000000000..c99dde4732 --- /dev/null +++ b/samples/XamlTestApplicationPcl/StringNullOrEmpty.cs @@ -0,0 +1,33 @@ +// Copyright (c) The Perspex Project. All rights reserved. +// Licensed under the MIT license. See licence.md file in the project root for full license information. + +using System; +using System.Globalization; +using Perspex; +using Perspex.Markup; + +namespace XamlTestApplication +{ + public class StringNullOrEmpty : IValueConverter + { + public static readonly StringNullOrEmpty Instance = new StringNullOrEmpty(); + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) + { + return true; + } + else + { + var s = value as string; + return s != null ? string.IsNullOrEmpty(s) : PerspexProperty.UnsetValue; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/samples/XamlTestApplicationPcl/TextBox.paml b/samples/XamlTestApplicationPcl/TextBox.paml index 95203987e7..f901d9f6bd 100644 --- a/samples/XamlTestApplicationPcl/TextBox.paml +++ b/samples/XamlTestApplicationPcl/TextBox.paml @@ -1,4 +1,6 @@ - +