示例#1
0
        protected override DependencyObject GetContainerForItemOverride()
        {
            var item = new PowerListBoxItem();

            if (ItemContainerStyle != null)
            {
                item.Style = ItemContainerStyle;
            }
            return(item);
        }
示例#2
0
 internal void InvokeItemSelectedEvent(PowerListBoxItem selItem)
 {
     if (ItemSelected == null)
     {
         return;
     }
     if (selItem == null)
     {
         ItemSelected(this, new ItemSelectedEventArgs());
     }
     else if (selItem.DataContext != null)
     {
         ItemSelected(this, new ItemSelectedEventArgs {
             OldSelectedItem = SelectedItem, NewSelectedItem = selItem.DataContext
         });
     }
     else
     {
         ItemSelected(this, new ItemSelectedEventArgs {
             OldSelectedItem = SelectedItem, NewSelectedItem = selItem
         });
     }
 }
示例#3
0
 protected override DependencyObject GetContainerForItemOverride()
 {
     var item = new PowerListBoxItem();
     if (ItemContainerStyle != null)
         item.Style = ItemContainerStyle;
     return item;
 }
示例#4
0
 internal void InvokeItemSelectedEvent(PowerListBoxItem selItem)
 {
     if (ItemSelected == null)
         return;
     if (selItem == null)
         ItemSelected(this, new ItemSelectedEventArgs());
     else if (selItem.DataContext != null)
         ItemSelected(this, new ItemSelectedEventArgs { OldSelectedItem = SelectedItem, NewSelectedItem = selItem.DataContext });
     else
         ItemSelected(this, new ItemSelectedEventArgs { OldSelectedItem = SelectedItem, NewSelectedItem = selItem });
 }