private void Btn_A1_A3_Click(object sender, RoutedEventArgs e)
        {
            A1A3Element selectedA1A3Values = selectedMaterial.materialA1A3Properties;

            if (selectedA1A3Values == null)
            {
                selectedA1A3Values = new A1A3Element();
            }

            MaterialA1A3Picker materialBase = new MaterialA1A3Picker(selectedA1A3Values);

            materialBase.ShowDialog();

            if (materialBase.isAccepted == true)
            {
                chx_A1_A3_Manual.IsChecked              = false;
                selectedMaterial.ECI_A1A3_Override      = false;
                selectedMaterial.materialA1A3Properties = materialBase.a1a3ElementSelected;

                selectedMaterial.Category = selectedMaterial.materialA1A3Properties.Category;
                selectedMaterial.ECI_A1A3 = selectedMaterial.materialA1A3Properties.ECI_A1A3;

                if (selectedMaterial.materialA1A3Properties.Density != selectedMaterial.Density)
                {
                    MessageBoxResult result = MessageBox.Show("The material density of your selected material does not match the material density of your base material, do you wish to override this with the new value?", "Warning", MessageBoxButton.YesNo);
                    if (result == MessageBoxResult.Yes)
                    {
                        selectedMaterial.Density = selectedMaterial.materialA1A3Properties.Density;
                    }
                }
            }

            UpdateMaterialSettings();
        }
        private void lib_Materials_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            A1A3Element a1a3Element = lib_Materials.SelectedItem as A1A3Element;

            if (a1a3Element != null)
            {
                a1a3ElementSelected = a1a3Element;
                //txt_Search.Text = a1a3Element.Name;
                refreshInterface();
            }
        }
        public MaterialA1A3Picker(A1A3Element a1a3Element)
        {
            isAccepted = false;
            this.a1a3ElementSelected = a1a3Element;

            a1a3Collection = new A1A3Collection();
            if (a1a3Collection != null)
            {
                a1a3Collection.LoadAll();
            }

            InitializeComponent();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            List <string> groupNames    = a1a3Collection.GetGroupNames();
            List <string> categorynames = a1a3Collection.GetCategoryList(groupNames[0]);

            //Check if a element leeds to be loaded, if not show blank screen

            foreach (string grp in groupNames)
            {
                cbb_Group.Items.Add(grp);
            }

            if (a1a3ElementSelected != null)
            {
                a1a3ElementSelected = new A1A3Element();
            }

            if (a1a3ElementSelected.Group != null)
            {
                cbb_Group.Text = a1a3ElementSelected.Group;
            }
            else
            {
                cbb_Group.Text = groupNames[0];
            }

            if (a1a3ElementSelected.Category != null)
            {
                cbb_Categories.Text = a1a3ElementSelected.Category;
            }
            else
            {
                cbb_Categories.Text = "ALL";
            }

            //lib_Materials.SelectedItem = a1a3ElementSelected;
        }