Example #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            List <string> materialCategories = new List <string>();

            materialCategories = materialDatabase.getCategoryList();

            materialCategories.Sort();

            foreach (string cat in materialCategories)
            {
                cbb_Categories.Items.Add(cat);
            }

            cbb_Categories.Items.Add("All");
            if (currentMaterial != null)
            {
                cbb_Categories.Text = currentMaterial.Category;
            }
            else
            {
                cbb_Categories.Text = "All";
            }

            RefreshMaterialList();
            UpdateSelectedMaterial();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (basematerials != null)
            {
                IList <string> categories = basematerials.getCategoryList();
                foreach (string cat in categories)
                {
                    cbb_Categories.Items.Add(cat);
                }
                cbb_Categories.Items.Add("All");
                cbb_Categories.Text = "All";
            }

            lib_Materials.ItemsSource = basematerials.CarboMaterialList;
            int index = 0;
            int i     = 0;

            foreach (CarboMaterial ibm in lib_Materials.Items.SourceCollection)
            {
                if (ibm.Name == selectedBaseMaterial.Name)
                {
                    index = i;
                    break;
                }
                i++;
            }
            lib_Materials.SelectedIndex = index;
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            List <string> materialCategories = new List <string>();

            materialCategories = returnedDatabase.getCategoryList();
            materialCategories.Sort();

            foreach (string cat in materialCategories)
            {
                cbb_Categories.Items.Add(cat);
                cbb_Category.Items.Add(cat);
            }

            cbb_Categories.Items.Add("All");
            cbb_Categories.Text = "All";

            RefreshMaterialList();
            selectMaterial(selectedMaterial.Name);

            UpdateMaterialSettings();
        }