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


C# Thumb.ApplyTemplate方法代码示例

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


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

示例1: CreatePointErapseDst

        private void CreatePointErapseDst(Canvas canvas_image)
        {
            Line line1 = new Line();
            line1.Stroke = new SolidColorBrush(this.MainColor);
            line1.StrokeThickness = 1;

            Line line2 = new Line();
            line2.Stroke = new SolidColorBrush(this.MainColor);
            line2.StrokeThickness = 1;

            Line line3 = new Line();
            line3.Stroke = new SolidColorBrush(this.MainColor);
            line3.StrokeThickness = 1;

            Line line4 = new Line();
            line4.Stroke = new SolidColorBrush(this.MainColor);
            line4.StrokeThickness = 1;


            Thumb mark1 = new Thumb();
            mark1.Template = (ControlTemplate)App.Current.Resources["ThumbEllipseTemplate"];
            mark1.Background = new SolidColorBrush(Colors.Transparent);
            mark1.BorderBrush = new SolidColorBrush(this.MainColor);
            mark1.ApplyTemplate();
            mark1.Width = m_EllipseSize;
            mark1.Height = m_EllipseSize;
            mark1.DragDelta += mark_DragDelta;

            Thumb mark2 = new Thumb();
            mark2.Template = (ControlTemplate)App.Current.Resources["ThumbEllipseTemplate"];
            mark2.Background = new SolidColorBrush(Colors.Transparent);
            mark2.BorderBrush = new SolidColorBrush(this.MainColor);
            mark2.Width = m_EllipseSize;
            mark2.Height = m_EllipseSize;
            mark2.DragDelta += mark_DragDelta;

            Thumb mark3 = new Thumb();
            mark3.Template = (ControlTemplate)App.Current.Resources["ThumbEllipseTemplate"];
            mark3.Background = new SolidColorBrush(Colors.Transparent);
            mark3.BorderBrush = new SolidColorBrush(this.MainColor);
            mark3.Width = m_EllipseSize;
            mark3.Height = m_EllipseSize;
            mark3.DragDelta += mark_DragDelta;

            Thumb mark4 = new Thumb();
            mark4.Template = (ControlTemplate)App.Current.Resources["ThumbEllipseTemplate"];
            mark4.Background = new SolidColorBrush(Colors.Transparent);
            mark4.BorderBrush = new SolidColorBrush(this.MainColor);
            mark4.Width = m_EllipseSize;
            mark4.Height = m_EllipseSize;
            mark4.DragDelta += mark_DragDelta;

            this.DstMarkList.Add(mark1);
            this.DstMarkList.Add(mark2);
            this.DstMarkList.Add(mark3);
            this.DstMarkList.Add(mark4);
            this.DstLineList.Add(line1);
            this.DstLineList.Add(line2);
            this.DstLineList.Add(line3);
            this.DstLineList.Add(line4);


            canvas_image.Children.Add(mark1);
            canvas_image.Children.Add(mark2);
            canvas_image.Children.Add(mark3);
            canvas_image.Children.Add(mark4);
            canvas_image.Children.Add(line1);
            canvas_image.Children.Add(line2);
            canvas_image.Children.Add(line3);
            canvas_image.Children.Add(line4);

            Canvas.SetLeft(mark1, 0);
            Canvas.SetTop(mark1, 0);
            Canvas.SetLeft(mark2, 0);
            Canvas.SetTop(mark2, 0);
            Canvas.SetLeft(mark3, 0);
            Canvas.SetTop(mark3, 0);
            Canvas.SetLeft(mark4, 0);
            Canvas.SetTop(mark4, 0);
        }
开发者ID:0tsukq,项目名称:LabLife,代码行数:80,代码来源:Transporter.cs


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