• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Primitives.Thumb类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: BuildAdornerCorner

        private Thumb BuildAdornerCorner(Cursor cursor, DragDeltaEventHandler dragHandler)
        {
            var thumb = new Thumb();

            // TODO: this thumb should be styled to look like a dotted triangle, 
            // similar to the one you can see on the bottom right corner of 
            // Internet Explorer window
            thumb.Cursor = cursor;
            thumb.Height = thumb.Width = 10;
            thumb.Opacity = 0.40;
            thumb.Background = new SolidColorBrush(Colors.MediumBlue);
            thumb.DragDelta += dragHandler;
            thumb.DragStarted += (s, e) =>
            {
                var handler = ResizeStarted;
                if (handler != null)
                {
                    handler(this, e);
                }
            };
            thumb.DragCompleted += (s, e) =>
            {
                var handler = ResizeCompleted;
                if (handler != null)
                {
                    handler(this, e);
                }
            };
            _visualChildren.Add(thumb);
            return thumb;
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:31,代码来源:ResizingAdorner.cs


示例2: ZoomSliderControl

        public ZoomSliderControl(BIT.AVL.Silver.Map.Map map)
        {
            _Map = map;
            DefaultStyleKey = typeof(ZoomSliderControl);

            if(HtmlPage.IsEnabled)
            {
                _Thumb = new Thumb();
                _Slider = this;

                // Slider Events
                _Slider.GotFocus += Slider_GotFocus;
                _Slider.LostFocus += Slider_LostFocus;
                _Slider.ValueChanged += ZoomControl_ValueChanged;

                // Map Events
                _Map.Events.MapMouseEnter += Events_MapMouseEnter;
                _Map.Events.MapMouseLeave += Events_MapMouseLeave;
                _Map.Events.MapZoomStarted += Events_MapZoomStarted;
                _Map.Events.MapZoomEnded += Events_MapZoomEnded;
                _Map.Events.MapZoomChanged += Events_MapZoomChanged;
                _Map.Events.MapMouseWheel += Events_MapMouseWheel;
                _Map.Events.MapDoubleClick += Events_MapDoubleClick;
                _Map.Events.MapTileSourceChanged += Events_MapTileSourceChanged;

                SetTileSourceZoomLevels();
                _UpdateSlider = true;
            }
        }
开发者ID:naimheshmati,项目名称:Sanofi,代码行数:29,代码来源:ZoomSliderControl.cs


示例3: OnApplyTemplate

        /// <internalonly />
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _horizontalThumb = GetTemplateChild("HorizontalThumb") as Thumb;
            _verticalThumb = GetTemplateChild("VerticalThumb") as Thumb;

            FrameworkElement leftTracker = GetTemplateChild("LeftTrack") as FrameworkElement;
            FrameworkElement rightTracker = GetTemplateChild("RightTrack") as FrameworkElement;
            if (leftTracker != null) {
                leftTracker.MouseLeftButtonDown += OnHorizontalTrackerMouseDown;
            }
            if (rightTracker != null) {
                rightTracker.MouseLeftButtonDown += OnHorizontalTrackerMouseDown;
            }

            FrameworkElement topTracker = GetTemplateChild("TopTrack") as FrameworkElement;
            FrameworkElement bottomTracker = GetTemplateChild("BottomTrack") as FrameworkElement;
            if (topTracker != null) {
                topTracker.MouseLeftButtonDown += OnVerticalTrackerMouseDown;
            }
            if (bottomTracker != null) {
                bottomTracker.MouseLeftButtonDown += OnVerticalTrackerMouseDown;
            }
        }
开发者ID:nikhilk,项目名称:silverlightfx,代码行数:26,代码来源:XSlider.cs


示例4: OnApplyTemplate

        public override void OnApplyTemplate() {
            base.OnApplyTemplate();

            if (_thumb != null) {
                _thumb.DragDelta -= Thumb_DragDelta;
                _thumb.DragStarted -= Thumb_DragStarted;
                _thumb.DragCompleted -= Thumb_DragCompleted;
            }

            if (_wrapper != null) {
                _wrapper.MouseWheel -= Wrapper_MouseWheel;
            }

            _thumb = GetTemplateChild(@"PART_Thumb") as Thumb;
            _wrapper = GetTemplateChild(@"PART_Wrapper") as FrameworkElement;

            if (_thumb != null) {
                _thumb.DragDelta += Thumb_DragDelta;
                _thumb.DragStarted += Thumb_DragStarted;
                _thumb.DragCompleted += Thumb_DragCompleted;
            }

            if (_wrapper != null) {
                _wrapper.MouseWheel += Wrapper_MouseWheel;
            }
        }
开发者ID:gro-ove,项目名称:actools,代码行数:26,代码来源:QuickSwitchSlider.cs


示例5: OnApplyTemplate

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            Thumb left = GetTemplateChild("PART_LeftResizer") as Thumb;
            if (left != null)
            {
                PART_LeftResizer = left;
                PART_LeftResizer.DragDelta += Resizer_DragDelta;
                //PART_LeftResizer.MouseDown += (s,e) => Kernel.RunMxs("disableSceneRedraw()");
                //PART_LeftResizer.MouseUp += (s, e) => Kernel.RunMxs("enableSceneRedraw()");
                PART_LeftResizer.MouseUp += (s, e) => Width = PART_ResizeIndicator.ActualWidth;
            }

            Thumb right = GetTemplateChild("PART_RightResizer") as Thumb;
            if (right != null)
            {
                PART_RightResizer = right;
                PART_RightResizer.DragDelta += Resizer_DragDelta;
                PART_RightResizer.MouseUp += (s, e) => Width = PART_ResizeIndicator.ActualWidth;
            }

            Rectangle rect = GetTemplateChild("PART_ResizeIndicator") as Rectangle;
            if (rect != null)
            {
                PART_ResizeIndicator = rect;
            }
        }
开发者ID:Sugz,项目名称:SugzTools,代码行数:28,代码来源:SgzToolBar.cs


示例6: OnApplyTemplate

        public override void OnApplyTemplate() {

            dragThumb = (Thumb) Template.FindName("PART_DragThumb", this);
            dragThumb.DragDelta += DragThumbOnDragDelta;

            base.OnApplyTemplate();
        }
开发者ID:modulexcite,项目名称:Glass-Legacy,代码行数:7,代码来源:DragControl.cs


示例7: DefaultMethods

		public void DefaultMethods ()
		{
			Thumb t = new Thumb ();
			t.CancelDrag ();
			t.OnApplyTemplate ();
			ControlTest.CheckDefaultMethods (t);
		}
开发者ID:dfr0,项目名称:moon,代码行数:7,代码来源:ThumbTest.cs


示例8: ConnectByArrow

        /// <summary>
        ///     Creates an arrow (line and head) and connects two Thumbs in the given canvas
        /// </summary>
        /// <param name="canvas"></param>
        /// <param name="startElement"></param>
        /// <param name="destinationElement"></param>
        /// <param name="headWidth"></param>
        /// <param name="headHeight"></param>
        /// <author>Krystian Zielonka,Thomas Meents</author>
        protected void ConnectByArrow(Canvas canvas, Thumb startElement, Thumb destinationElement, int headWidth = 10,
            int headHeight = 4)
        {
            // Create the arrow
            Arrow arrow = new Arrow(startElement, destinationElement)
            {
                HeadWidth = headWidth,
                HeadHeight = headHeight,
                Stroke = Settings.Default.DefaultStrokeColor,
                StrokeThickness = Settings.Default.DefaultStrokeThickness
            };

            Binding x1 = new Binding();
            Binding x2 = new Binding();
            Binding y1 = new Binding();
            Binding y2 = new Binding();
            x1.Path = new PropertyPath(Canvas.LeftProperty);
            x2.Path = new PropertyPath(Canvas.LeftProperty);
            y1.Path = new PropertyPath(Canvas.TopProperty);
            y2.Path = new PropertyPath(Canvas.TopProperty);
            x1.Source = startElement;
            y1.Source = startElement;
            x2.Source = destinationElement;
            y2.Source = destinationElement;
            arrow.SetBinding(Arrow.X1Property, x1);
            arrow.SetBinding(Arrow.Y1Property, y1);
            arrow.SetBinding(Arrow.X2Property, x2);
            arrow.SetBinding(Arrow.Y2Property, y2);

            // Add the arrow to the canvas
            canvas.Children.Add(arrow);
        }
开发者ID:ThomasMeents,项目名称:ProcessCubeExplorer,代码行数:41,代码来源:AbstractProcessModelVisualizer.cs


示例9: OnApplyTemplate

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (this.ScrollViewer == null)
                return;

            this.designerCanvas = this.ScrollViewer.Content as DesignerCanvas;
            if (this.designerCanvas == null)
                throw new Exception("DesignerCanvas must not be null!");

            this.zoomThumb = Template.FindName("PART_ZoomThumb", this) as Thumb;
            if (this.zoomThumb == null)
                throw new Exception("PART_ZoomThumb template is missing!");

            this.zoomCanvas = Template.FindName("PART_ZoomCanvas", this) as Canvas;
            if (this.zoomCanvas == null)
                throw new Exception("PART_ZoomCanvas template is missing!");

            this.zoomSlider = Template.FindName("PART_ZoomSlider", this) as Slider;
            if (this.zoomSlider == null)
                throw new Exception("PART_ZoomSlider template is missing!");

            this.designerCanvas.LayoutUpdated += new EventHandler(this.DesignerCanvas_LayoutUpdated);

            this.zoomThumb.DragDelta += new DragDeltaEventHandler(this.Thumb_DragDelta);

            this.zoomSlider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(this.ZoomSlider_ValueChanged);

            this.scaleTransform = new ScaleTransform();
            this.designerCanvas.LayoutTransform = this.scaleTransform;
        }
开发者ID:jgkim999,项目名称:WpfExample,代码行数:32,代码来源:ZoomBox.cs


示例10: OnApplyTemplate

		public override void OnApplyTemplate() {
			base.OnApplyTemplate();
			_mThumb = GetTemplateChild("PART_Thumb") as Thumb;
			if (_mThumb == null) return;
			UpdateThumbPosition();
			_mThumb.RenderTransform = _mThumbTransform;
		}
开发者ID:CyberFoxHax,项目名称:PCSXBonus,代码行数:7,代码来源:HsvControl.cs


示例11: BuildResizeThumb

 void BuildResizeThumb(Style thumbStyle)
 {
     if (_cornerThumb == null)
     {
         _cornerThumb = new Thumb { Style = thumbStyle };
         _visualChildren.Add(_cornerThumb);
     }
 }
开发者ID:thlorenz,项目名称:WPFTricks,代码行数:8,代码来源:ResizeAdorner.cs


示例12: CompleteSinkMove

        private void CompleteSinkMove(Thumb thumb, DragCompletedEventArgs e)
        {
            var sink = thumb.DataContext as SinkViewModel;
            if (sink == null)
                return;

            sink.UpdateSinkPosition();
        }
开发者ID:efixe,项目名称:Engineering-Thesis-Project,代码行数:8,代码来源:BlueprintView.xaml.cs


示例13: OnApplyTemplate

		public override void OnApplyTemplate()
		{
			thumb = GetTemplateChild("PART_Thumb") as Thumb;

			thumb.DragDelta += new DragDeltaEventHandler(thumb_DragDelta);

			base.OnApplyTemplate();
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:8,代码来源:PropertyGridView.cs


示例14: CompleteNodeMove

        private void CompleteNodeMove(Thumb thumb, DragCompletedEventArgs e)
        {
            var node = thumb.DataContext as NodeElementViewModel;
            if (node == null)
                return;

            node.UpdateNodePosition();
        }
开发者ID:efixe,项目名称:Engineering-Thesis-Project,代码行数:8,代码来源:BlueprintView.xaml.cs


示例15: RotateThumbExtension

		public RotateThumbExtension()
		{
			adornerPanel = new AdornerPanel();
			adornerPanel.Order = AdornerOrder.Foreground;
			this.Adorners.Add(adornerPanel);
			
			thumb = CreateRotateThumb();
		}
开发者ID:QIWEB,项目名称:SharpDevelop,代码行数:8,代码来源:RotateThumbExtension.cs


示例16: ReadOnlyProperties

		public void ReadOnlyProperties ()
		{
			Thumb t = new Thumb ();
			Assert.Throws<InvalidOperationException> (delegate {
				t.SetValue (Thumb.IsDraggingProperty, true);
			}, "IsDraggingProperty");
			Assert.Throws<InvalidOperationException> (delegate {
				t.SetValue (Thumb.IsFocusedProperty, true);
			}, "IsFocusedProperty");
		}
开发者ID:dfr0,项目名称:moon,代码行数:10,代码来源:ThumbTest.cs


示例17: OnApplyTemplate

 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     this.m_thumb = base.GetTemplateChild("PART_Thumb") as Thumb;
     if (this.m_thumb != null)
     {
         this.UpdateThumbPosition();
         this.m_thumb.RenderTransform = this.m_thumbTransform;
     }
 }
开发者ID:CyberFoxHax,项目名称:PCSXBonus,代码行数:10,代码来源:HsvControl.cs


示例18: ModelOperationAdorner

 public ModelOperationAdorner(ModelItem adorned)
     : base(adorned)
 {
     collection = new VisualCollection(this);
     collection.Add(tl = GetResizeThumb("LT"));
     collection.Add(tr = GetResizeThumb("RT"));
     collection.Add(bl = GetResizeThumb("LB"));
     collection.Add(br = GetResizeThumb("RB"));
     collection.Add(handler = GetMoveThumb());
 }
开发者ID:kevinxw,项目名称:CIS681-Pr4,代码行数:10,代码来源:ModelOperationAdorner.cs


示例19: MyCanvasAdorner

 public MyCanvasAdorner(UIElement adorned)
     : base(adorned)
 {
     visCollec = new VisualCollection(this);
     visCollec.Add(tl = GetResizeThumb(Cursors.SizeNWSE, HorizontalAlignment.Left, VerticalAlignment.Top));
     visCollec.Add(tr = GetResizeThumb(Cursors.SizeNESW, HorizontalAlignment.Right, VerticalAlignment.Top));
     visCollec.Add(bl = GetResizeThumb(Cursors.SizeNESW, HorizontalAlignment.Left, VerticalAlignment.Bottom));
     visCollec.Add(br = GetResizeThumb(Cursors.SizeNWSE, HorizontalAlignment.Right, VerticalAlignment.Bottom));
     visCollec.Add(mov = GetMoveThumb());
 }
开发者ID:ZoeCheck,项目名称:WpfDemoCodes,代码行数:10,代码来源:MyAdorner.cs


示例20: GetTemplateChildren

 private void GetTemplateChildren()
 {
     _horizontalPanel = GetTemplateChild(TimelineTemplateParts.HorizontalTemplate) as Panel;
     _horizontalThumb = GetTemplateChild(TimelineTemplateParts.HorizontalThumb) as Thumb;
     _horizontalAvailableBar = GetTemplateChild(TimelineTemplateParts.HorizontalAvailableBar) as Border;
     _largeChangeIncreaseButton =
         GetTemplateChild(TimelineTemplateParts.HorizontalTrackLargeChangeDecreaseRepeatButton) as RepeatButton;
     _largeChangeDecreaseButton =
         GetTemplateChild(TimelineTemplateParts.HorizontalTrackLargeChangeIncreaseRepeatButton) as RepeatButton;
 }
开发者ID:Ginichen,项目名称:Silverlight-Player-for-PlayReady-with-Token-Auth,代码行数:10,代码来源:Timeline.TemplateDefinition.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Primitives.ToggleButton类代码示例发布时间:2022-05-26
下一篇:
C# Primitives.StatusBar类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap