本文整理汇总了C#中System.Windows.Controls.Button.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Button.GetValue方法的具体用法?C# Button.GetValue怎么用?C# Button.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Button
的用法示例。
在下文中一共展示了Button.GetValue方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: can_attach_a_message_handler_to_a_ui_element_without_data_context
public void can_attach_a_message_handler_to_a_ui_element_without_data_context()
{
var dp = new Button();
var handler = Mock<IRoutedMessageHandler>();
_controller.AddHandler(
dp,
handler,
false
);
var node = dp.GetValue(DefaultRoutedMessageController.NodeProperty) as InteractionNode;
Assert.That(node, Is.Not.Null);
Assert.That(node.MessageHandler, Is.EqualTo(handler));
Assert.That(dp.DataContext, Is.Null);
}
示例2: can_attach_a_trigger_to_a_ui_element
public void can_attach_a_trigger_to_a_ui_element()
{
var dp = new Button();
var trigger = Mock<IMessageTrigger>();
trigger.Expect(x => x.Attach(Arg<InteractionNode>.Is.NotNull));
_controller.AttachTrigger(
dp,
trigger
);
var node = dp.GetValue(DefaultRoutedMessageController.NodeProperty) as InteractionNode;
Assert.That(node, Is.Not.Null);
Assert.That(node.Triggers.Contains(trigger));
}
示例3: can_attach_a_message_handler_to_a_ui_element
public void can_attach_a_message_handler_to_a_ui_element()
{
var dp = new Button();
var handler = Mock<IRoutedMessageHandler>();
handler.Expect(x => x.Unwrap()).Return(handler);
handler.Expect(x => x.Initialize(Arg<IInteractionNode>.Is.NotNull));
_controller.AddHandler(
dp,
handler,
true
);
var node = dp.GetValue(DefaultRoutedMessageController.NodeProperty) as InteractionNode;
Assert.That(node, Is.Not.Null);
Assert.That(node.MessageHandler, Is.EqualTo(handler));
Assert.That(dp.DataContext, Is.EqualTo(handler));
}
示例4: registerPlayerMove
private void registerPlayerMove(Button btn)
{
btn.FontSize = 30.0;
btn.Content = "X";
int row = (int)btn.GetValue(Grid.RowProperty);
int col = (int)btn.GetValue(Grid.ColumnProperty);
Tuple<int, int> pickedCell = new Tuple<int, int>(row, col);
usedCells.Add(pickedCell);
}
示例5: GetPopupToControl
public static Popup GetPopupToControl(Button button)
{
return (Popup) button.GetValue(PopupToControlProperty);
}
示例6: GetPopupAction
public static PopupAction GetPopupAction(Button button)
{
return (PopupAction) button.GetValue(PopupActionProperty);
}
示例7: GetResult
public static bool? GetResult(Button button)
{
return (bool?)button.GetValue(ResultProperty);
}
示例8: GetElementToFocus
/// <summary>
/// Gets ElementToFocusProperty
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
public static Control GetElementToFocus(Button button)
{
return (Control)button.GetValue(ElementToFocusProperty);
}
示例9: GetIsClearTextButtonBehaviorEnabled
public static bool GetIsClearTextButtonBehaviorEnabled(Button d)
{
return (bool)d.GetValue(IsClearTextButtonBehaviorEnabledProperty);
}
示例10: GetTextBoxContentReceiver
/// <summary>
/// Gets the text box that on button click receives button's content string.
/// </summary>
/// <param name="button">Button whose property you're getting.</param>
/// <returns>Text box that's receiving the content string of the button.</returns>
public static TextBox GetTextBoxContentReceiver(Button button)
{
return (TextBox)button.GetValue(TextBoxContentReceiverProperty);
}
示例11: GetExclusiveCase
/// <summary>
/// Gets CharacterCase value of ExclusiveCase property for the specified button.
/// </summary>
/// <param name="button">Button whose ExclusiveCase property you're getting.</param>
public static CharacterCase GetExclusiveCase(Button button)
{
return (CharacterCase)button.GetValue(ExclusiveCaseProperty);
}
示例12: GetCloseContainingDropDown
public static bool GetCloseContainingDropDown(Button element)
{
return (bool) element.GetValue(CloseContainingDropDownProperty);
}