public static bool GetIsBroughtIntoViewWhenSelected(ListBoxItem listBoxItem)
        {
            if (listBoxItem != null)
            {
                return (bool)listBoxItem.GetValue(IsBroughtIntoViewWhenSelectedProperty);
            }

            return false;
        }
 public static bool GetGivesHoverFeedback(ListBoxItem element)
 {
     return (bool)element.GetValue(GivesHoverFeedbackProperty);
 }
 public static bool GetIsSelectible(ListBoxItem element)
 {
     return (bool)element.GetValue(IsSelectibleProperty);
 }
예제 #4
0
파일: SelectorTest.cs 프로젝트: dfr0/moon
		public virtual void IsSelectionActiveTest ()
		{
			IPoker p = CurrentControl;
			ListBoxItem item = new ListBoxItem ();
			Assert.IsFalse ((bool) item.GetValue (ListBox.IsSelectionActiveProperty), "#1");
			Assert.Throws<InvalidOperationException> (() => item.SetValue (ListBox.IsSelectionActiveProperty, true));
			Assert.IsFalse ((bool) item.GetValue (ListBox.IsSelectionActiveProperty), "#2");
			p.Items.Add (item);
			p.SelectedItem = item;
			Assert.IsFalse ((bool) item.GetValue (ListBox.IsSelectionActiveProperty), "#3");
			p.SelectedIndex = -1;
			Assert.IsFalse ((bool) item.GetValue (ListBox.IsSelectionActiveProperty), "#4");

			Assert.AreSame (ComboBox.IsSelectionActiveProperty, ListBox.IsSelectionActiveProperty, "#5");
		}
 /// <summary>
 /// Gets the IsBroughtIntoViewWhenSelected value
 /// </summary>
 /// <param name="listBoxItem"></param>
 /// <returns></returns>
 public static bool GetBringIntoViewNewItems(ListBoxItem listBoxItem)
 {
     return (bool)listBoxItem.GetValue(BringIntoViewNewItemsProperty);
 }
 public static bool GetIsRecent(ListBoxItem element)
 {
     return (bool)element.GetValue(IsRecentProperty);
 }
 public static bool GetIsEnabled(ListBoxItem element)
 {
     return (bool)element.GetValue(IsEnabledProperty);
 }
예제 #8
0
 public static bool GetIsBroughtIntoViewWhenSelected(ListBoxItem item)
 {
     return (bool)item.GetValue(IsBroughtIntoViewWhenSelectedProperty);
 }
 public static Style GetBaseStyle(ListBoxItem element)
 {
     return (Style)element.GetValue(BaseStyleProperty);
 }
예제 #10
0
        private void ToggleSingleSelection(ListBoxItem item)
        {
            bool isSelected = !(bool)item.GetValue(Selector.IsSelectedProperty);

            SelectedItem = isSelected ? ItemContainerGenerator.ItemFromContainer(item) : null;

            for (int i = 0; i < ItemContainerGenerator.ItemsCount; i++)
            {
                DependencyObject itemContainer = ItemContainerGenerator.Generate(i);
                itemContainer.SetCurrentValue(Selector.IsSelectedProperty, itemContainer == item && isSelected);
            }
        }
예제 #11
0
 private void ToggleSelection(ListBoxItem item)
 {
     item.SetCurrentValue(Selector.IsSelectedProperty, !(bool)item.GetValue(Selector.IsSelectedProperty));
 }
 /// <summary>
 /// Gets the drag format when this instance is being dragged above or below another row.
 /// </summary>
 /// <param name="listBoxItem">The list box item.</param>
 /// <returns>
 /// The drag format used when this instance is being dragged above or below another row.
 /// </returns>
 public static string GetMoveDragFormat(ListBoxItem listBoxItem)
 {
     return (string)listBoxItem.GetValue(MoveDragFormatProperty);
 }
 /// <summary>
 /// Gets the content template when this instance is being dragged above or below another row.
 /// </summary>
 /// <param name="listBoxItem">The list box item.</param>
 /// <returns>
 /// A data template used when this instance is being dragged above or below another row.
 /// </returns>
 public static DataTemplate GetMoveDragContentTemplate(ListBoxItem listBoxItem)
 {
     return (DataTemplate)listBoxItem.GetValue(MoveDragContentTemplateProperty);
 }
 /// <summary>
 /// Gets the command used to move another row below this one using drag and drop.
 /// </summary>
 /// <param name="listBoxItem">The list box item.</param>
 /// <returns>
 /// The command to move a row below this instance.
 /// </returns>
 public static ICommand GetMoveBelowCommand(ListBoxItem listBoxItem)
 {
     return (ICommand)listBoxItem.GetValue(MoveBelowCommandProperty);
 }
 /// <summary>
 /// Gets the deselection enabled property. If enabled, and the row is clicked while selected, the row is deselected.
 /// </summary>
 /// <param name="listBoxItem">The list box item.</param>
 /// <returns>
 ///   <c>true</c> if deselecting row when selected and clicked, otherwise <c>false</c>.
 /// </returns>
 public static bool GetIsDeselectionEnabled(ListBoxItem listBoxItem)
 {
     return (bool)listBoxItem.GetValue(IsDeselectionEnabledProperty);
 }
예제 #16
0
 public static bool GetIsActive(ListBoxItem obj)
 {
     return (bool)obj.GetValue(IsActiveProperty);
 }
 public static Brush GetHighlightForegroundBrush(ListBoxItem element)
 {
     return (Brush)element.GetValue(HighlightForegroundBrushProperty);
 }
예제 #18
0
 private void ToggleSelection(ListBoxItem item)
 {
     item.SetCurrentValue(Selector.IsSelectedProperty, !(bool)item.GetValue(Selector.IsSelectedProperty));
 }