當前位置: 首頁>>代碼示例>>C#>>正文


C# ButtonBase.SetValue方法代碼示例

本文整理匯總了C#中System.Windows.Controls.Primitives.ButtonBase.SetValue方法的典型用法代碼示例。如果您正苦於以下問題:C# ButtonBase.SetValue方法的具體用法?C# ButtonBase.SetValue怎麽用?C# ButtonBase.SetValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Controls.Primitives.ButtonBase的用法示例。


在下文中一共展示了ButtonBase.SetValue方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetConfigData

 /// <summary>
 /// Sets the value of the ConfigData attached property to a specified ButtonBase.
 /// </summary>
 /// <param name="element">The ButtonBase to which the attached property is written.</param>
 /// <param name="value">The needed ConfigData value.</param>
 public static void SetConfigData(ButtonBase element, string value)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     element.SetValue(ConfigDataProperty, value);
 }
開發者ID:Esri,項目名稱:arcgis-viewer-silverlight,代碼行數:13,代碼來源:ExtensionAttachedProperties.cs

示例2: GetOrCreateBehavior

 private static ButtonBaseClickCommandBehavior GetOrCreateBehavior(ButtonBase buttonBase)
 {
     var behavior = buttonBase.GetValue(clickCommandBehaviorProperty) as ButtonBaseClickCommandBehavior;
     if (behavior == null)
     {
         behavior = new ButtonBaseClickCommandBehavior(buttonBase);
         buttonBase.SetValue(clickCommandBehaviorProperty, behavior);
     }
     return behavior;
 }
開發者ID:philcockfield,項目名稱:Open.TestHarness.SL,代碼行數:10,代碼來源:Click.cs

示例3: ReadOnlyProperties

		static public void ReadOnlyProperties (ButtonBase bb)
		{
			Assert.IsFalse ((bool) bb.GetValue (ButtonBase.IsFocusedProperty), "Get/IsFocusedProperty");
			Assert.IsFalse ((bool) bb.GetValue (ButtonBase.IsMouseOverProperty), "Get/IsMouseOverProperty");
			Assert.IsFalse ((bool) bb.GetValue (ButtonBase.IsPressedProperty), "Get/IsPressedProperty");

			Assert.Throws<InvalidOperationException> (delegate {
				bb.SetValue (ButtonBase.IsFocusedProperty, true);
			});
			Assert.IsFalse (bb.IsFocused, "IsFocused");

			Assert.Throws<InvalidOperationException> (delegate {
				bb.SetValue (ButtonBase.IsMouseOverProperty, true);
			});
			Assert.IsFalse (bb.IsMouseOver, "IsMouseOver");

			Assert.Throws<InvalidOperationException> (delegate {
				bb.SetValue (ButtonBase.IsPressedProperty, true);
			});
			Assert.IsFalse (bb.IsPressed, "IsPressed");

			bb.ClearValue (ButtonBase.IsFocusedProperty);
			bb.ClearValue (ButtonBase.IsMouseOverProperty);
			bb.ClearValue (ButtonBase.IsPressedProperty);
		}
開發者ID:dfr0,項目名稱:moon,代碼行數:25,代碼來源:ButtonBaseTest.cs

示例4: SetCommandParameter

 public static void SetCommandParameter(ButtonBase buttonBase, object parameter)
 {
     if (buttonBase == null) throw new System.ArgumentNullException("buttonBase");
     buttonBase.SetValue(CommandParameterProperty, parameter);
 }
開發者ID:nick121212,項目名稱:xima_desktop3,代碼行數:5,代碼來源:Click.cs

示例5: SetCommand

 public static void SetCommand(ButtonBase buttonBase, ICommand command)
 {
     if (buttonBase == null) throw new System.ArgumentNullException("buttonBase");
     buttonBase.SetValue(CommandProperty, command);
 }
開發者ID:nick121212,項目名稱:xima_desktop3,代碼行數:5,代碼來源:Click.cs

示例6: SetCommand

 public static void SetCommand(ButtonBase button, ICommand value)
 {
     button.SetValue(CommandProperty, value);
 }
開發者ID:name2name2,項目名稱:mvvmlight,代碼行數:4,代碼來源:ButtonBaseExtensions.cs

示例7: SetCommand

 public static void SetCommand(ButtonBase buttonBase, ICommand command) { buttonBase.SetValue(CommandProperty, command); }
開發者ID:philcockfield,項目名稱:Open.TestHarness.SL,代碼行數:1,代碼來源:Click.cs

示例8: SetWindowState

 public static void SetWindowState(ButtonBase obj, WindowState value)
 {
     obj.SetValue(WindowStateProperty, value);
 }
開發者ID:Mrding,項目名稱:Ribbon,代碼行數:4,代碼來源:CustomWindowBehavior.cs

示例9: SetCommandParameter

 public static void SetCommandParameter(ButtonBase button, object value)
 {
     button.SetValue(CommandParameterProperty, value);
 }
開發者ID:name2name2,項目名稱:mvvmlight,代碼行數:4,代碼來源:ButtonBaseExtensions.cs

示例10: SetInstance

 public static void SetInstance(ButtonBase dobj, ICommand value)
 {
     if (dobj != null)
      {
     dobj.SetValue (InstanceProperty, value);
      }
 }
開發者ID:mrange,項目名稱:281slides,代碼行數:7,代碼來源:DependencyProperties.cs

示例11: SetHandler

 public static void SetHandler(ButtonBase dobj, CommandHandler value)
 {
     if (dobj != null)
      {
     dobj.SetValue (HandlerProperty, value);
      }
 }
開發者ID:mrange,項目名稱:281slides,代碼行數:7,代碼來源:DependencyProperties.cs

示例12: SetDropDownMenu

 public static void SetDropDownMenu(ButtonBase obj, bool value)
 {
     obj.SetValue(DropDownMenuProperty, value);
 }
開發者ID:catwalkagogo,項目名稱:Heron,代碼行數:4,代碼來源:DropDownMenuButton.cs

示例13: SetCommandParameter

 public static void SetCommandParameter(ButtonBase buttonBase, object parameter)
 {
     buttonBase.SetValue(CommandParameterProperty, parameter);
 }
開發者ID:changhongfu,項目名稱:TDDKata,代碼行數:4,代碼來源:Click.cs

示例14: HookCommand

 private static void HookCommand(ButtonBase element, ICommand command)
 {
     CommandButtonBehavior behavior = new CommandButtonBehavior(element, command);
     behavior.Attach();
     element.SetValue(CommandButtonBehaviorProperty, behavior);
 }
開發者ID:jsmithorg,項目名稱:Mvvm,代碼行數:6,代碼來源:Behavior.cs


注:本文中的System.Windows.Controls.Primitives.ButtonBase.SetValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。