本文整理汇总了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");
}
示例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);
}
示例3: SetPopupToMove
public static void SetPopupToMove(Thumb thumb, Popup value)
{
thumb.SetValue(PopupToMoveProperty, value);
}
示例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);
}
示例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);
}
}
示例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);
}