示例#1
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            CategoriesListView.DataSource = Categories;
            CategoriesListView.DataBind();
        }
示例#2
0
 public CategoriesModel(object context)
 {
     Views[0]        = new AddOrEditCategory();
     Views[1]        = new CategoriesListView();
     DataContexts[0] = ((AddOrEditCategory)Views[0]).DataContext;
     DataContexts[1] = ((CategoriesListView)Views[1]).DataContext;
     DataContexts[2] = context;
 }
示例#3
0
 private void FilterItem(string filter)
 {
     CategoriesListView.BeginRefresh();
     if (string.IsNullOrWhiteSpace(filter))
     {
         CategoriesListView.ItemsSource = Items;
     }
     else
     {
         CategoriesListView.ItemsSource = Items.Where(x => x.Text.ToLower().Contains(filter.ToLower()));
     }
     CategoriesListView.EndRefresh();
 }
示例#4
0
 private void AddCommandDialogView_Loaded(object sender, RoutedEventArgs e)
 {
     CategoriesListView.Focus();
 }