本文整理汇总了C#中Control.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Control.GetValue方法的具体用法?C# Control.GetValue怎么用?C# Control.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control.GetValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyDesignerProperties
internal static void ApplyDesignerProperties(Control target, Control source)
{
if (source.IsSet(WidthProperty))
target.Width = source.GetValue(WidthProperty);
if (source.IsSet(HeightProperty))
target.Height = source.GetValue(HeightProperty);
if (source.IsSet(DataContextProperty))
target.DataContext = source.GetValue(DataContextProperty);
}
示例2: GetIsTemplateFocusTarget
/// <summary>
/// Gets the value of the IsTemplateFocusTargetProperty attached property on a control.
/// </summary>
/// <param name="control">The control.</param>
/// <returns>The property value.</returns>
/// <see cref="SetIsTemplateFocusTarget(Control, bool)"/>
public bool GetIsTemplateFocusTarget(Control control)
{
return control.GetValue(IsTemplateFocusTargetProperty);
}
示例3: GetWidth
public static double GetWidth(Control control)
{
return control.GetValue(WidthProperty);
}
示例4: GetDataContext
public static object GetDataContext(Control control)
{
return control.GetValue(DataContextProperty);
}
示例5: GetDock
/// <summary>
/// Gets the value of the Dock attached property on the specified control.
/// </summary>
/// <param name="control">The control.</param>
/// <returns>The Dock attached property.</returns>
public static Dock GetDock(Control control)
{
return control.GetValue(DockProperty);
}
示例6: GetHeight
public static double GetHeight(Control control)
{
return control.GetValue(HeightProperty);
}
示例7: GetNameScope
/// <summary>
/// Gets the value of the attached <see cref="NameScopeProperty"/> on a visual.
/// </summary>
/// <param name="visual">The visual.</param>
/// <returns>The value of the NameScope attached property.</returns>
public static INameScope GetNameScope(Control visual)
{
return visual.GetValue(NameScopeProperty);
}
示例8: GetTip
/// <summary>
/// Gets the value of the ToolTip.Tip attached property.
/// </summary>
/// <param name="element">The control to get the property from.</param>
/// <returns>
/// The content to be displayed in the control's tooltip.
/// </returns>
public static object GetTip(Control element)
{
return element.GetValue(TipProperty);
}
示例9: GetForeground
/// <summary>
/// Gets the value of the attached <see cref="ForegroundProperty"/> on a control.
/// </summary>
/// <param name="control">The control.</param>
/// <returns>The foreground.</returns>
public static Brush GetForeground(Control control)
{
return control.GetValue(ForegroundProperty);
}
示例10: GetFontWeight
/// <summary>
/// Gets the value of the attached <see cref="FontWeightProperty"/> on a control.
/// </summary>
/// <param name="control">The control.</param>
/// <returns>The font family.</returns>
public static FontWeight GetFontWeight(Control control)
{
return control.GetValue(FontWeightProperty);
}
示例11: GetFontStyle
/// <summary>
/// Gets the value of the attached <see cref="FontStyleProperty"/> on a control.
/// </summary>
/// <param name="control">The control.</param>
/// <returns>The font family.</returns>
public static FontStyle GetFontStyle(Control control)
{
return control.GetValue(FontStyleProperty);
}
示例12: GetFontSize
/// <summary>
/// Gets the value of the attached <see cref="FontSizeProperty"/> on a control.
/// </summary>
/// <param name="control">The control.</param>
/// <returns>The font family.</returns>
public static double GetFontSize(Control control)
{
return control.GetValue(FontSizeProperty);
}
示例13: GetFontFamily
/// <summary>
/// Gets the value of the attached <see cref="FontFamilyProperty"/> on a control.
/// </summary>
/// <param name="control">The control.</param>
/// <returns>The font family.</returns>
public static string GetFontFamily(Control control)
{
return control.GetValue(FontFamilyProperty);
}