daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Aug 19th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Converter with collection
  2. public object Convert(object value, Type targetType, object parameter,   System.Globalization.CultureInfo culture)
  3.     {
  4.         var collection = (ObservableCollection<OrderEntry>)value;
  5.         var viewSource = new CollectionViewSource()
  6.         {
  7.             Source = collection,
  8.         };
  9.         viewSource.Filter += new FilterEventHandler(FilterInSealedOrderEntries);
  10.         return viewSource.View;
  11.     }
  12.  
  13.     private static void FilterInSealedOrderEntries(object sender, FilterEventArgs e)
  14.     {
  15.         var orderEntry = e.Item as OrderEntry;
  16.         e.Accepted = orderEntry != null && orderEntry.Sealed;
  17.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top