当前位置: 首页>>代码示例>>C#>>正文


C# Control.GetValue方法代码示例

本文整理汇总了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);
        }
开发者ID:mparsin,项目名称:Elements,代码行数:19,代码来源:SpellCheck.cs

示例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?;
        }
开发者ID:Nimgoble,项目名称:Jibbr,代码行数:17,代码来源:BubbleScrolling.cs

示例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;
        }
开发者ID:changhongfu,项目名称:TDDKata,代码行数:11,代码来源:DoubleClick.cs

示例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;
		}
开发者ID:micdenny,项目名称:Radical.Windows,代码行数:12,代码来源:AutoComplete.cs

示例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);
 }
开发者ID:royosherove,项目名称:cthru,代码行数:10,代码来源:DefaultStyleKeyRetriever.cs

示例6: GetOneWayControlHeight

 public static double GetOneWayControlHeight(Control element)
 {
     return (double)element.GetValue(OneWayControlHeightProperty);
 }
开发者ID:ptownsend1984,项目名称:SampleApplications,代码行数:4,代码来源:ControlExtensions.cs

示例7: GetOperationId

 private static Guid GetOperationId(Control control)
 {
     return (Guid)control.GetValue(OperationIdProperty);
 }
开发者ID:mparsin,项目名称:Elements,代码行数:4,代码来源:SpellCheck.cs

示例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);
             }
         };
     }
 }
开发者ID:kevlut,项目名称:UndoRedo,代码行数:31,代码来源:UndoManager.cs

示例9: GetFocusOnFirstElement

 public static bool GetFocusOnFirstElement(Control control)
 {
     return (bool)control.GetValue(FocusOnFirstElementProperty);
 }
开发者ID:debbievermaak,项目名称:azure-scaffolder,代码行数:4,代码来源:FocusBehavior.cs

示例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();
        }
开发者ID:ufjl0683,项目名称:slSecureAndPD,代码行数:13,代码来源:MainPage.xaml.cs

示例11: GetStateName

 public static string GetStateName(Control o)
 {
     return (string)o.GetValue(StateNameProperty);
 }
开发者ID:thnk2wn,项目名称:codestock-winphone,代码行数:4,代码来源:VSM.cs

示例12: GetOpenShellContextMenu

 public static bool GetOpenShellContextMenu(Control control)
 {
     return (bool)control.GetValue(OpenShellContextMenuProperty);
 }
开发者ID:notsonormal,项目名称:AstoundingDock,代码行数:4,代码来源:ShellContextMenuBehaviour.cs

示例13: GetInterceptKeySelectionEvents

 public static bool GetInterceptKeySelectionEvents(Control element)
 {
     return (bool)element.GetValue(InterceptKeySelectionEventsProperty);
 }
开发者ID:squaredinfinity,项目名称:Foundation,代码行数:4,代码来源:CheckBoxInListItem.cs

示例14: GetParameter

 public static object GetParameter(Control target)
 {
     return target.GetValue(ParameterProperty);
 }
开发者ID:eatplayhate,项目名称:versionr,代码行数:4,代码来源:ControlDoubleClick.cs

示例15: GetCommand

 public static ICommand GetCommand(Control target)
 {
     return (ICommand)target.GetValue(CommandProperty);
 }
开发者ID:eatplayhate,项目名称:versionr,代码行数:4,代码来源:ControlDoubleClick.cs


注:本文中的System.Windows.Controls.Control.GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。