void LoadSearchResult() { if (txtSearchBox.Text != string.Empty) { holderPanel2.Children.Clear(); medicinenamefromtextbox = txtSearchBox.Text; //Create The Control mdic2 = new MediInfoWindowCard2(medicinenamefromtextbox) { //Hide The Color Changing Buttons. isColorChangeButtonVisible = Visibility.Hidden }; //If dataRecived is true then Show if (mdic2.dataRecived == true) { mdic2.ControlTheme = currentTheme; holderPanel2.Children.Add(mdic2); } //Else show a error Text; else { errorText.Text = $"Sorry, No Medicine Found On Name \"{medicinenamefromtextbox}\" or Stock Is EMPTY "; holderPanel2.Children.Add(errorText); } txtSearchBox.Focus(); } }
void LoadSearchResult3() { if (txtTMed.Text != string.Empty) { MED3.Children.Clear(); medicinenamefromtextbox3 = txtTMed.Text; //Create The Control mdic3 = new MediInfoWindowCard2(medicinenamefromtextbox3) { //Hide The Color Changing Buttons. ControlTheme = Themes.dark, isColorChangeButtonVisible = Visibility.Visible }; //If dataRecived is true then Show if (mdic3.dataRecived == true) { MED3.Children.Add(mdic3); } //Else show a error Text; else { /* errorText.Text = $"Sorry, No Medicine Found On Name \"{medicinenamefromtextbox3}\" "; * MED3.Children.Add(errorText);*/ } txtTMed.Focus(); } }