17 lines
464 B
C#
17 lines
464 B
C#
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
|
|
namespace BS.Shared.Extensions
|
|
{
|
|
public static class ListBoxExtensions
|
|
{
|
|
public static void RemoveItem(this ListBox pListBox, object pItem)
|
|
{
|
|
var lCw = CollectionViewSource.GetDefaultView(pListBox.ItemsSource) as ListCollectionView;
|
|
if (lCw.Contains(pItem))
|
|
{
|
|
lCw.Remove(pItem);
|
|
}
|
|
}
|
|
}
|
|
} |