本文整理汇总了C#中System.Windows.Data.FilterEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# FilterEventArgs类的具体用法?C# FilterEventArgs怎么用?C# FilterEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FilterEventArgs类属于System.Windows.Data命名空间,在下文中一共展示了FilterEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollectionViewSource_Filter
private void CollectionViewSource_Filter(object sender, FilterEventArgs e)
{
if (e.Item is PersonViewModel)
e.Accepted = ((PersonViewModel)e.Item).IsGuest;
else
e.Accepted = false;
}
示例2: CollectionViewSource_Filter
private void CollectionViewSource_Filter(object sender, FilterEventArgs e)
{
if (e.Item is ItemViewModel)
e.Accepted = ((ItemViewModel)e.Item).Model.Available;
else
e.Accepted = false;
}
示例3: SortedApplications_OnFilter
private void SortedApplications_OnFilter(object sender, FilterEventArgs e)
{
if (_vm == null && DataContext != null)
{
_vm = (ApplicationsViewModel)DataContext;
}
if (_vm == null || e.Item == null)
return;
if (e.Item.GetType() == typeof(DirectoryItemViewModel))
{
e.Accepted = false;
return;
}
FileItemViewModel fileItem = (FileItemViewModel)e.Item;
if (!fileItem.Pinned && fileItem.Accesses == 0)
{
e.Accepted = false;
return;
}
e.Accepted = string.IsNullOrEmpty(_vm.SearchFilter) || fileItem.Name.Contains(_vm.SearchFilter);
}
示例4: FilterIconList
/// <summary>
/// Filters the icon list.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="FilterEventArgs"/> instance containing the event data.</param>
private void FilterIconList(object sender, FilterEventArgs e)
{
if (string.IsNullOrWhiteSpace(FilterString))
return;
var icon = (IconInfo)e.Item;
e.Accepted = !string.IsNullOrWhiteSpace(icon.Name) && icon.Name.ToUpper(CultureInfo.InvariantCulture).Contains(FilterString.ToUpper(CultureInfo.InvariantCulture));
}
示例5: CharactersSource_Filter
private void CharactersSource_Filter(object sender, FilterEventArgs e)
{
Character character = e.Item as Character;
if (character != null)
e.Accepted = !character.IsMob;
else
e.Accepted = true;
}
示例6: IconSource_OnFilter
private void IconSource_OnFilter(object sender, FilterEventArgs e)
{
var icon = e.Item as IconDescription;
if (icon == null) return;
e.Accepted = icon.Description.ToLower().Contains(FilterText.Text.ToLower());
}
示例7: RecentItems_Filter
private void RecentItems_Filter(object sender, FilterEventArgs e)
{
ItemViewModel itemVM = e.Item as ItemViewModel;
if (itemVM == null)
e.Accepted = false;
else
e.Accepted = itemVM.Item.LastModified > DateTime.Now.Subtract(recentTimeSpan);
}
示例8: ShowOnlyBargainsFilter
private void ShowOnlyBargainsFilter(object sender, FilterEventArgs e)
{
var product = e.Item as AuctionItem;
if (product != null)
{
// Filter out products with price 25 or above
e.Accepted = product.CurrentPrice < 25;
}
}
示例9: PlayerList_Filter
void PlayerList_Filter(object sender, FilterEventArgs e)
{
var player = e.Item as GlobalPlayer;
if (player == null)
e.Accepted = false;
else if (!player.Name.Contains(_searchFilter, StringComparison.OrdinalIgnoreCase))
e.Accepted = false;
}
示例10: FilteredItems_Filter
private void FilteredItems_Filter(object sender, FilterEventArgs e)
{
ItemViewModel itemVM = e.Item as ItemViewModel;
string category = (CategoryComboBox.SelectedValue ?? String.Empty).ToString();
if (itemVM == null)
e.Accepted = false;
else
e.Accepted = itemVM.Item.Category == category;
}
示例11: FilterItem
private void FilterItem(object sender, FilterEventArgs e)
{
if (Filter == null) {
e.Accepted = true;
return;
}
e.Accepted = Filter(e.Item);
}
示例12: OnFilter
private void OnFilter(object sender, FilterEventArgs e)
{
var item = e.Item as ProductName;
if (item != null)
{
if (!item.Name.ContainsIgnoreKey(searchQuery))
{
e.Accepted = false;
}
}
}
示例13: Filter
private void Filter(object obj, FilterEventArgs e)
{
if (string.IsNullOrWhiteSpace(_searchText))
{
e.Accepted = true;
return;
}
JsonManga manga = e.Item as JsonManga;
e.Accepted = (manga != null && manga.Title.ToLowerInvariant().Contains(_searchText.ToLowerInvariant()));
}
示例14: CollectionViewSource_Filter
private void CollectionViewSource_Filter(object sender, FilterEventArgs e)
{
var res = true;
var versionToDiaply = this.VersionToDisplay;
var a = e.Item as CommentViewModel;
if (a != null)
{
res = versionToDiaply <= 0 || a.VersionNumber == versionToDiaply;
}
e.Accepted = res;
}
示例15: ApplyFilter
void ApplyFilter(object sender, FilterEventArgs e)
{
UserInfo svm = (UserInfo)e.Item;
if (string.IsNullOrWhiteSpace(this.Filter) || this.Filter.Length == 0)
{
e.Accepted = true;
}
else
{
e.Accepted = svm.Name.Contains(Filter) || svm.Pinyin.Contains(Filter) || svm.UserName.Contains(Filter) || svm.OrganizationName.Contains(Filter) || svm.OrganizationNamePinyin.Contains(Filter) || (!string.IsNullOrEmpty(svm.Phone) && svm.Phone.Contains(Filter));
}
}