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


C# Thumb.SetValue方法代码示例

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


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

示例1: 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

示例2: ModelThumbRect

 public ModelThumbRect(double posX, double posY, double w, double h)
 {
     myPath = new Thumb
     {
         Cursor = Cursors.SizeNWSE,
         Opacity = 1,
         Height = w,
         Width = w,
         Background = Brushes.Violet,
         BorderBrush = Brushes.Transparent,
         HorizontalAlignment = HorizontalAlignment.Left,
         VerticalAlignment = VerticalAlignment.Top,
         Margin = new Thickness(w + 5, h + 5, w + 5 - w, h + 5 - h),
     };
     myPath.SetValue(Canvas.LeftProperty, posX-w);
     myPath.SetValue(Canvas.TopProperty, posY-h);
 }
开发者ID:redliontom,项目名称:SWP2,代码行数:17,代码来源:ModelThumbRect.cs

示例3: SetPopupToMove

 public static void SetPopupToMove(Thumb thumb, Popup value)
 {
     thumb.SetValue(PopupToMoveProperty, value);
 }
开发者ID:grarup,项目名称:SharpE,代码行数:4,代码来源:PopupHelper.cs

示例4: SetIsCustomThumb

 /// <summary>
 /// <see cref="DragablzItem" /> templates contain a thumb, which is used to drag the item around.
 /// For most scenarios this is fine, but by setting this flag to <value>true</value> you can define
 /// a custom thumb in your content, without having to override the template.  This can be useful if you
 /// have extra content; such as a custom button that you want the user to be able to interact with (as usually
 /// the default thumb will handle mouse interaction).
 /// </summary>
 public static void SetIsCustomThumb(Thumb element, bool value)
 {
     element.SetValue(IsCustomThumbProperty, value);
 }
开发者ID:CensoredHF,项目名称:Snappie,代码行数:11,代码来源:DragablzItem.cs

示例5: Build_OnClick

        private void Build_OnClick(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(RowInput.Text) || string.IsNullOrEmpty(ColumnInput.Text))
            {
                MessageBox.Show("输入点儿东西撒");
                return;
            };

            var rows = int.Parse(RowInput.Text);
            var columns = int.Parse(ColumnInput.Text);

            ResetNTable();

            for (int i = 0; i < rows; i++)
            {
                var rowDef = new RowDefinition() { Height = new GridLength(_nTableData.NCellDefaultHeight) };
                NCellContainer.RowDefinitions.Add(rowDef);
            }

            var columnDefaultWidth = _nTableData.NTableDefaultWidth / columns;
            _nTableData.NCellDefaultWidth = columnDefaultWidth;
            for (int i = 0; i < columns; i++)
            {
                var columnDef = new NTabelColumnDefinition(){ Width = new GridLength(columnDefaultWidth) };
                NCellContainer.ColumnDefinitions.Add(columnDef);

               var  thumb = new Thumb();
                var rd = new ResourceDictionary
                {
                    Source = new Uri("pack://application:,,,/NTable.Core;component/Themes/Common.xaml")
                };
                thumb.Style = (Style)rd["DragThumbVerStyle"];
                thumb.SetValue(Grid.ColumnProperty,i);
                thumb.HorizontalAlignment=HorizontalAlignment.Right;
                NCellContainer.Children.Add(thumb);
            }

            for (var i = 0; i < rows; i++)
            {
                var row = new NTableRow();
                for (var j = 0; j < columns; j++)
                {
                    var nCell = new NCell { Content = i + "," + j };
                    nCell.SetValue(Grid.RowProperty, i);
                    nCell.SetValue(Grid.ColumnProperty, j);
                    NCellContainer.Children.Add(nCell);
                    row.Add(nCell);
                }
                _nTableData.Rows.Add(row);
            }

            for (var i = 0; i < columns; i++)
            {
                var nCellCollection = new NTableColumn();
                for (var j = 0; j < rows; j++)
                {
                    nCellCollection.Add((NCell)NCellContainer.Children[j * columns + i]);
                }
                _nTableData.Columns.Add(nCellCollection);
            }
        }
开发者ID:erdao,项目名称:NTable,代码行数:61,代码来源:MainWindow.xaml.cs

示例6: BuildAdornerCorner

        // Helper method to instantiate the corner Thumbs, set the Cursor property, 
        // set some appearance properties, and add the elements to the visual tree.
        void BuildAdornerCorner(ref Thumb cornerThumb, Cursor customizedCursor)
        {
            if (cornerThumb != null) return;

            cornerThumb = new Thumb();

            cornerThumb.Style = FindResource("RoundThumb") as Style;
            // Set some arbitrary visual characteristics.
            cornerThumb.Cursor = customizedCursor;
            cornerThumb.Height = cornerThumb.Width = 10;
            cornerThumb.Opacity = 0.00;
            cornerThumb.SetValue(Canvas.ZIndexProperty, 2);
            cornerThumb.MouseLeave += OnMouseLeave;

            visualChildren.Add(cornerThumb);
        }
开发者ID:jonbonne,项目名称:OCTGN,代码行数:18,代码来源:NoteAdorner.cs


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