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


C# BindableObject.GetValue方法代码示例

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


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

示例1: ItemsSourceChanged

        private static void ItemsSourceChanged(BindableObject bindable, IEnumerable oldValue, IEnumerable newValue) {
            var picker = (Picker)bindable;
            if (picker == null)
                throw new Exception("only support Picker");

            var selected = picker.SelectedIndex;

            var type = newValue.GetType().GenericTypeArguments[0].GetTypeInfo();
            var dp = (string)bindable.GetValue(DisplayPathProperty);
            PropertyInfo p = null;
            if (!string.IsNullOrWhiteSpace(dp)) {
                p = type.GetDeclaredProperty(dp);
            }
            foreach (var o in newValue) {
                object value = null;
                if (p != null)
                    value = p.GetValue(o);
                else
                    value = o;

                if (value != null)
                    picker.Items.Add(value.ToString());
            }

            picker.SelectedIndex = selected;
        }
开发者ID:zhangcj,项目名称:Xamarin.Forms.Lagou,代码行数:26,代码来源:PickerBinder.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: GetRealCell

		internal static UITableViewCell GetRealCell(BindableObject cell)
		{
			return (UITableViewCell)cell.GetValue(RealCellProperty);
		}
开发者ID:cosullivan,项目名称:Xamarin.Forms,代码行数:4,代码来源:CellRenderer.cs

示例6: GetSharedFactory

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

示例7: GetFontSize

 public static double GetFontSize(BindableObject bindable) {
     return (double)bindable.GetValue(FontSizeProperty);
 }
开发者ID:zhangcj,项目名称:Xamarin.Forms.Lagou,代码行数:3,代码来源:AttachedFontIcon.cs

示例8: GetVMsProperty

        public static INotifyCollectionChanged GetVMsProperty(BindableObject obj) {
            if (null == (TabbedPage)obj)
                throw new Exception("TabbedPageVMLocatorBinder only used for TabbedPage");

            return (INotifyCollectionChanged)obj.GetValue(VMsProperty);
        }
开发者ID:zhangcj,项目名称:Xamarin.Forms.Lagou,代码行数:6,代码来源:TabbedPageVMLocatorBinder.cs

示例9: SetRenderer

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

示例10: GetState

		internal override bool GetState(BindableObject bindable)
		{
			object newValue = bindable.GetValue(_boundProperty);
			return EqualsToValue(newValue);
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:5,代码来源:BindingCondition.cs

示例11: GetAutowireViewModel

 /// <summary>
 /// Gets the AutowireViewModel property value.
 /// </summary>
 /// <param name="bindable"></param>
 /// <returns></returns>
 public static bool? GetAutowireViewModel(BindableObject bindable)
 {
     return (bool?)bindable.GetValue(ViewModelLocator.AutowireViewModelProperty);
 }
开发者ID:dersia,项目名称:Prism,代码行数:9,代码来源:ViewModelLocator.cs

示例12: GetPosition

        /// <summary>
        /// Gets the position for the object.
        /// </summary>
        /// <param name="bindableObject">The bindable object to get the position for.</param>
        /// <returns>The position that has been assigned to the given object.</returns>
        public static FlyoutPosition GetPosition(BindableObject bindableObject)
        {
            if (bindableObject == null)
            {
                throw new ArgumentNullException(nameof(bindableObject));
            }

            return (FlyoutPosition) bindableObject.GetValue(PositionProperty);
        }
开发者ID:cosullivan,项目名称:Xamarin.FormsEx,代码行数:14,代码来源:Flyout.cs

示例13: GetPinTo

        /// <summary>
        /// Gets the element that the instance is pinned to.
        /// </summary>
        /// <param name="bindableObject">The bindable object to get the pin target for.</param>
        /// <returns>The element that the instance is pinned to.</returns>
        public static VisualElement GetPinTo(BindableObject bindableObject)
        {
            if (bindableObject == null)
            {
                throw new ArgumentNullException(nameof(bindableObject));
            }

            return (VisualElement) bindableObject.GetValue(PinToProperty);
        }
开发者ID:cosullivan,项目名称:Xamarin.FormsEx,代码行数:14,代码来源:Flyout.cs

示例14: GetInAccessibleTree

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

示例15: GetAccessibilityTraits

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


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