本文整理汇总了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);
}
}
示例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;
}
示例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);
}
示例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;
}
示例5: SetSharedFactory
public static void SetSharedFactory(BindableObject bo, ImagesCache value)
{
bo.SetValue(ImageFactory.SharedFactoryProperty, value);
}
示例6: SetDistanceX
public static void SetDistanceX(BindableObject view, double value)
{
view.SetValue (DistanceXProperty, value);
}
示例7: SetCachedSource
public static void SetCachedSource(BindableObject bo, string value)
{
bo.SetValue(ImageFactory.CachedSourceProperty, value);
}
示例8: SetItems
public static void SetItems(BindableObject bo, IEnumerable<string> value)
{
bo.SetValue(PickerCollection.ItemsProperty, value);
}
示例9: SetHasShadow
public static void SetHasShadow(BindableObject view, bool value)
{
view.SetValue (HasShadowProperty, value);
}
示例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);
}
示例11: SetRenderer
public static void SetRenderer(BindableObject bindableObject, IVisualElementRenderer renderer)
{
var value = bindableObject.GetValue (RendererProperty);
bindableObject.SetValue (RendererProperty, renderer);
}
示例12: SetAccessibilityTraits
public static void SetAccessibilityTraits(BindableObject view, AccessibilityTrait value)
{
view.SetValue(AccessibilityTraitsProperty, value);
}
示例13: SetInAccessibleTree
public static void SetInAccessibleTree(BindableObject view, bool value)
{
view.SetValue(InAccessibleTreeProperty, value);
}
示例14: SetIsSelectable
public static void SetIsSelectable(BindableObject bindableObject, bool isSelectable) =>
bindableObject.SetValue(IsSelectableProperty, isSelectable);
示例15: SetAccessibilityLabel
public static void SetAccessibilityLabel(BindableObject view, string value)
{
view.SetValue (AccessibilityLabelProperty, value);
}