本文整理汇总了C#中System.Windows.DependencyObject.GetValueOrRegisterParentNotifier方法的典型用法代码示例。如果您正苦于以下问题:C# DependencyObject.GetValueOrRegisterParentNotifier方法的具体用法?C# DependencyObject.GetValueOrRegisterParentNotifier怎么用?C# DependencyObject.GetValueOrRegisterParentNotifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.DependencyObject
的用法示例。
在下文中一共展示了DependencyObject.GetValueOrRegisterParentNotifier方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDictionary
/// <summary>
/// Get the dictionary from the context, if possible.
/// </summary>
/// <param name="target">The target object.</param>
/// <returns>The dictionary name, if available.</returns>
protected override string GetDictionary(DependencyObject target)
{
if (target == null)
return FallbackDictionary;
var dictionary = target.GetValueOrRegisterParentNotifier<string>(DefaultDictionaryProperty, ParentChangedAction, _parentNotifiers);
return String.IsNullOrEmpty(dictionary) ? FallbackDictionary : dictionary;
}
示例2: GetDictionary
/// <summary>
/// Get the dictionary from the context, if possible.
/// </summary>
/// <param name="target">The target object.</param>
/// <returns>The dictionary name, if available.</returns>
protected override string GetDictionary(DependencyObject target)
{
if (target == null)
return null;
return target.GetValueOrRegisterParentNotifier<string>(CSVEmbeddedLocalizationProvider.DefaultDictionaryProperty, ParentChangedAction, parentNotifiers);
}
示例3: GetAssembly
/// <summary>
/// Get the assembly from the context, if possible.
/// </summary>
/// <param name="target">The target object.</param>
/// <returns>The assembly name, if available.</returns>
protected override string GetAssembly(DependencyObject target)
{
if (target == null)
return FallbackAssembly;
var assembly = target.GetValueOrRegisterParentNotifier<string>(DefaultAssemblyProperty, ParentChangedAction, _parentNotifiers);
return String.IsNullOrEmpty(assembly) ? FallbackAssembly : assembly;
}
示例4: GetLocalizedObject
/// <summary>
/// Get the localized object using the given target for context information.
/// </summary>
/// <param name="key">The key to the value.</param>
/// <param name="target">The target <see cref="DependencyObject"/>.</param>
/// <param name="culture">The culture to use.</param>
/// <returns>The value corresponding to the source/dictionary/key path for the given culture (otherwise NULL).</returns>
public object GetLocalizedObject(string key, DependencyObject target, CultureInfo culture)
{
#if WINDOWS_PHONE
var provider = this.DefaultProvider;
#else
#if !SILVERLIGHT
if (this.DefaultProvider is InheritingResxLocalizationProvider)
return GetLocalizedObject(key, target, culture, this.DefaultProvider);
#endif
var provider = target != null ? target.GetValueOrRegisterParentNotifier(GetProvider, (obj) => { LocalizeDictionary.DictionaryEvent.Invoke(obj, new DictionaryEventArgs(DictionaryEventType.ProviderChanged, null)); }, parentNotifiers) : null;
if (provider == null)
provider = this.DefaultProvider;
#endif
return GetLocalizedObject(key, target, culture, provider);
}