public YesNoFieldVariable(VariableInstance variableInstance, FormControlScopeViewModel controlScopeViewModel, ScopeResources scopeResources, BooleanSettings settings)
            : base(variableInstance, controlScopeViewModel, scopeResources)
        {
            NoText = settings.UseTrueOrFalse ? "False" : "No";
            YesText = settings.UseTrueOrFalse ? "True" : "Yes";
            DefaultValue = settings.DefaultValue;

            if (variableInstance.Variable.Value == null)
            {
                Value = settings.DefaultValue.ToString().ToLower();
                IsYesChecked = settings.DefaultValue;
                IsNoChecked = settings.DefaultValue == false;
            }
            else
            {
                Value = variableInstance.Variable.Value.ToLower();
            }
        }
Example #2
0
        protected FieldVariable(VariableInstance variableInstance, FormControlScopeViewModel viewModel, ScopeResources scopeResources)
        {
            ScopeResources = scopeResources;
            Value = variableInstance.Variable.Value;
            ViewModel = viewModel;
            VariableInstance = variableInstance;
            _scopeText = ScopeResources.Text;

            ScopeResources.MachineSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            ScopeResources.EnvironmentSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            ScopeResources.RoleSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            ScopeResources.ActionSelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
        }
        public DropdownFieldVariable(VariableInstance variableInstance, FormControlScopeViewModel controlScopeViewModel,
            ScopeResources scopeResources)
            : base(variableInstance, controlScopeViewModel, scopeResources)
        {

        }