本文整理汇总了C#中System.Windows.Controls.Control.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Control.GetValue方法的具体用法?C# Control.GetValue怎么用?C# Control.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Control
的用法示例。
在下文中一共展示了Control.GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCulture
/// <summary>
/// Gets spell checking culture of the specified control.
/// </summary>
/// <param name="control">
/// The control.
/// </param>
/// <returns>
/// The spell checking culture.
/// </returns>
/// <exception cref="ArgumentNullException">
/// The <paramref name="control"/> parameter is null.
/// </exception>
public static CultureInfo GetCulture(Control control)
{
if (control == null)
throw new ArgumentNullException("control");
return (CultureInfo)control.GetValue(CultureProperty);
}
示例2: GetIsSendingMouseWheelEventToParent
/// <summary>
/// Gets the IsSendingMouseWheelEventToParent for a given <see cref="TextBox"/>.
/// </summary>
/// <param name="control">
/// The <see cref="TextBox"/> whose IsSendingMouseWheelEventToParent is to be retrieved.
/// </param>
/// <returns>
/// The IsSendingMouseWheelEventToParent, or <see langword="null"/>
/// if no IsSendingMouseWheelEventToParent has been set.
/// </returns>
public static bool? GetIsSendingMouseWheelEventToParent(Control control)
{
if (control == null)
throw new ArgumentNullException("");
return control.GetValue(ScrollProperty) as bool?;
}
示例3: GetOrCreateBehavior
private static DoubleClickCommandBehavior GetOrCreateBehavior(Control control)
{
var behavior = control.GetValue(DoubleClickCommandBehaviorProperty) as DoubleClickCommandBehavior;
if (behavior == null)
{
behavior = new DoubleClickCommandBehavior(control);
control.SetValue(DoubleClickCommandBehaviorProperty, behavior);
}
return behavior;
}
示例4: EnsureInstance
private static AutoComplete EnsureInstance( Control ctrl )
{
var ac = ( AutoComplete )ctrl.GetValue( AutoComplete.AutoCompleteInstance );
if( ac == null )
{
ac = new AutoComplete( ctrl );
//ac.SetControl( ctrl );
ctrl.SetValue( AutoCompleteInstancePropertyKey, ac );
}
return ac;
}
示例5: GetDefaultStyleKey
/// <summary>
/// This method retrieves the default style key of a control.
/// </summary>
/// <param name="control">The control to retrieve the default style key
/// from.</param>
/// <returns>The default style key of the control.</returns>
public static object GetDefaultStyleKey(Control control)
{
return control.GetValue(Control.DefaultStyleKeyProperty);
}
示例6: GetOneWayControlHeight
public static double GetOneWayControlHeight(Control element)
{
return (double)element.GetValue(OneWayControlHeightProperty);
}
示例7: GetOperationId
private static Guid GetOperationId(Control control)
{
return (Guid)control.GetValue(OperationIdProperty);
}
示例8: Subscribe
private static void Subscribe(Control control, DependencyProperty property)
{
var binding = BindingOperations.GetBinding(control, property);
if (binding != null && binding.IsBoundToDataContext())
{
if (!binding.IsNotifiying())
{
binding = binding.CreateNotifying(control.DataContext);
BindingOperations.ClearBinding(control, property);
BindingOperations.SetBinding(control, property, binding);
}
control.SourceUpdated += (o, args) =>
{
if (args.Property == property)
{
var undoManager = GetUndoManager(control);
var value = control.GetValue(property);
undoManager._history.Update(control, value, property, UpdateReason.UserInput);
}
};
control.TargetUpdated += (o, args) =>
{
if (args.Property == property)
{
var undoManager = GetUndoManager(control);
var value = control.GetValue(property);
undoManager._history.Update(control, value, property, UpdateReason.DataUpdated);
}
};
}
}
示例9: GetFocusOnFirstElement
public static bool GetFocusOnFirstElement(Control control)
{
return (bool)control.GetValue(FocusOnFirstElementProperty);
}
示例10: selectedDevice_MouseLeftButtonDown
void selectedDevice_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
selectedDevice = (Control)sender;
selectedDevice.CaptureMouse();
deltaX = e.GetPosition(grdDeviceLayer).X - ((Thickness)selectedDevice.GetValue(Grid.MarginProperty)).Left;
deltaY = e.GetPosition(grdDeviceLayer).Y - ((Thickness)selectedDevice.GetValue(Grid.MarginProperty)).Top;
UnSelectAllDevice();
(sender as I_IO).IsSelect = true;
this.grdSetting.DataContext = selectedDevice.DataContext;
// throw new NotImplementedException();
}
示例11: GetStateName
public static string GetStateName(Control o)
{
return (string)o.GetValue(StateNameProperty);
}
示例12: GetOpenShellContextMenu
public static bool GetOpenShellContextMenu(Control control)
{
return (bool)control.GetValue(OpenShellContextMenuProperty);
}
示例13: GetInterceptKeySelectionEvents
public static bool GetInterceptKeySelectionEvents(Control element)
{
return (bool)element.GetValue(InterceptKeySelectionEventsProperty);
}
示例14: GetParameter
public static object GetParameter(Control target)
{
return target.GetValue(ParameterProperty);
}
示例15: GetCommand
public static ICommand GetCommand(Control target)
{
return (ICommand)target.GetValue(CommandProperty);
}