當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。