public StratumDetailViewModel(IDataserviceProvider dataserviceProvider, ISetupInfoDataservice setupDataservice, StratumValidator validator)
            : base(validator)
        {
            if (dataserviceProvider is null)
            {
                throw new ArgumentNullException(nameof(dataserviceProvider));
            }

            var stratumDataservice = dataserviceProvider.GetDataservice <IStratumDataservice>();

            StratumDataservice  = stratumDataservice ?? throw new ArgumentNullException(nameof(stratumDataservice));
            TemplateDataservice = dataserviceProvider.GetDataservice <ITemplateDataservice>() ?? throw new ArgumentNullException(nameof(TemplateDataservice));

            SetupDataservice = setupDataservice ?? throw new ArgumentNullException(nameof(setupDataservice));

            Methods          = SetupDataservice.GetCruiseMethods();
            TreeFieldOptions = TemplateDataservice.GetTreeFields();

            //HotKeyOptions = new string[]
            //{
            //    "A", "B", "C", "D", "E", "F", "G", "H",
            //    "I", "J", "K", "L", "M", "N", "O", "P",
            //    "Q", "R", "S", "T", "U", "V", "X", "Y", "Z",
            //    "1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
            //};
        }
        public StratumTemplateDetailsViewModel(ISetupInfoDataservice setupDataservice, ITemplateDataservice templateDataservice)
        {
            SetupDataservice    = setupDataservice ?? throw new ArgumentNullException(nameof(setupDataservice));
            TemplateDataservice = templateDataservice ?? throw new ArgumentNullException(nameof(templateDataservice));

            Methods = SetupDataservice.GetCruiseMethods().ToArray();
        }
Example #3
0
        public StratumTemplateListViewModel(ITemplateDataservice templateDataservice, ISaleDataservice saleDataservice, ISetupInfoDataservice setupDataservice, IDialogService dialogService)
        {
            TemplateDataservice = templateDataservice ?? throw new ArgumentNullException(nameof(templateDataservice));
            DialogService       = dialogService ?? throw new ArgumentNullException(nameof(dialogService));
            SaleDataservice     = saleDataservice ?? throw new ArgumentNullException(nameof(saleDataservice));
            SetupDataservice    = setupDataservice ?? throw new ArgumentNullException(nameof(setupDataservice));

            TreeFieldOptions = TemplateDataservice.GetTreeFields();
            Methods          = SetupDataservice.GetCruiseMethods().Select(x => x.Method).ToArray();
        }