public CompDetails(Object data) : this() { this.DataContext = data; if (data is Employee) { Employee emp = (Employee)data; string nameStock = ""; string valueStock = ""; string nameReport = ""; string valueReport = ""; string nameDegree = ""; string valueDegree = ""; string nameNOSales = ""; string valueNOSales = ""; string nameShift = ""; string valueShift = ""; emp.GetSpareProp1(ref nameStock, ref valueStock); this.SpareProp1Name.Content = nameStock; this.SpareProp1Value.Content = valueStock; SpareProp1.Visibility = Visibility.Visible; emp.GetSpareProp2(ref nameReport, ref valueReport); this.SpareProp2Name.Content = nameReport; this.SpareProp2Value.Content = valueReport; SpareProp2.Visibility = Visibility.Visible; emp.GetSpareProp3(ref nameDegree, ref valueDegree); this.SpareProp3Name.Content = nameDegree; this.SpareProp3Value.Content = valueDegree; SpareProp3.Visibility = Visibility.Visible; emp.GetSpareProp4(ref nameNOSales, ref valueNOSales); this.SpareProp4Name.Content = nameNOSales; this.SpareProp4Value.Content = valueNOSales; SpareProp4.Visibility = Visibility.Visible; emp.GetSpareProp5(ref nameShift, ref valueShift); this.SpareProp5Name.Content = nameShift; this.SpareProp5Value.Content = valueShift; SpareProp5.Visibility = Visibility.Visible; } }
public CompDetails(Object data) : this() { this.DataContext = data; if (data is Employee) { Employee emp = (Employee)data; string name = ""; string value= ""; emp.GetSpareProp1(ref name, ref value); this.SpareProp1Name.Content = name; this.SpareProp1Value.Content = value; SpareProp1Name.Visibility = Visibility.Visible; SpareProp1Value.Visibility = Visibility.Visible; } }
public CompDetails(Object data) : this() { this.DataContext = data; if (data is Employee) { Employee emp = (Employee)data; string name = ""; string value = ""; // Set spare prop name and value emp.GetSpareProp1(ref name, ref value); this.SpareProp1Name.Content = name; this.SpareProp1Value.Content = value; // Make visible after setting values this.SpareProp1Name.Visibility = Visibility.Visible; this.SpareProp1Value.Visibility = Visibility.Visible; } }