public void Initialize(Models.FixedItemsList fixedItemsList, bool isForEditing) { FieldName.Content = fixedItemsList.Name; FixedItemsList dataStructure = DataStructure.GetAllAppFields()[fixedItemsList.Id] as FixedItemsList; foreach (Field dsField in dataStructure.Items) { Field field = fixedItemsList.Items.Find(x => x.Id == dsField.Id); if (field == null) { field = ObjectCopier.Clone <Field>(dsField); fixedItemsList.Items.Add(field); } field.SetName(dsField.Name); Container.Children.Add(field.GenerateUIElement(isForEditing)); } if (fixedItemsList.IsConditional) { Binding b = new Binding(); b.Source = fixedItemsList; b.Path = new PropertyPath("BoolValue"); b.Mode = BindingMode.TwoWay; BoolValue.IsChecked = fixedItemsList.BoolValue; BindingOperations.SetBinding(BoolValue, System.Windows.Controls.CheckBox.IsCheckedProperty, b); Container.Visibility = fixedItemsList.BoolValue ? Visibility.Visible : Visibility.Collapsed; } else { BoolValue.Visibility = Visibility.Collapsed; } }