예제 #1
0
        /// <summary> 
        ///     Get the instance of TextSearch attached to the given ItemsControl or make one and attach it if it's not.
        /// </summary> 
        /// <param name="itemsControl"></param> 
        /// <returns></returns>
        internal static TextSearch EnsureInstance(ItemsControl itemsControl) 
        {
            TextSearch instance = (TextSearch)itemsControl.GetValue(TextSearchInstanceProperty);

            if (instance == null) 
            {
                instance = new TextSearch(itemsControl); 
                itemsControl.SetValue(TextSearchInstancePropertyKey, instance); 
            }
 
            return instance;
        }
예제 #2
0
        private static string GetPrimaryTextPath(ItemsControl itemsControl)
        { 
            string primaryTextPath = (string)itemsControl.GetValue(TextPathProperty);

            if (String.IsNullOrEmpty(primaryTextPath))
            { 
                primaryTextPath = itemsControl.DisplayMemberPath;
            } 
            return primaryTextPath; 
        }
예제 #3
0
 public static bool GetShowGridLines(ItemsControl obj)
 {
     return (bool)obj.GetValue(ShowGridLinesProperty);
 }
 public static ICommand GetItemContainersGeneratedCommand(ItemsControl ItemsControl)
 {
     return (ICommand)ItemsControl.GetValue(ItemContainersGeneratedCommandProperty);
 }
예제 #5
0
 public static bool GetItemsDoubleClick(ItemsControl element)
 {
     return (bool)element.GetValue(ItemsDoubleClickProperty);
 }
예제 #6
0
 public static bool GetHasViews(ItemsControl element)
 {
     return (bool)element.GetValue(HasViewsProperty);
 }
예제 #7
0
        private static string GetPrimaryTextPath(ItemsControl itemsControl, bool doHierarchicalSearch)
        {
            string primaryTextPath = (string)itemsControl.GetValue(TextSearch.TextPathProperty);

            if (String.IsNullOrEmpty(primaryTextPath))
            {
                primaryTextPath = itemsControl.DisplayMemberPath;
            }

            if (String.IsNullOrEmpty(primaryTextPath) && doHierarchicalSearch)
            {
                // Fallback on ParentItemsControl
                ItemsControl parentItemsControl = ItemsControl.ItemsControlFromItemContainer(itemsControl);
                if (parentItemsControl != null)
                {
                    primaryTextPath = (string)parentItemsControl.GetValue(TextSearch.TextPathProperty);
                }

                if (String.IsNullOrEmpty(primaryTextPath) && doHierarchicalSearch)
                {
                    // Fallback on GrandParentItemsControl
                    ItemsControl grandParentItemsControl = ItemsControl.ItemsControlFromItemContainer(parentItemsControl);
                    if (grandParentItemsControl != null)
                    {
                        primaryTextPath = (string)grandParentItemsControl.GetValue(TextSearch.TextPathProperty);
                    }
                }
            }

            return primaryTextPath;
        }
예제 #8
0
 public static Type GetEnum(ItemsControl control)
 {
     if (control != null)
         {
             return (Type)control.GetValue(EnumProperty);
         }
         return null;
 }
예제 #9
0
 /// <summary>
 /// Gets the duration of the animation.
 /// </summary>
 /// <param name="itemsControl">The items control.</param>
 /// <returns></returns>
 public static TimeSpan GetAnimationDuration(ItemsControl itemsControl)
 {
     return (TimeSpan) itemsControl.GetValue(AnimationDurationProperty);
 }
예제 #10
0
        static void RaiseEvent(ItemsControl sender, DependencyObject originalSender)
        {
            if (sender == null || originalSender == null) return;

            DependencyObject container = ItemsControl.ContainerFromElement(sender, originalSender);
            // just in case, check if the double click doesn't come from somewhere else than something in a container
            if (container == null || container == DependencyProperty.UnsetValue) return;

            // found a container, now find the item.
            object activatedItem = sender.ItemContainerGenerator.ItemFromContainer(container);

            if (activatedItem != null && activatedItem != DependencyProperty.UnsetValue && !(activatedItem is System.Windows.Data.CollectionViewGroup)) {
                //sender.RaiseEvent(new ItemActivateEventArgs(ItemActivation.ItemActivateEvent, sender, activatedItem, ActivationMode.Mouse));
                ICommand command = (ICommand)sender.GetValue(ItemActivation.TheCommandToRunProperty);
                command.Execute(activatedItem);
            }
        }
 private static IWeakEventListener GetScrollToNewItemWeakEventListener(ItemsControl Element)
 {
     return (IWeakEventListener)Element.GetValue(ScrollToNewItemWeakEventListenerProperty);
 }
 private static IWeakEventListener GetItemContainersGeneratedCommandWeakEventListener(ItemsControl Element)
 {
     return (IWeakEventListener)Element.GetValue(ItemContainersGeneratedCommandWeakEventListenerProperty);
 }
 public static string GetScrollToNewItemFocusSpecificElementName(ItemsControl ItemsControl)
 {
     return (string)ItemsControl.GetValue(ScrollToNewItemFocusSpecificElementNameProperty);
 }
 public static bool GetScrollToNewItem(ItemsControl ItemsControl)
 {
     return (bool)ItemsControl.GetValue(ScrollToNewItemProperty);
 }
 public static object GetItemContainersGeneratedCommandParameter(ItemsControl ItemsControl)
 {
     return (object)ItemsControl.GetValue(ItemContainersGeneratedCommandParameterProperty);
 }
예제 #16
0
 public static object GetCurrentlyInView(ItemsControl control)
 {
     return control.GetValue(CurrentlyInViewProperty);
 }
예제 #17
0
 /// <summary>
 /// Gets the group styles.
 /// </summary>
 /// <param name="itemsControl">The items control.</param>
 /// <returns>The group style.</returns>
 public static GroupStyleCollection GetGroupStyles(ItemsControl itemsControl)
 {
     return (GroupStyleCollection)itemsControl.GetValue(GroupStylesProperty);
 }
예제 #18
0
 private static StateObject GetOrCreateStateObject(ItemsControl itemsControl)
 {
     var stateObject = (StateObject)itemsControl.GetValue(StateObjectProperty);
     if(stateObject == null){
         stateObject = new StateObject(itemsControl);
         itemsControl.SetValue(StateObjectProperty, stateObject);
     }
     return stateObject;
 }
 private static ItemsControlManager GetItemsControlManager(ItemsControl itemsControl)
 {
     return (ItemsControlManager)itemsControl.GetValue(ItemsControlManagerProperty);
 }
예제 #20
0
 public static int GetColumnCount(ItemsControl obj)
 {
     return (int)obj.GetValue(ColumnCountProperty);
 }
예제 #21
0
        private static ItemsControlDropCommandBehavior GetOrCreateItemsControlDropBehavior(ItemsControl itemsControl)
        {
            var behavior = itemsControl.GetValue(ItemsControlDropCommandBehaviorProperty) as ItemsControlDropCommandBehavior;
            if (behavior == null)
            {
                behavior = new ItemsControlDropCommandBehavior(itemsControl);
                itemsControl.SetValue(ItemsControlDropCommandBehaviorProperty, behavior);
            }

            return behavior;
        }
예제 #22
0
 public static int GetRowCount(ItemsControl itemsControl)
 {
     return (int)itemsControl.GetValue(RowCountProperty);
 }
예제 #23
0
 public static bool GetAutoUniformWidth(ItemsControl obj)
 {
     return (bool)obj.GetValue(UseAutoUniformWidthProperty);
 }
예제 #24
0
 public static IEnumerable<RowDefinition> GetRowDefinitionsSource(ItemsControl obj)
 {
     return (IEnumerable<RowDefinition>)obj.GetValue(RowDefinitionsSourceProperty);
 }
예제 #25
0
 public static bool GetIsEnabled(ItemsControl d)
 {
     return (bool)d.GetValue(IsEnabledProperty);
 }
		public static Object GetContent( ItemsControl owner )
		{
			return ( Object )owner.GetValue( ContentProperty );
		}