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


C# UIElement.InternalSetOffsetWorkaround方法代码示例

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


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

示例1: InternalSetLayoutTransform

        /// <summary> 
        /// NOTE: THIS METHOD IS ONLY FOR INTERNAL SPECIFIC USE. It does not support some features of FrameworkElement,
        /// for example RenderTarnsfromOrigin and LayoutTransform. 
        /// 
        /// This is the method layout parent uses to set a location of the child
        /// relative to parent's visual as a result of layout. Typically, this is called 
        /// by the parent inside of its ArrangeOverride implementation. The transform passed into
        /// this method does not get combined with offset that is set by SetLayoutOffset, but rahter resets
        /// LayoutOffset to (0,0). Typically, layout parents use offset most of the time and only need to use this method instead if they need to introduce
        /// a non-trivial transform (including rotation or scale) between them and a layout child. 
        /// DO NOT name this SetLayoutTransform()!  The Xaml Compile may be fooled into thinking LayoutTransform is an attached property.
        /// </summary> 
        /// <param name="element">The element on which to set a transform.</param> 
        /// <param name="layoutTransform">The final transform of this element relative to its parent's visual.</param>
        internal static void InternalSetLayoutTransform(UIElement element, Transform layoutTransform) 
        {
            FrameworkElement fe = element as FrameworkElement;
            element.InternalSetOffsetWorkaround(new Vector());
 
            Transform additionalTransform = (fe == null ? null : fe.GetFlowDirectionTransform()); //rtl
 
            Transform renderTransform = element.RenderTransform; 
            if(renderTransform == Transform.Identity)
                renderTransform = null; 

            // Create a TransformCollection and make sure it does not participate
            // in the InheritanceContext treeness because it is internal operation only.
            TransformCollection ts = new TransformCollection(); 
            ts.CanBeInheritanceContext = false;
 
            if(additionalTransform != null) 
                ts.Add(additionalTransform);
 
            if(renderTransform != null)
                ts.Add(renderTransform);

            ts.Add(layoutTransform); 

            TransformGroup group = new TransformGroup(); 
            group.Children = ts; 

            element.InternalSetTransformWorkaround(group); 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:43,代码来源:FrameworkElement.cs

示例2: InternalSetLayoutTransform

 internal static void InternalSetLayoutTransform(UIElement element, Transform layoutTransform)
 {
     FrameworkElement frameworkElement = element as FrameworkElement;
       element.InternalSetOffsetWorkaround(new Vector());
       Transform transform1 = frameworkElement == null ? (Transform) null : frameworkElement.GetFlowDirectionTransform();
       Transform transform2 = element.RenderTransform;
       if (transform2 == Transform.Identity)
     transform2 = (Transform) null;
       TransformCollection transformCollection = new TransformCollection();
       transformCollection.CanBeInheritanceContext = false;
       if (transform1 != null)
     transformCollection.Add(transform1);
       if (transform2 != null)
     transformCollection.Add(transform2);
       transformCollection.Add(layoutTransform);
       element.InternalSetTransformWorkaround((Transform) new TransformGroup()
       {
     Children = transformCollection
       });
 }
开发者ID:jchristian,项目名称:ui_events,代码行数:20,代码来源:FrameworkElement.cs


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