Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SupplyCareSettingItemVm"/> class.
        /// </summary>
        /// <param name="supplyCareSettingCtrlVm">The supply care setting CTRL vm.</param>
        /// <param name="view">The view.</param>
        /// <param name="viewModel">The view model.</param>
        /// <param name="title">The title.</param>
        /// <param name="isExpandable">The is expandable.</param>
        /// <param name="automationId">The automation id.</param>
        public SupplyCareSettingItemVm(SupplyCareSettingCtrlVm supplyCareSettingCtrlVm, UserControl view, PageViewModel viewModel, string title, bool isExpandable, [Localizable(false)] string automationId)
        {
            this.supplyCareSettingCtrlVm = supplyCareSettingCtrlVm;
            this.ItemTitle = title;

            this.AutomationId  = automationId;
            this.expandCommand = new DelegateCommand(this.Expand);

            this.OwnConfiguration = new OwnConfigurationControlVm();

            this.GoToPage(view, viewModel);

            if (isExpandable)
            {
                this.IsExpanded             = false;
                this.Visibility             = Visibility.Visible;
                this.ExpandButtonVisibility = Visibility.Visible;
            }
            else
            {
                this.IsExpanded             = true;
                this.Visibility             = Visibility.Visible;
                this.ExpandButtonVisibility = Visibility.Collapsed;
            }
        }
        public SettingsVm(MainWindowVm mainWindowVm)
        {
            if (mainWindowVm == null)
            {
                throw new ArgumentNullException(@"mainWindowVm");
            }

            this.MainWindowVm = mainWindowVm;

            this.InitializeSettings();

            this.bridgeSettingControlVm = new BridgeSettingCtrlVm(mainWindowVm);
            this.bridgeSettingControl   = new BridgeSettingControl();

            this.supplyCareSettingCtrlVm  = new SupplyCareSettingCtrlVm(mainWindowVm);
            this.supplyCareSettingControl = new SupplyCareSettingControl();

            this.fisSettingControlVm = new FisSettingCtrlVm(mainWindowVm);
            this.fisSettingControl   = new FisSettingControl();

            this.languageControlVm = new LanguageControlVm(this.settings, mainWindowVm.Host);
            this.languageControl   = new LanguageControl();

            this.OwnConfiguration = new OwnConfigurationControlVm();

            this.CurrentSection = SettingsSection.Bridge;

            this.Choice = new BaseSelectorControlViewModel();
            this.Choice.SelectedItemChanged += this.ChoiceSelectedItemChangedHandler;
            this.Choice.Items.Add(new BaseSelectorItemViewModel(Resources.ImsOpcBridge, string.Empty, string.Empty, "automId_ImsOpcBridge", SettingsSection.Bridge, 1));
            this.Choice.Items.Add(new BaseSelectorItemViewModel(Resources.SupplyCareEnterprise, string.Empty, string.Empty, "automId_SupplyCareEnterprise", SettingsSection.SupplyCareEnterprise, 2));

            // emilio temp FIS disabled for the first release. Only this line must be commented / uncommented.
            // this.Choice.Items.Add(new BaseSelectorItemViewModel(Resources.FieldInformationServer, string.Empty, string.Empty, "automId_FieldInformationServer", SettingsSection.FieldInformationServer, 3));

            //// this.Choice.Items.Add(new BaseSelectorItemViewModel(Resources.UserLoginPassword, string.Empty, string.Empty, "automId_UserLoginPassword", SettingsSection.UserLoginPassword, 4));
            if (ImsOpcBridgeSettings.Singleton.AllowCultureChange)
            {
                this.Choice.Items.Add(new BaseSelectorItemViewModel(Resources.LanguageCommandName, string.Empty, string.Empty, "automId_Language", SettingsSection.Language, 4));
            }

            ////this.Choice.Items.Add(new BaseSelectorItemViewModel(string.Empty, string.Empty, string.Empty, "automId_Empty1", SettingsSection.Default, 5));

            this.Choice.SelectItem(this.CurrentSection);
        }