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


C# Documents.Adorner类代码示例

本文整理汇总了C#中System.Windows.Documents.Adorner的典型用法代码示例。如果您正苦于以下问题:C# Adorner类的具体用法?C# Adorner怎么用?C# Adorner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Adorner类属于System.Windows.Documents命名空间,在下文中一共展示了Adorner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResizeThumb_DragStarted

        private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
        {
            this.designerItem = this.DataContext as ContentControl;

            if (this.designerItem != null)
            {
                this.canvas = VisualTreeHelper.GetParent(this.designerItem) as ContentPresenter;

                if (this.canvas != null)
                {
                    this.transformOrigin = this.designerItem.RenderTransformOrigin;

                    this.rotateTransform = this.designerItem.RenderTransform as RotateTransform;
                    if (this.rotateTransform != null)
                    {
                        this.angle = this.rotateTransform.Angle * Math.PI / 180.0;
                    }
                    else
                    {
                        this.angle = 0.0d;
                    }

                    AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.canvas);
                    if (adornerLayer != null)
                    {
                        this.adorner = new SizeAdorner(this.designerItem);
                        adornerLayer.Add(this.adorner);
                    }
                }
            }
        }
开发者ID:nakioman,项目名称:furryrun-editor,代码行数:31,代码来源:ResizeThumb.cs

示例2: item_OnDragStart

 private void item_OnDragStart(Adorner adorner)
 {
     if (OnDragStart != null)
     {
         OnDragStart(adorner);
     }
 }
开发者ID:marquinio007,项目名称:Touchmote,代码行数:7,代码来源:KeymapOutputRow.xaml.cs

示例3: ShowAdorner

        public void ShowAdorner()
        {
            if (this.adorner == null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                if (adornerLayer != null)
                {
                    ContentControl element = this.DataContext as ContentControl;
                    Canvas canvas = VisualTreeHelper.GetParent(element) as Canvas;
                    this.adorner = new ResizeAdorner(element);
                    adornerLayer.Add(this.adorner);
                    if (this.ShowDecorator)
                    {
                        this.adorner.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        this.adorner.Visibility = Visibility.Hidden;
                    }
                }
            }
            else
            {
                this.adorner.Visibility = Visibility.Visible;
            }
        }
开发者ID:AaronRevilla,项目名称:TT_2012b-049_ComputerGraphics,代码行数:27,代码来源:ResizeDecorator.cs

示例4: OnLoaded

 private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
 {
     canvas = this.GetVisualChild<Canvas>();
     adornerlayer = AdornerLayer.GetAdornerLayer(this);
     var designableDragAndResizeChrome = new DesignableResizeChrome(selection);
     selectionAdorner = new DesignableResizeAdorner(canvas, selection, designableDragAndResizeChrome);
 }
开发者ID:modulexcite,项目名称:Glass-Legacy,代码行数:7,代码来源:Designer.cs

示例5: AssertTemplatedAdornerTypee

 private static void AssertTemplatedAdornerTypee(Adorner adorner, [CallerMemberName] string caller = null)
 {
     if (adorner?.GetType() != TemplatedAdornerType)
     {
         throw new InvalidOperationException($"{caller} can only be called on {TemplatedAdornerType}");
     }
 }
开发者ID:JohanLarsson,项目名称:Gu.Wpf.Adorners,代码行数:7,代码来源:TemplatedAdorner.cs

示例6: ShowAdorner

        private void ShowAdorner()
        {
            if (this.adorner == null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                if (adornerLayer != null)
                {
                    ContentControl designerItem = this.DataContext as ContentControl;
                    Canvas canvas = VisualTreeHelper.GetParent(designerItem) as Canvas;
                    this.adorner = new ResizeRotateAdorner(designerItem);
                    adornerLayer.Add(this.adorner);

                    if (this.ShowDecorator)
                    {
                        this.adorner.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        this.adorner.Visibility = Visibility.Hidden;
                    }
                }
            }
            else
            {
                this.adorner.Visibility = Visibility.Visible;
            }
        }
开发者ID:nakioman,项目名称:furryrun-editor,代码行数:28,代码来源:DesignerItemDecorator.cs

示例7: ShowAdorner

        private void ShowAdorner()
        {
            if (adorner == null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);

                if (adornerLayer != null)
                {
                    ContentControl designerItem = this.DataContext as ContentControl;
                    Canvas canvas = Algorithm.FindVisualParent<Canvas>(designerItem);
                    adorner = new DesignerItemAdorner(designerItem,new ResizeRotateControl());
                    adornerLayer.Add(adorner);

                    if (ShowDecorator)
                    {
                        adorner.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        adorner.Visibility = Visibility.Collapsed;
                    }
                }
            }
            else
            {
                adorner.Visibility = Visibility.Visible;
            }
        }
开发者ID:huangjia2107,项目名称:MouseRegion,代码行数:28,代码来源:DesignerItemDecorator.cs

示例8: item_OnDragStop

 private void item_OnDragStop(Adorner adorner)
 {
     if (OnDragStop != null)
     {
         OnDragStop(adorner);
     }
 }
开发者ID:marquinio007,项目名称:Touchmote,代码行数:7,代码来源:KeymapOutputRow.xaml.cs

示例9: AdorneredTooltip

        public AdorneredTooltip(Adorner adorner, bool adornerLayerVisible)
        {
            Argument.IsNotNull(() => adorner);

            _adornerLayerVisible = adornerLayerVisible;
            _adorner = adorner;
            _visible = _adorner.Visibility == Visibility.Visible;
        }
开发者ID:icygit,项目名称:Orchestra,代码行数:8,代码来源:AdorneredTooltip.cs

示例10: Add

        public void Add(FrameworkElement parentControl, Adorner tooltip, bool adornerLayerVisibility)
        {
            if (!Contains(parentControl))
            {
                CreateAdornersList(parentControl);
            }

            GetAdorners(parentControl).Add(_factory.Create(tooltip, adornerLayerVisibility));
        }
开发者ID:icygit,项目名称:Orchestra,代码行数:9,代码来源:AdorneredTooltipsCollection.cs

示例11: ResizeDecorator_Unloaded

 private void ResizeDecorator_Unloaded(object sender, RoutedEventArgs e)
 {
     if (_adorner != null)
     {
         AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
         if (adornerLayer != null)
             adornerLayer.Remove(_adorner);
         _adorner = null;
     }
 }
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:10,代码来源:ResizeDecorator.cs

示例12: ResizeThumb_DragCompleted

        private void ResizeThumb_DragCompleted(object sender, DragCompletedEventArgs e)
        {
            if (adorner != null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this.canvas);
                if (adornerLayer != null)
                {
                    adornerLayer.Remove(this.adorner);
                }

                adorner = null;
            }
        }
开发者ID:benneeh,项目名称:wScreenshot,代码行数:13,代码来源:ResizeThumb.cs

示例13: DesignerItemDecorator_Unloaded

        private void DesignerItemDecorator_Unloaded(object sender, RoutedEventArgs e)
        {
            if (this.adorner != null)
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(this);
                if (adornerLayer != null)
                {
                    adornerLayer.Remove(this.adorner);
                }

                this.adorner = null;
            }
        }
开发者ID:jgkim999,项目名称:WpfExample,代码行数:13,代码来源:DesignerItemDecorator.cs

示例14: dc_PropertyChanged

 void dc_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "LeftPictureLocation")
     {
         var doesThisWork = VisualTreeHelper.GetChild(leftItemsControl, 0);
         var doesThisWorkt = VisualTreeHelper.GetChild(doesThisWork, 0);
         var doesThisWorktt = VisualTreeHelper.GetChild(doesThisWorkt, 0);
         canvasToTouch = (Canvas)doesThisWorktt;
         myAdornerLayer = AdornerLayer.GetAdornerLayer((Visual)doesThisWorktt);
         ad = new SimpleCircleAdorner((UIElement)doesThisWorktt);
         myAdornerLayer.Add(ad);
         myAdornerLayer.IsHitTestVisible = false;
     }
 }
开发者ID:millertrevor,项目名称:visionexperiments,代码行数:14,代码来源:MainWindow.xaml.cs

示例15: Show

 private static void Show(Adorner adorner, bool retry)
 {
     var adornerLayer = AdornerLayer.GetAdornerLayer(adorner.AdornedElement);
     if (adornerLayer != null)
     {
         ////Debug.WriteLine(nameof(Show));
         adornerLayer.Remove(adorner);
         adornerLayer.Add(adorner);
     }
     else if (retry)
     {
         // try again later, perhaps giving layout a chance to create the adorner layer
         adorner.Dispatcher.BeginInvoke(
             DispatcherPriority.Loaded,
             new DispatcherOperationCallback(ShowAdornerOperation),
             new object[] { adorner });
     }
 }
开发者ID:JohanLarsson,项目名称:Gu.Wpf.Adorners,代码行数:18,代码来源:AdornerService.cs


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