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)"); }
static TouchEffect() { ColorProperty = BindableProperty.CreateAttached( "Color", typeof(Color), typeof(TouchEffect), Color.Default, propertyChanged: DoColorPropertyChanged ); }
static Commands() { TapCommandProperty = BindableProperty.CreateAttached( "TapCommand", typeof(ICommand), typeof(Commands), default(ICommand), propertyChanged: OnAttachedPropertyChanged ); TapCommandParameterProperty = BindableProperty.CreateAttached( "TapCommandParameter", typeof(object), typeof(Commands),
static EffectsConfiguration() { AutoChildrenInputTransparent = true; ChildrenInputTransparentProperty = BindableProperty.CreateAttached( "ChildrenInputTransparent", typeof(bool), typeof(EffectsConfiguration), false, propertyChanged: (source, oldValue, newValue) => { ConfigureChildrenInputTransparent(source); } ); }
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)); }
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); }
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!"); } }
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)"); }
public PropertyCondition() { _stateProperty = BindableProperty.CreateAttached("State", typeof(bool), typeof(PropertyCondition), false, propertyChanged: this.OnStatePropertyChanged); }
/// <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); }
static Transition() { CascadeTransitionProperty = BindableProperty.CreateAttached("CascadeTransition", typeof(bool), typeof(BindableObject), true, BindingMode.OneWay, null, null, null, null, null); }
/// <summary> /// 静态构造器 /// </summary> static AuthorizationAttacher() { //注册依赖属性 AuthorityPathProperty = BindableProperty.CreateAttached("AuthorityPath", typeof(string), typeof(AuthorizationAttacher), null, BindingMode.TwoWay, null, OnAuthorityPathChanged); }