Я пытался изменить и привязать источник этого поля со списком к новому имени, чтобы оно было уникальным, могло бы возможно, есть какое-то свойство, которое не позволяет отображать данные в поле со списком.

// код xaml
`
`
// xaml code.cs
` private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
LoadControl();
}
public void LoadControl()
{
Managers.BatchMaterialManager.SetDefaultConnection();
presenter.PopulateComboBox();
Properties.Settings.Default.Process = "Recipes";
string[] arrayOil = RecipeName.Split('/');
string OilIndicator = arrayOil[arrayOil.Length - 2].ToString();
string LastDigit = RecipeName[RecipeName.Length - 2].ToString();
if (OilIndicator == "2") // Has both oils in - allow split
{
txtPPATK601.IsReadOnly = false;
}
}
private void cbxRecipe_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
LoadRecipe();
}
public void LoadRecipe()
{
TotalCrudeOilPerc = 0;
CrudeOilPerc = 0;
CollectionViewSource _StockCodeList = new CollectionViewSource();
_StockCodeList = (CollectionViewSource)this.FindResource("StockCodes");
CollectionViewSource _StockDescList = new CollectionViewSource();
_StockDescList = (CollectionViewSource)this.FindResource("StockDescription");
Managers.BatchMaterialManager.SetAdriotConnection();
presenter.loadIngredients(Convert.ToInt32(cbxRecipe.SelectedValue), _StockCodeList, _StockDescList);
presenter.PopulateTotals();
presenter.loadRecipe(Convert.ToInt32(cbxRecipe.SelectedValue));
string LastDigit = RecipeName.Substring(4, 1).ToString();
if (LastDigit == "2") // Has both oils in - allow split
{
txtPPATK601.IsReadOnly = false;
}
}
public void PopulateComboBox()
{
Managers.BatchMaterialManager.SetAdriotConnection();
var Recipes = Managers.AdrBatchRecipeManager.GetCboRecipe();
Recipes.DefaultView.Sort = "idx";
View.ComboRecipe.ItemsSource = null;
View.ComboRecipe.ItemsSource = Recipes.DefaultView;
View.ComboRecipe.DisplayMemberPath = "StockCodes";
View.ComboRecipe.SelectedValuePath = "idx";
View.ComboRecipe.SelectedIndex = 1;
}`
Подробнее здесь: https://stackoverflow.com/questions/786 ... g-wpf-xaml
Мобильная версия