Пример #1
0
 /// <summary>
 /// Creates a new instance of <see cref="DataOperation"/> class.
 /// </summary>
 public DataOperation(string elementName)
 {
     ElementName             = elementName;
     Converter               = new NotConverter();
     UpdateSourceTrigger     = UpdateSourceTrigger.PropertyChanged;
     NotifyOnValidationError = true;
 }
Пример #2
0
 /// <summary>
 /// Creates a new instance of <see cref="DataOperation"/> class.
 /// </summary>
 public DataOperation(string elementName)
 {
     ElementName = elementName;
     Converter = new NotConverter();
     UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
     NotifyOnValidationError = true;
 }
Пример #3
0
        public void NotConverterTest()
        {
            NotConverter notConverter = new NotConverter();

            notConverter.ProvideValue(null).Should().Be(notConverter);

            bool value = true;

            object result = notConverter.Convert(value, typeof(bool), null, null);

            result.Should().BeAssignableTo <bool>();
            ((bool)result).Should().BeFalse();

            result = notConverter.ConvertBack(value, typeof(bool), null, null);
            result.Should().BeAssignableTo <bool>();
            ((bool)result).Should().BeFalse();
        }
Пример #4
0
        public void NotConverter()
        {
            if (withExperimentalFlag)
            {
                Markup.NotConverter.Instance                 // Ensure instance create path covered
                .AssertConvert(true, false, twoWay: true)
                .AssertConvert(false, true, twoWay: true);

                Markup.NotConverter.Instance                 // Ensure instance reuse path covered
                .AssertConvert(true, false, twoWay: true)
                .AssertConvert(false, true, twoWay: true);
            }
            else
            {
                AssertExperimental(() => { var _ = new NotConverter(); });
            }
        }
 public void SetUp()
 {
     this.converter = new NotConverter();
 }