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


C# VisualCollection类代码示例

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


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

示例1: ResizingAdorner

        /// <summary>
        /// Initialize the ResizingAdorner.
        /// </summary>
        /// <param name="adornedElement">The element to be adorned.</param>
        public ResizingAdorner(UIElement adornedElement)
            : base(adornedElement)
        {
            _visualChildren = new VisualCollection(this);

            //Creates the dashed rectangle around the adorned element.
            BuildAdornerBorder();

            //Call a helper method to initialize the Thumbs with a customized cursors.
            BuildAdornerCorner(ref _topLeft, Cursors.SizeNWSE);
            BuildAdornerCorner(ref _topRight, Cursors.SizeNESW);
            BuildAdornerCorner(ref _bottomLeft, Cursors.SizeNESW);
            BuildAdornerCorner(ref _bottomRight, Cursors.SizeNWSE);

            BuildAdornerCorner(ref _middleBottom, Cursors.SizeNS);
            BuildAdornerCorner(ref _middleTop, Cursors.SizeNS);
            BuildAdornerCorner(ref _leftMiddle, Cursors.SizeWE);
            BuildAdornerCorner(ref _rightMiddle, Cursors.SizeWE);

            //Add handlers for resizing • Corners
            _bottomLeft.DragDelta += HandleBottomLeft;
            _bottomRight.DragDelta += HandleBottomRight;
            _topLeft.DragDelta += HandleTopLeft;
            _topRight.DragDelta += HandleTopRight;

            //Add handlers for resizing • Sides
            _middleBottom.DragDelta += HandleBottomMiddle;
            _middleTop.DragDelta += HandleTopMiddle;
            _leftMiddle.DragDelta += HandleLeftMiddle;
            _rightMiddle.DragDelta += HandleRightMiddle;
        }
开发者ID:dbremner,项目名称:ScreenToGif,代码行数:35,代码来源:ResizingAdorner.cs

示例2: FileListLookupBoxAdorner

 public FileListLookupBoxAdorner(FrameworkElement adornedElement)
     : base(adornedElement)
 {
     _adornedElement = adornedElement;
     _visualChildren = new VisualCollection(this);
     BuildTextBox();
 }
开发者ID:kolan72,项目名称:QuickZip.IO.PIDL.UserControls,代码行数:7,代码来源:FileListLookupBoxAdorner.cs

示例3: EditBoxAdorner

        private VisualCollection _visualChildren; //visual children.

        #endregion Fields

        #region Constructors

        public EditBoxAdorner(EditBox editBox, UIElement adornedElement)
            : base(adornedElement)
        {
            _editBox = editBox;
            _visualChildren = new VisualCollection(this);
            BuildTextBox();
        }
开发者ID:Choi-Insu,项目名称:arrengers,代码行数:13,代码来源:EditBoxAdorner.cs

示例4: VisualHost

 public VisualHost()
 {
     _children = new VisualCollection(this);
     _points = new List<Point>();
     _edgePen.Freeze();
     _vertexPen.Freeze();
 }
开发者ID:tchief,项目名称:DrawPolygon,代码行数:7,代码来源:VIsualHost.cs

示例5: AutoCompleteTextBox

        public AutoCompleteTextBox()
        {
            controls = new VisualCollection(this);
            InitializeComponent();

            searchThreshold = 2;        // default threshold to 2 char

            // set up the key press timer
            keypressTimer = new System.Timers.Timer();
            keypressTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimedEvent);

            // set up the text box and the combo box
            comboBox = new ComboBox();
            comboBox.IsSynchronizedWithCurrentItem = true;
            comboBox.IsTabStop = false;
            comboBox.SelectionChanged += new SelectionChangedEventHandler(comboBox_SelectionChanged);

            textBox = new TextBox();
            textBox.TextChanged += new TextChangedEventHandler(textBox_TextChanged);
            textBox.VerticalContentAlignment = VerticalAlignment.Center;

            controls.Add(comboBox);
            controls.Add(textBox);

        }
开发者ID:TrinityCore-Manager,项目名称:TrinityCore-Manager-v3,代码行数:25,代码来源:AutoCompleteTextBox.xaml.cs

示例6: ResizeAdorner

 public ResizeAdorner(UIElement adornedElement)
     : base(adornedElement)
 {
     _visualChildren = new VisualCollection(this);
     _control = new ResizeControl {DataContext = adornedElement};
     _visualChildren.Add(_control);
 }
开发者ID:kib357,项目名称:IDS,代码行数:7,代码来源:ResizeAdorner.cs

示例7: AdornerLayer

 /// <summary>
 /// Initializes a new instance of the <see cref="AdornerLayer"/> class.
 /// </summary>
 /// <param name="uv">The Ultraviolet context.</param>
 /// <param name="name">The element's identifying name within its namescope.</param>
 public AdornerLayer(UltravioletContext uv, String name)
     : base(uv, name)
 {
     adorners = new VisualCollection(this);
     adornersStates = new List<AdornerState>();
     adornersTemp = new List<Adorner>();
 }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:12,代码来源:AdornerLayer.cs

示例8: PasswordBoxHintAdorner

        public PasswordBoxHintAdorner(UIElement adornedElement, string hintText, Style hintStyle, VisibilityDelegate visibilityCallback)
          : base(adornedElement)
        {
            _visibilityCallback = visibilityCallback;

            _label = new Label()
            {
                Content = hintText,
                Style = hintStyle,
            };

            IsHitTestVisible = true;
            Visibility = Visibility.Visible;

            adornedElement.GotFocus += Invalidate;
            adornedElement.LostFocus += Invalidate;
            adornedElement.IsVisibleChanged += Invalidate;

            _visualCollection = new VisualCollection(this);
            _contentPresenter = new ContentPresenter();
            _visualCollection.Add(_contentPresenter);
            _contentPresenter.Content = _label;

            AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(adornedElement);
            adornerLayer?.Add(this);

            IsHitTestVisible = false;
        }
开发者ID:Microsoft,项目名称:Git-Credential-Manager-for-Windows,代码行数:28,代码来源:PasswordBoxHintAdorner.cs

示例9: VisualAdorner

		public VisualAdorner(FrameworkElement adornerElement, UIElement adornedElement)
			: base(adornedElement) {
			children = new VisualCollection(this);
			child = adornerElement;
			children.Add(child);
			AddLogicalChild(child);
		}
开发者ID:rjmurillo,项目名称:Autofac-Visualizer,代码行数:7,代码来源:VisualAdorner.cs

示例10: SelectionAdorner

 public SelectionAdorner(UIElement adornedElement)
     : base(adornedElement)
 {
     IsClipEnabled = true;
     visualChildren = new VisualCollection(this);
     BuildAdornerCorner();
 }
开发者ID:Jo3-16,项目名称:FMA,代码行数:7,代码来源:SelectionAdorner.cs

示例11: HelperAdorner

        // Initialize the HelperAdorner.
        public HelperAdorner(UIElement adornedElement)
            : base(adornedElement)
        {
            visualChildren = new VisualCollection(this);

            adornedElement.RenderTransformOrigin = new Point(0.5, 0.5);
            // Call a helper method to initialize the Thumbs
            // with a customized cursors.
            BuildAdornerCorner(ref topLeft, Cursors.Hand);
            BuildAdornerCorner(ref topRight, Cursors.Hand);
            BuildAdornerCorner(ref bottomLeft, Cursors.Hand);
            BuildAdornerCorner(ref bottomRight, Cursors.Hand);
            BuildAdornerCorner(ref centerTop, Cursors.Hand);

            topLeft.DragStarted += new DragStartedEventHandler(this.ResizeThumb_DragStarted);
            topLeft.DragDelta += new DragDeltaEventHandler(this.ResizeThumb_DragDeltaTopLeft);

            topRight.DragStarted += new DragStartedEventHandler(this.ResizeThumb_DragStarted);
            topRight.DragDelta += new DragDeltaEventHandler(this.ResizeThumb_DragDeltaTopRight);

            bottomLeft.DragStarted += new DragStartedEventHandler(this.ResizeThumb_DragStarted);
            bottomLeft.DragDelta += new DragDeltaEventHandler(this.ResizeThumb_DragDeltaBottomLeft);

            bottomRight.DragStarted += new DragStartedEventHandler(this.ResizeThumb_DragStarted);
            bottomRight.DragDelta += new DragDeltaEventHandler(this.ResizeThumb_DragDeltaBottomRight);

            centerTop.DragDelta += new DragDeltaEventHandler(HandleCenterTop);
            centerTop.DragStarted += new DragStartedEventHandler(this.RotateThumb_DragStarted);
        }
开发者ID:leminhtu1204,项目名称:Editor,代码行数:30,代码来源:HelperAdorner.cs

示例12: ResizingAdorner

        // Phương thức khởi tạo
        public ResizingAdorner(UIElement adornedElement)
            : base(adornedElement)
        {
            visualChildren = new VisualCollection(this);

            // Khởi tạo các anchor point
            BuildAdorner(ref topLeft, Cursors.SizeNWSE);
            BuildAdorner(ref topRight, Cursors.SizeNESW);
            BuildAdorner(ref bottomLeft, Cursors.SizeNESW);
            BuildAdorner(ref bottomRight, Cursors.SizeNWSE);
            BuildAdorner(ref middleTop, Cursors.SizeNS);
            BuildAdorner(ref middleBottom, Cursors.SizeNS);
            BuildAdorner(ref middleLeft, Cursors.SizeWE);
            BuildAdorner(ref middleRight, Cursors.SizeWE);

            // Các sự kiện tương ứng với mỗi anchor point
            bottomLeft.DragDelta += new DragDeltaEventHandler(HandleBottomLeft);
            bottomRight.DragDelta += new DragDeltaEventHandler(HandleBottomRight);
            topLeft.DragDelta += new DragDeltaEventHandler(HandleTopLeft);
            topRight.DragDelta += new DragDeltaEventHandler(HandleTopRight);
            middleTop.DragDelta += new DragDeltaEventHandler(HandleMiddleTop);
            middleBottom.DragDelta += new DragDeltaEventHandler(HandleMiddleBottom);
            middleLeft.DragDelta += new DragDeltaEventHandler(HandleMiddleLeft);
            middleRight.DragDelta += new DragDeltaEventHandler(HandleMiddleRight);
        }
开发者ID:npke,项目名称:my-paint-windows,代码行数:26,代码来源:ResizingAdorner.cs

示例13: ResizeAdorner

        public ResizeAdorner(PanelDesigner panelDesigner, UIElement adornedElement)
            : base(adornedElement)
        {
            m_panelDesigner = panelDesigner;
            m_panelDesigner.SelectedElementChanged += m_panelDesigner_SelectedElementChanged;
            m_visualChildren = new VisualCollection(this);

            m_rectangle = new Rectangle();
            m_rectangle.Stroke = m_panelDesigner.SelectedElement == AdornedElement ? Brushes.CornflowerBlue : Brushes.LightBlue;
            m_rectangle.StrokeThickness = 1;
            m_visualChildren.Add(m_rectangle);

            BuildResizeAdorner(ref m_bottom, Cursors.SizeNS);
            BuildResizeAdorner(ref m_bottomLeft, Cursors.SizeNESW);
            BuildResizeAdorner(ref m_bottomRight, Cursors.SizeNWSE);
            BuildResizeAdorner(ref m_left, Cursors.SizeWE);
            BuildResizeAdorner(ref m_right, Cursors.SizeWE);
            BuildResizeAdorner(ref m_top, Cursors.SizeNS);
            BuildResizeAdorner(ref m_topLeft, Cursors.SizeNWSE);
            BuildResizeAdorner(ref m_topRight, Cursors.SizeNESW);

            m_bottom.DragDelta += new DragDeltaEventHandler(HandleBottom);
            m_bottomLeft.DragDelta += new DragDeltaEventHandler(HandleBottomLeft);
            m_bottomRight.DragDelta += new DragDeltaEventHandler(HandleBottomRight);
            m_left.DragDelta += new DragDeltaEventHandler(HandleLeft);
            m_right.DragDelta += new DragDeltaEventHandler(HandleRight);
            m_top.DragDelta += new DragDeltaEventHandler(HandleTop);
            m_topLeft.DragDelta += new DragDeltaEventHandler(HandleTopLeft);
            m_topRight.DragDelta += new DragDeltaEventHandler(HandleTopRight);
        }
开发者ID:nordleif,项目名称:PanelDesigner,代码行数:30,代码来源:ResizeAdorner.cs

示例14: AdornerContentPresenter

 public AdornerContentPresenter (UIElement adornedElement)
     : base(adornedElement)
 {
     _Visuals = new VisualCollection(this);
     _ContentPresenter = new ContentPresenter();
     _Visuals.Add(_ContentPresenter);
 }
开发者ID:BdGL3,项目名称:CXPortal,代码行数:7,代码来源:AdornerContentPresenter.cs

示例15: AutoCompleteTextBox

        public AutoCompleteTextBox()
        {
            _controls = new VisualCollection(this);
            InitializeComponent();

            _autoCompletionList = new ObservableCollection<AutoCompleteEntry>();
            _searchThreshold = 2;        // default threshold to 2 char

            // set up the key press timer
            _keypressTimer = new System.Timers.Timer();
            _keypressTimer.Elapsed += OnTimedEvent;

            // set up the text box and the combo box
            ComboBox = new ComboBox
            {
                IsSynchronizedWithCurrentItem = true,
                IsTabStop = false
            };

            ComboBox.SelectionChanged += comboBox_SelectionChanged;

            _textBox = new TextBox();
            _textBox.TextChanged += textBox_TextChanged;
            _textBox.VerticalContentAlignment = VerticalAlignment.Center;

            _controls.Add(ComboBox);
            _controls.Add(_textBox);
        }
开发者ID:atom0s,项目名称:Campah,代码行数:28,代码来源:AutoCompleteTextBox.xaml.cs


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