Exemplo n.º 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;
        }
Exemplo n.º 2
0
        private static string GetPrimaryTextPath(ItemsControl itemsControl)
        { 
            string primaryTextPath = (string)itemsControl.GetValue(TextPathProperty);

            if (String.IsNullOrEmpty(primaryTextPath))
            { 
                primaryTextPath = itemsControl.DisplayMemberPath;
            } 
            return primaryTextPath; 
        }
Exemplo n.º 3
0
 public static bool GetShowGridLines(ItemsControl obj)
 {
     return (bool)obj.GetValue(ShowGridLinesProperty);
 }
 public static ICommand GetItemContainersGeneratedCommand(ItemsControl ItemsControl)
 {
     return (ICommand)ItemsControl.GetValue(ItemContainersGeneratedCommandProperty);
 }
Exemplo n.º 5
0
 public static bool GetItemsDoubleClick(ItemsControl element)
 {
     return (bool)element.GetValue(ItemsDoubleClickProperty);
 }
Exemplo n.º 6
0
 public static bool GetHasViews(ItemsControl element)
 {
     return (bool)element.GetValue(HasViewsProperty);
 }
Exemplo n.º 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;
        }
Exemplo n.º 8
0
 public static Type GetEnum(ItemsControl control)
 {
     if (control != null)
         {
             return (Type)control.GetValue(EnumProperty);
         }
         return null;
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 16
0
 public static object GetCurrentlyInView(ItemsControl control)
 {
     return control.GetValue(CurrentlyInViewProperty);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 20
0
 public static int GetColumnCount(ItemsControl obj)
 {
     return (int)obj.GetValue(ColumnCountProperty);
 }
Exemplo n.º 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;
        }
Exemplo n.º 22
0
 public static int GetRowCount(ItemsControl itemsControl)
 {
     return (int)itemsControl.GetValue(RowCountProperty);
 }
Exemplo n.º 23
0
 public static bool GetAutoUniformWidth(ItemsControl obj)
 {
     return (bool)obj.GetValue(UseAutoUniformWidthProperty);
 }
Exemplo n.º 24
0
 public static IEnumerable<RowDefinition> GetRowDefinitionsSource(ItemsControl obj)
 {
     return (IEnumerable<RowDefinition>)obj.GetValue(RowDefinitionsSourceProperty);
 }
Exemplo n.º 25
0
 public static bool GetIsEnabled(ItemsControl d)
 {
     return (bool)d.GetValue(IsEnabledProperty);
 }
		public static Object GetContent( ItemsControl owner )
		{
			return ( Object )owner.GetValue( ContentProperty );
		}