private void UpdateControls() { stack_Options.Children.Clear(); if (RegisteredVariables == null) { return; } foreach (var variablename in RegisteredVariables.GetRegisteredVariableKeys()) { Control_VariableRegistryItem varItem = new Control_VariableRegistryItem { VariableName = variablename, VarRegistry = VarRegistrySource, //HorizontalContentAlignment = HorizontalAlignment.Stretch, //VerticalContentAlignment = VerticalAlignment.Stretch }; stack_Options.Children.Add(varItem); stack_Options.Children.Add(new Separator() { Height = 5, Opacity = 0 }); } }
private static void VariableNameChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (e.NewValue.Equals(e.OldValue)) { return; } Control_VariableRegistryItem self = (Control_VariableRegistryItem)d; if (self.IsLoaded) { self.UpdateControls(); } }