Пример #1
0
 /// <summary>
 /// Busca basado en la palabra clave pasada como parametro
 /// </summary>
 /// <param name="key"></param>
 private void Search(string key)
 {
     grdContainer.Children.Clear();
     SnippetList list = new SnippetList()
     {
         Snippets = context.Select(key)
     };
     list.Actualizar += new EventHandler<SnippetEventArgs>(btnActualizar_Click);
     list.Eliminar += new EventHandler<SnippetEventArgs>(btnEliminar_Click);
     list.Ver += new EventHandler<SnippetEventArgs>(btnVer_Click);
     grdContainer.Children.Add(list);
 }
Пример #2
0
 private void lstCategorias_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
 {
     if (lstCategorias.SelectedIndex == 0)
     {
         Refresh();
         ActiveCategorySearch = false;
     }
     else if (ActiveCategorySearch && lstCategorias.SelectedIndex == 1)
     {
         lstCategorias.Items.Clear();
         lstCategorias.Items.Add("(Ver todos)");
         CargarCategorias();
         txtCategorySearch.Text = string.Empty;
         ActiveCategorySearch = false;
     }
     else
     {
         Categoria cat = (lstCategorias.SelectedItem as Categoria);
         grdContainer.Children.Clear();
         SnippetList list = new SnippetList()
         {
             Snippets = context.Select(cat)
         };
         list.Actualizar += new EventHandler<SnippetEventArgs>(btnActualizar_Click);
         list.Eliminar += new EventHandler<SnippetEventArgs>(btnEliminar_Click);
         list.Ver += new EventHandler<SnippetEventArgs>(btnVer_Click);
         grdContainer.Children.Add(list);
     }
 }