Ejemplo n.º 1
0
 void LookUpInfo()
 {
     if (selectedCell.Column != null && selectedCell.Item is FullPlayerInfo)
     {
         var propertyName = selectedCell.Column.SortMemberPath.ToString();
         var z            = selectedCell.Item.GetType().GetProperty(propertyName).PropertyType;
         if (!string.IsNullOrEmpty(propertyName) && z == typeof(string))
         {
             SearchText        = selectedCell.Item.GetType().GetProperty(propertyName).GetValue(selectedCell.Item, null).ToString();
             searchPlayersList = new ObservableCollection <FullPlayerInfo>(FullPlayersList.Where((x) =>
                                                                                                 x.GetType().GetProperty(propertyName).GetValue(x, null).ToString().ToLower().Contains(searchText.ToLower())));
             FinishSearch();
         }
     }
 }
Ejemplo n.º 2
0
 void Search()
 {
     if (!string.IsNullOrEmpty(SearchText))
     {
         searchText = searchText.ToLower();
         var type       = fullPlayersList.GetType().GetGenericArguments()[0];
         var properties = type.GetProperties();
         searchPlayersList = new ObservableCollection <FullPlayerInfo>(
             FullPlayersList.Where((x) =>
                                   properties.Any(p =>
         {
             var value = p.GetValue(x);
             return(value != null && value.ToString().ToLower().Contains(searchText));
         })));
         FinishSearch();
     }
 }