private void WindowLoaded(object sender, RoutedEventArgs e) { TypePay = Owner as WTypePay; cb.ItemsSource = RepositoryTypePay.TypePays; var name = Sub + "_" + xName.Content + "x" + yName.Content; B = (Button)(TypePay.FindName(name)); if (B != null) { int indx; if (int.TryParse(B.ToolTip == null ? "-1" : B.ToolTip.ToString().Replace("TypesPay", ""), out indx)) { cb.SelectedItem = RepositoryTypePay.GetById(indx); } } }
private void Window_Loaded(object sender, RoutedEventArgs e) { TypePay = this.Owner as W_TypePay; cb.ItemsSource = ClassSync.TypesPayDB.t; string name = sub + "_" + this.xName.Content + "x" + this.yName.Content; b = (Button)(TypePay.FindName(name)); if (b != null) { int indx = -1; if (int.TryParse(b.ToolTip == null ? "-1" : b.ToolTip.ToString().Replace("TypesPay", ""), out indx)) { cb.SelectedItem = ClassBond.getTypesPayDBFromId(indx); } } }