本文整理汇总了C#中IBindingMemberInfo类的典型用法代码示例。如果您正苦于以下问题:C# IBindingMemberInfo类的具体用法?C# IBindingMemberInfo怎么用?C# IBindingMemberInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBindingMemberInfo类属于命名空间,在下文中一共展示了IBindingMemberInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetListViewSelectedItem
private static object GetListViewSelectedItem(IBindingMemberInfo bindingMemberInfo, ListView listView)
{
var items = listView.SelectedItems;
if (items.Count == 0)
return null;
return ViewManager.GetDataContext(items[0]);
}
开发者ID:Fezzer,项目名称:MugenMvvmToolkit.Samples,代码行数:7,代码来源:Module.cs
示例2: BindingMemberMustBeWriteable
internal static Exception BindingMemberMustBeWriteable(IBindingMemberInfo member)
{
return
new InvalidOperationException(
string.Format("The binding member must be writeable, if it uses the SetValue method, path '{0}', type '{1}', member type '{2}', underlying member '{3}'",
member.Path, member.Type, member.MemberType, member.Member));
}
开发者ID:MuffPotter,项目名称:MugenMvvmToolkit,代码行数:7,代码来源:BindingExceptionManager.cs
示例3: XamlUnresolvedResource
public XamlUnresolvedResource(object target, string key, IBindingMemberInfo rootMember)
{
_key = key;
_value = BindingConstants.UnsetValue;
_reference = ServiceProvider.WeakReferenceFactory(target);
_unsubscriber = rootMember.TryObserve(target, this);
}
开发者ID:MuffPotter,项目名称:MugenMvvmToolkit,代码行数:7,代码来源:BindingResourceResolverEx.cs
示例4: InvalidEventSourceValue
internal static Exception InvalidEventSourceValue(IBindingMemberInfo member, object invalidValue)
{
return
new InvalidOperationException(
string.Format("The event binding member supports only method or command values, if it uses the SetValue method, path '{0}', type '{1}', member type '{2}', underlying member '{3}', invalid value '{4}'",
member.Path, member.Type, member.MemberType, member.Member, invalidValue));
}
开发者ID:MuffPotter,项目名称:MugenMvvmToolkit,代码行数:7,代码来源:BindingExceptionManager.cs
示例5: BindingActionValue
/// <summary>
/// Initializes a new instance of the <see cref="BindingActionValue" /> class.
/// </summary>
public BindingActionValue([NotNull] object memberSource, [NotNull] IBindingMemberInfo member)
{
Should.NotBeNull(memberSource, "memberSource");
Should.NotBeNull(member, "member");
_memberSource = ToolkitExtensions.GetWeakReference(memberSource);
_member = member;
}
开发者ID:MuffPotter,项目名称:MugenMvvmToolkit,代码行数:10,代码来源:BindingActionValue.cs
示例6: XamlResourceWrapper
public XamlResourceWrapper(object target, string key, IBindingMemberInfo rootMember, ISourceValue globalResource)
{
_key = key;
_value = BindingConstants.UnsetValue;
_reference = ServiceProvider.WeakReferenceFactory(target);
_unsubscriber = rootMember.TryObserve(target, this);
_globalResource = globalResource;
}
开发者ID:dbeattie71,项目名称:MugenMvvmToolkit,代码行数:8,代码来源:BindingResourceResolverEx.cs
示例7: TextExtGetDefaultValue
/// <summary>
/// Called once for each element in the time of accession to obtain default values.
/// </summary>
private static string TextExtGetDefaultValue(TextView textBlock, IBindingMemberInfo bindingMemberInfo)
{
ServiceProvider
.IocContainer
.Get<IToastPresenter>()
.ShowAsync("Invoking TextExtGetDefaultValue on " + textBlock.Id, ToastDuration.Short);
return "Default value";
}
开发者ID:Fezzer,项目名称:MugenMvvmToolkit.Samples,代码行数:11,代码来源:Module.cs
示例8: TextExtGetDefaultValue
/// <summary>
/// Called once for each element in the time of accession to obtain default values.
/// </summary>
private static string TextExtGetDefaultValue(Label textBlock, IBindingMemberInfo bindingMemberInfo)
{
if (!ServiceProvider.DesignTimeManager.IsDesignMode)
ServiceProvider
.IocContainer
.Get<IToastPresenter>()
.ShowAsync("Invoking TextExtGetDefaultValue on " + textBlock.ClassId, ToastDuration.Short);
return "Default value";
}
开发者ID:Fezzer,项目名称:MugenMvvmToolkit.Samples,代码行数:12,代码来源:Module.cs
示例9: CreateLoadingOverlay
private static LoadingOverlay CreateLoadingOverlay(UIView uiView, IBindingMemberInfo bindingMemberInfo)
{
// Determine the correct size to start the overlay (depending on device orientation)
var bounds = UIScreen.MainScreen.Bounds; // portrait bounds
if (UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeLeft ||
UIApplication.SharedApplication.StatusBarOrientation == UIInterfaceOrientation.LandscapeRight)
{
bounds.Size = new CGSize(bounds.Size.Height, bounds.Size.Width);
}
return new LoadingOverlay(bounds);
}
开发者ID:dbeattie71,项目名称:MugenMvvmToolkit.Samples,代码行数:11,代码来源:TouchModule.cs
示例10: BindingPathMembersMock
public BindingPathMembersMock(object source, IBindingPath path, IBindingMemberInfo member)
{
Source = source;
PenultimateValue = source;
Path = path;
if (member == null || source == null)
{
AllMembersAvailable = false;
LastMember = BindingMemberInfo.Unset;
_members = Empty.Array<IBindingMemberInfo>();
}
else
{
AllMembersAvailable = true;
LastMember = member;
}
}
开发者ID:dbeattie71,项目名称:MugenMvvmToolkit,代码行数:17,代码来源:BindingPathMembersMock.cs
示例11: SetListViewSelectedItem
private static void SetListViewSelectedItem(IBindingMemberInfo bindingMemberInfo, ListView listView, object value)
{
//Clear selection
foreach (ListViewItem item in listView.SelectedItems)
{
item.Focused = false;
item.Selected = false;
}
if (value == null)
return;
foreach (ListViewItem item in listView.Items)
{
if (Equals(ViewManager.GetDataContext(item), value))
{
item.Focused = true;
item.Selected = true;
break;
}
}
}
开发者ID:Fezzer,项目名称:MugenMvvmToolkit.Samples,代码行数:20,代码来源:Module.cs
示例12: GetTargetValue
private object GetTargetValue(IBindingMemberInfo targetMember, IDataContext context, bool throwOnError)
{
object value = GetRawValueInternal(targetMember, context, throwOnError);
if (value.IsUnsetValueOrDoNothing())
return value;
if (_parameters.ConverterDelegate != null)
{
IBindingValueConverter converter = _parameters.ConverterDelegate(context);
if (converter != null)
{
CultureInfo culture = _parameters.ConverterCultureDelegate.GetValueOrDefault(context, CultureInfo.CurrentCulture);
object parameter = _parameters.ConverterParameterDelegate.GetValueOrDefault(context);
value = converter.ConvertBack(value, targetMember.Type, parameter, culture, context);
}
}
if (Equals(value, _parameters.TargetNullValue))
return null;
return value;
}
开发者ID:windygu,项目名称:MugenMvvmToolkit,代码行数:19,代码来源:BindingSourceAccessorBase.cs
示例13: GetSourceValue
private object GetSourceValue(IBindingMemberInfo targetMember, IDataContext context, bool throwOnError)
{
object value = GetRawValueInternal(targetMember, context, throwOnError);
if (value.IsDoNothing())
return BindingConstants.DoNothing;
if (_parameters.ConverterDelegate != null && !value.IsUnsetValue())
{
IBindingValueConverter converter = _parameters.ConverterDelegate(context);
if (converter != null)
{
CultureInfo culture = _parameters.ConverterCultureDelegate.GetValueOrDefault(context, CultureInfo.CurrentCulture);
object parameter = _parameters.ConverterParameterDelegate.GetValueOrDefault(context);
value = converter.Convert(value, targetMember.Type, parameter, culture, context);
}
}
if (value.IsUnsetValue())
value = _parameters.FallbackDelegate.GetValueOrDefault(context) ?? targetMember.Type.GetDefaultValue();
if (value == null)
return _parameters.TargetNullValue;
return value;
}
开发者ID:windygu,项目名称:MugenMvvmToolkit,代码行数:21,代码来源:BindingSourceAccessorBase.cs
示例14: GetRawValueInternal
/// <summary>
/// Gets the raw value from source.
/// </summary>
protected abstract object GetRawValueInternal(IBindingMemberInfo targetMember, IDataContext context,
bool throwOnError);
开发者ID:windygu,项目名称:MugenMvvmToolkit,代码行数:5,代码来源:BindingSourceAccessorBase.cs
示例15: GetValueInternal
/// <summary>
/// Gets the source value.
/// </summary>
protected virtual object GetValueInternal(IBindingMemberInfo targetMember, IDataContext context,
bool throwOnError)
{
if (_parameters == null)
return GetRawValueInternal(targetMember, context, throwOnError);
if (_isTarget)
return GetTargetValue(targetMember, context, throwOnError);
return GetSourceValue(targetMember, context, throwOnError);
}
开发者ID:windygu,项目名称:MugenMvvmToolkit,代码行数:12,代码来源:BindingSourceAccessorBase.cs
示例16: GetValue
/// <summary>
/// Gets the source value.
/// </summary>
/// <param name="targetMember">The specified member to set value.</param>
/// <param name="context">The specified operation context.</param>
/// <param name="throwOnError">
/// true to throw an exception if the value cannot be obtained; false to return
/// <see cref="BindingConstants.InvalidValue" /> if the value cannot be obtained.
/// </param>
public object GetValue(IBindingMemberInfo targetMember, IDataContext context, bool throwOnError)
{
try
{
var value = GetValueInternal(targetMember, context, throwOnError);
if (value.IsUnsetValue())
return targetMember.Type.GetDefaultValue();
return value;
}
catch (Exception)
{
if (throwOnError)
throw;
return BindingConstants.InvalidValue;
}
}
开发者ID:windygu,项目名称:MugenMvvmToolkit,代码行数:25,代码来源:BindingSourceAccessorBase.cs
示例17: ObserveTextTextBlock
private static IDisposable ObserveTextTextBlock(IBindingMemberInfo bindingMemberInfo, TextBlock textBlock, IEventListener arg3)
{
#if WINDOWS_UWP
return DependencyPropertyBindingMember.ObserveProperty(textBlock, TextBlock.TextProperty, arg3);
#else
return new DependencyPropertyBindingMember.DependencyPropertyListener(textBlock, "Text", arg3);
#endif
}
开发者ID:MuffPotter,项目名称:MugenMvvmToolkit,代码行数:8,代码来源:PlatformDataBindingModule.cs
示例18: ObserveParentMember
private static IDisposable ObserveParentMember(IBindingMemberInfo bindingMemberInfo, FrameworkElement o, IEventListener arg3)
{
return ParentObserver.GetOrAdd(o).AddWithUnsubscriber(arg3);
}
开发者ID:MuffPotter,项目名称:MugenMvvmToolkit,代码行数:4,代码来源:PlatformDataBindingModule.cs
示例19: SetParentValue
private static void SetParentValue(IBindingMemberInfo bindingMemberInfo, FrameworkElement frameworkElement, object arg3)
{
ParentObserver.GetOrAdd(frameworkElement).Parent = arg3;
}
开发者ID:MuffPotter,项目名称:MugenMvvmToolkit,代码行数:4,代码来源:PlatformDataBindingModule.cs
示例20: GetParentValue
private static object GetParentValue(IBindingMemberInfo bindingMemberInfo, FrameworkElement target)
{
return ParentObserver.GetOrAdd(target).Parent;
}
开发者ID:MuffPotter,项目名称:MugenMvvmToolkit,代码行数:4,代码来源:PlatformDataBindingModule.cs
注:本文中的IBindingMemberInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论