当前位置: 首页>>代码示例>>C#>>正文


C# BindableObject.SetValue方法代码示例

本文整理汇总了C#中BindableObject.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# BindableObject.SetValue方法的具体用法?C# BindableObject.SetValue怎么用?C# BindableObject.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BindableObject的用法示例。


在下文中一共展示了BindableObject.SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ApplyStyle

 private static void ApplyStyle(BindableObject bindable, Style newvalue)
 {
   foreach (var setter in newvalue.Setters )
   {
       bindable.SetValue(setter.Property, setter.Value);
   }
 }
开发者ID:patridge,项目名称:Xamarin.Forms.Plugins,代码行数:7,代码来源:ExtendedTextCell.cs

示例2: SetUp

		internal override void SetUp(BindableObject bindable)
		{
			object newvalue = bindable.GetValue(Property);

			bool newState = (newvalue == Value) || (newvalue != null && newvalue.Equals(Value));
			bindable.SetValue(_stateProperty, newState);
			bindable.PropertyChanged += OnAttachedObjectPropertyChanged;
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:8,代码来源:PropertyCondition.cs

示例3: OnConditionChanged

		void OnConditionChanged(BindableObject bindable, bool oldValue, bool newValue)
		{
			var oldState = (bool)bindable.GetValue(_aggregatedStateProperty);
			var newState = true;
			foreach (Condition condition in Conditions)
			{
				if (!condition.GetState(bindable))
				{
					newState = false;
					break;
				}
			}
			if (newState != oldState)
				bindable.SetValue(_aggregatedStateProperty, newState);
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:15,代码来源:MultiCondition.cs

示例4: GetPinned

        /// <summary>
        /// Gets the list of pinned elements for the bindable object.
        /// </summary>
        /// <param name="bindableObject">The bindable object to get the list of pinned elements.</param>
        /// <returns>The list of pinned elements of the bindable object.</returns>
        internal static List<VisualElement> GetPinned(BindableObject bindableObject)
        {
            if (bindableObject == null)
            {
                throw new ArgumentNullException(nameof(bindableObject));
            }

            var value = bindableObject.GetValue(PinnedPropertyKey.BindableProperty) as List<VisualElement>;

            if (value == null)
            {
                value = new List<VisualElement>();
                bindableObject.SetValue(PinnedPropertyKey, value);
            }

            return value;
        }
开发者ID:cosullivan,项目名称:Xamarin.FormsEx,代码行数:22,代码来源:Flyout.cs

示例5: SetSharedFactory

 public static void SetSharedFactory(BindableObject bo, ImagesCache value)
 {
     bo.SetValue(ImageFactory.SharedFactoryProperty, value);
 }
开发者ID:Dimitrij-CG,项目名称:crossPlatformDevelopment,代码行数:4,代码来源:ImageFactory.cs

示例6: SetDistanceX

 public static void SetDistanceX(BindableObject view, double value)
 {
     view.SetValue (DistanceXProperty, value);
 }
开发者ID:RickySan65,项目名称:xamarin-forms-samples,代码行数:4,代码来源:ShadowEffect.cs

示例7: SetCachedSource

 public static void SetCachedSource(BindableObject bo, string value)
 {
     bo.SetValue(ImageFactory.CachedSourceProperty, value);
 }
开发者ID:Dimitrij-CG,项目名称:crossPlatformDevelopment,代码行数:4,代码来源:ImageFactory.cs

示例8: SetItems

 public static void SetItems(BindableObject bo, IEnumerable<string> value)
 {
     bo.SetValue(PickerCollection.ItemsProperty, value);
 }
开发者ID:mrbelk,项目名称:Xamarin-Forms-Validation,代码行数:4,代码来源:PickerCollection.cs

示例9: SetHasShadow

 public static void SetHasShadow(BindableObject view, bool value)
 {
     view.SetValue (HasShadowProperty, value);
 }
开发者ID:RickySan65,项目名称:xamarin-forms-samples,代码行数:4,代码来源:ShadowEffect.cs

示例10: SetAutowireViewModel

 /// <summary>
 /// Sets the AutowireViewModel property value.  If <c>true</c>, creates an instance of a ViewModel using a convention, and sets the associated View's <see cref="Xamarin.Forms.BindableObject.BindingContext"/> to that instance.
 /// </summary>
 /// <param name="bindable"></param>
 /// <param name="value"></param>
 public static void SetAutowireViewModel(BindableObject bindable, bool? value)
 {
     bindable.SetValue(ViewModelLocator.AutowireViewModelProperty, value);
 }
开发者ID:dersia,项目名称:Prism,代码行数:9,代码来源:ViewModelLocator.cs

示例11: SetRenderer

 public static void SetRenderer(BindableObject bindableObject, IVisualElementRenderer renderer)
 {
     var value = bindableObject.GetValue (RendererProperty);
     bindableObject.SetValue (RendererProperty, renderer);
 }
开发者ID:Pizzajongen,项目名称:TwinTechsFormsLib,代码行数:5,代码来源:RendererHelper.cs

示例12: SetAccessibilityTraits

 public static void SetAccessibilityTraits(BindableObject view, AccessibilityTrait value)
 {
     view.SetValue(AccessibilityTraitsProperty, value);
 }
开发者ID:ZaK14120,项目名称:xamarin-forms-samples,代码行数:4,代码来源:AccessibilityEffect.cs

示例13: SetInAccessibleTree

 public static void SetInAccessibleTree(BindableObject view, bool value)
 {
     view.SetValue(InAccessibleTreeProperty, value);
 }
开发者ID:ZaK14120,项目名称:xamarin-forms-samples,代码行数:4,代码来源:AccessibilityEffect.cs

示例14: SetIsSelectable

 public static void SetIsSelectable(BindableObject bindableObject, bool isSelectable) =>
     bindableObject.SetValue(IsSelectableProperty, isSelectable);
开发者ID:reactiveui-forks,项目名称:WorkoutWotch,代码行数:2,代码来源:CellBehavior.cs

示例15: SetAccessibilityLabel

 public static void SetAccessibilityLabel(BindableObject view, string value)
 {
     view.SetValue (AccessibilityLabelProperty, value);
 }
开发者ID:ZaK14120,项目名称:xamarin-forms-samples,代码行数:4,代码来源:AccessibilityEffect.cs


注:本文中的BindableObject.SetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。