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


C# DependencyObject.GetAttachedProperty方法代码示例

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


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

示例1: GetRightAttachedProperty_NoCreate

 public static AbstractProperty GetRightAttachedProperty_NoCreate(DependencyObject targetObject)
 {
   return targetObject.GetAttachedProperty(RIGHT_ATTACHED_PROPERTY);
 }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:4,代码来源:Canvas.cs

示例2: GetBottomAttachedProperty_NoCreate

 public static AbstractProperty GetBottomAttachedProperty_NoCreate(DependencyObject targetObject)
 {
   return targetObject.GetAttachedProperty(BOTTOM_ATTACHED_PROPERTY);
 }
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:4,代码来源:Canvas.cs

示例3: GetStateSlotAttachedProperty

 /// <summary>
 /// Returns the attached property instance for the <c>WorkflowContext.StateSlot</c> property.
 /// </summary>
 /// <remarks>
 /// <para>
 /// If the <c>WorkflowContext.StateSlot</c> property is set to a context name for a UI element, that element and
 /// all its children will save their state in the current MediaPortal 2 workflow navigation context in the context variable of
 /// the given name when the current screen is quit and restore the state when the screen is reloaded for the same
 /// workflow navigation context.
 /// </para>
 /// <para>
 /// The usage is like this:
 /// <example>
 /// <code>
 /// &lt;ListView
 ///     xmlns:mp_special_workflow="clr-namespace:MediaPortal.UI.SkinEngine.SpecialElements.Workflow;assembly=SkinEngine"
 ///     ...
 ///     mp_special_workflow:WorkflowContext.StateSlot="MainMenu"&gt;
 ///   ...
 /// &lt;/ListView&gt;
 /// </code>
 /// </example>
 /// </para>
 /// </remarks>
 /// <param name="targetObject">The object whose attached property should be returned.</param>
 /// <returns>Attached <c>SaveState</c> property.</returns>
 public static AbstractProperty GetStateSlotAttachedProperty(DependencyObject targetObject)
 {
   AbstractProperty result = targetObject.GetAttachedProperty(STATE_SLOT_ATTACHED_PROPERTY);
   if (result != null)
     return result;
   result = targetObject.GetOrCreateAttachedProperty(STATE_SLOT_ATTACHED_PROPERTY, string.Empty);
   IWorkflowManager workflowManager = ServiceRegistration.Get<IWorkflowManager>();
   // We save the workflow navigation context at the time when this attached property is requested because that is the time when
   // the navigation context is the right one for the current screen. At the time when the Screen.HIDE_EVENT is raised,
   // the navigation context has already moved to the next state.
   NavigationContext context = workflowManager.CurrentNavigationContext;
   result.Attach((prop, oldVal) => OnStateSlotChanged(targetObject, context, (string) prop.GetValue()));
   return result;
 }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:40,代码来源:WorkflowContext.cs


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