Ejemplo n.º 1
0
        //Event Triggered by Inner Category ComboBox on "SelectionChange"
        //REFINES the Base Category Search by Inner Category,
        //in othe words searches For the Items form base Category by Inner Category
        private void SearchInnerByBase(object sender, SelectionChangedEventArgs e)
        {
            //Base Category choosed by the User
            var eBase = cmbBaseCategory.SelectedItem;

            //Inner Category Choosed by the User
            var eInner = cmbInnerCategory.SelectedItem;

            //If we are in the Regular Search Mode
            //and there's valid data in the Base and Inner
            //Categories ComboBoxes
            if (eBase != null && eInner != null && !IsMultiSearch)
            {
                //Refine the search from Base Category by Inner Category
                //and display the results in the DataGrid
                dataLib.ItemsSource =
                    mainLibrary.FindInnerByBaseCategory((eBaseCategory)eBase, (eInnerCategory)eInner);
            }
            else if (IsMultiSearch)
            {
                //Make Multiply Search by numerous parameters
                //including search form Base Category,
                //which was refined by Inner Category
                MultipleSearch();
            }
        }