private void cboScripts_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ScriptLayerHandler handler = (ScriptLayerHandler)this.DataContext;

            handler.OnScriptChanged();
            this.UpdateScriptSettings();
        }
        private void UpdateScriptSettings()
        {
            ScriptLayerHandler handler = (ScriptLayerHandler)this.DataContext;

            this.ScriptPropertiesEditor.RegisteredVariables = handler.GetScriptPropertyRegistry();
            VariableRegistry varReg = this.ScriptPropertiesEditor.RegisteredVariables;

            ScriptPropertiesEditor.Visibility        = varReg == null || varReg.Count == 0 ? Visibility.Hidden : Visibility.Visible;
            ScriptPropertiesEditor.VarRegistrySource = handler.IsScriptValid ? handler.Properties._ScriptProperties : null;
        }
 public Control_ScriptLayer(ScriptLayerHandler layerHandler) : this()
 {
     this.DataContext = layerHandler;
     this.SetProfile(layerHandler.profileManager);
     this.UpdateScriptSettings();
 }