本文整理汇总了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;
}
示例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: GetRealCell
internal static UITableViewCell GetRealCell(BindableObject cell)
{
return (UITableViewCell)cell.GetValue(RealCellProperty);
}
示例6: GetSharedFactory
public static ImagesCache GetSharedFactory(BindableObject bo)
{
return (ImagesCache)bo.GetValue(ImageFactory.SharedFactoryProperty);
}
示例7: GetFontSize
public static double GetFontSize(BindableObject bindable) {
return (double)bindable.GetValue(FontSizeProperty);
}
示例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);
}
示例9: SetRenderer
public static void SetRenderer(BindableObject bindableObject, IVisualElementRenderer renderer)
{
var value = bindableObject.GetValue (RendererProperty);
bindableObject.SetValue (RendererProperty, renderer);
}
示例10: GetState
internal override bool GetState(BindableObject bindable)
{
object newValue = bindable.GetValue(_boundProperty);
return EqualsToValue(newValue);
}
示例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);
}
示例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);
}
示例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);
}
示例14: GetInAccessibleTree
public static bool GetInAccessibleTree(BindableObject view)
{
return (bool)view.GetValue(InAccessibleTreeProperty);
}
示例15: GetAccessibilityTraits
public static AccessibilityTrait GetAccessibilityTraits(BindableObject view)
{
return (AccessibilityTrait)view.GetValue(AccessibilityTraitsProperty);
}