Esempio n. 1
0
        public void DataTemplateSetupContentWithNullBindable()
        {
            tlog.Debug(tag, $"DataTemplateSetupContentWithNullBindable START");

            BindingBase      binding       = new Tizen.NUI.Binding.Binding() as BindingBase;
            BindableProperty stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);

            var testingTarget = new MyDataTemplateTest();

            Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
            Assert.IsInstanceOf <DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");

            testingTarget.SetBinding(stateProperty, binding);

            try
            {
                testingTarget.OnSetupContent(null);
            }
            catch (Exception e)
            {
                Assert.Fail("Fail!");
            }

            tlog.Debug(tag, $"DataTemplateSetupContentWithNullBindable END (OK)");
        }
Esempio n. 2
0
 static TouchEffect()
 {
     ColorProperty = BindableProperty.CreateAttached(
         "Color",
         typeof(Color),
         typeof(TouchEffect),
         Color.Default,
         propertyChanged: DoColorPropertyChanged
         );
 }
Esempio n. 3
0
 static Commands()
 {
     TapCommandProperty = BindableProperty.CreateAttached(
         "TapCommand",
         typeof(ICommand),
         typeof(Commands),
         default(ICommand),
         propertyChanged: OnAttachedPropertyChanged
         );
     TapCommandParameterProperty = BindableProperty.CreateAttached(
         "TapCommandParameter",
         typeof(object),
         typeof(Commands),
Esempio n. 4
0
 static EffectsConfiguration()
 {
     AutoChildrenInputTransparent     = true;
     ChildrenInputTransparentProperty = BindableProperty.CreateAttached(
         "ChildrenInputTransparent",
         typeof(bool),
         typeof(EffectsConfiguration),
         false,
         propertyChanged: (source, oldValue, newValue) =>
     {
         ConfigureChildrenInputTransparent(source);
     }
         );
 }
Esempio n. 5
0
 public static BindableProperty CreateAttached <TProperty>(
     TProperty?defaultValue = default,
     BindingMode mode       = BindingMode.TwoWay,
     BindableProperty.BindingPropertyChangedDelegate?propertyChanged = null,
     [CallerMemberName] string?propertyName = null)
 {
     propertyName = RemoveLastOccurrence(propertyName !, KnownPropertyPattern);
     return(BindableProperty.CreateAttached(
                propertyName,
                typeof(TProperty),
                typeof(BindableObject),
                defaultValue,
                mode,
                propertyChanged: propertyChanged));
 }
Esempio n. 6
0
        static Interactivity()
        {
            RequestsProperty = BindableProperty.CreateAttached(
                "Requests",
                typeof(InteractionRequestTriggerCollection),
                typeof(Interactivity),
                default(InteractionRequestTriggerCollection),
                defaultValueCreator: bindable =>
            {
                var collection = new InteractionRequestTriggerCollection();

                collection.AttachTo(bindable);

                return(collection);
            }
                );
        }
        /// <summary>
        /// Registers an attached BindableProperty for the specified type
        /// </summary>
        /// <returns></returns>
        internal static BindableProperty RegisterAttached(string propertyName, Type returnType, Type declaringType, PropertyMetadata metadata)
        {
            BindableProperty prop = null;

            if (metadata != null)
            {
                prop = BindableProperty.CreateAttached(propertyName, returnType, declaringType,
                                                       metadata.DefaultValue, BindingMode.OneWay, null, metadata.BindablePropertyChanged);
                metadata.Property = prop;
            }
            else
            {
                prop = BindableProperty.CreateAttached(propertyName, returnType, declaringType,
                                                       GetDefaultValue(returnType), BindingMode.OneWay, null, null);
            }

            return(prop);
        }
Esempio n. 8
0
        public void DataTemplateSetBindingWithNullBindingBase()
        {
            tlog.Debug(tag, $"DataTemplateSetBindingWithNullBindingBase START");

            BindableProperty stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);

            var testingTarget = new DataTemplate();

            Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
            Assert.IsInstanceOf <DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");

            try
            {
                testingTarget.SetBinding(stateProperty, null);
            }
            catch (ArgumentNullException e)
            {
                tlog.Debug(tag, $"DataTemplateSetValueWithNullBindableProperty END (OK)");
                Assert.Pass("Caught ArgumentNullException: Pass!");
            }
        }
Esempio n. 9
0
        public void DataTemplateSetValue()
        {
            tlog.Debug(tag, $"DataTemplateSetValue START");

            BindableProperty stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(XamlPropertyCondition), false, propertyChanged: OnStatePropertyChanged);

            var testingTarget = new DataTemplate();

            Assert.IsNotNull(testingTarget, "Can't create success object DataTemplate");
            Assert.IsInstanceOf <DataTemplate>(testingTarget, "Should be an instance of DataTemplate type.");

            try
            {
                testingTarget.SetValue(stateProperty, true);
            }
            catch (Exception e)
            {
                Assert.Fail("SetValue Fail!");
            }

            tlog.Debug(tag, $"DataTemplateSetValue END (OK)");
        }
Esempio n. 10
0
 public PropertyCondition()
 {
     _stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(PropertyCondition), false, propertyChanged: this.OnStatePropertyChanged);
 }
Esempio n. 11
0
 /// <summary>
 /// Constructor
 /// </summary>
 public AttachedDataTrigger()
 {
     localProperty = BindableProperty.CreateAttached("Bound", typeof(object), typeof(AttachedDataTrigger), null, propertyChanged: this.OnLocalPropertyChanged);
 }
 public BindingCondition()
 {
     _boundProperty = BindableProperty.CreateAttached("Bound", typeof(object), typeof(BindingCondition), null, propertyChanged: OnBoundPropertyChanged);
 }
Esempio n. 13
0
 static Transition()
 {
     CascadeTransitionProperty = BindableProperty.CreateAttached("CascadeTransition", typeof(bool), typeof(BindableObject), true, BindingMode.OneWay, null, null, null, null, null);
 }
Esempio n. 14
0
 /// <summary>
 /// 静态构造器
 /// </summary>
 static AuthorizationAttacher()
 {
     //注册依赖属性
     AuthorityPathProperty = BindableProperty.CreateAttached("AuthorityPath", typeof(string), typeof(AuthorizationAttacher), null, BindingMode.TwoWay, null, OnAuthorityPathChanged);
 }