コード例 #1
0
ファイル: InputViewModel.cs プロジェクト: Mecteral/Calculator
        public InputViewModel(IWpfCalculationExecutor executor, IApplicationArguments arguments,
                              IEventAggregator eventAggregator, InputStringValidator validator, IConversionProperties conversionProperties, IWindowProperties windowProperties, IUnitsAndAbbreviationsSource unitsAndAbbreviationsSource)
        {
            mExecutor                    = executor;
            mArguments                   = arguments;
            mEventAggregator             = eventAggregator;
            mValidator                   = validator;
            mConversionProperties        = conversionProperties;
            mWindowProperties            = windowProperties;
            mUnitsAndAbbreviationsSource = unitsAndAbbreviationsSource;

            mStepExpander = mWindowProperties.AreStepsExpanded;
        }
コード例 #2
0
 public ShellViewModel(
     InputViewModel input,
     ConversionViewModel conversion,
     IEventAggregator eventAggregator,
     ConfigurationWindowViewModel configurationWindow,
     IWindowManager windowManager,
     IWindowProperties windowProperties,
     IConversionProperties conversionProperties)
 {
     mConfigurationWindow  = configurationWindow;
     mWindowManager        = windowManager;
     mWindowProperties     = windowProperties;
     mConversionProperties = conversionProperties;
     Input      = input;
     Conversion = conversion;
     eventAggregator.Subscribe(this);
     SetupWindowAttributesFromConfig();
 }
コード例 #3
0
 public ConversionViewModel(IEventAggregator eventAggregator, IWindowProperties windowProperties,
                            IConversionProperties conversionProperties)
 {
     mEventAggregator      = eventAggregator;
     mWindowProperties     = windowProperties;
     mConversionProperties = conversionProperties;
     SetListsForView();
     AllUnitsAndAbbreviations = new List <List <UnitAbbreviationsAndNames> >
     {
         MetricalMasses,
         MetricalAreas,
         MetricalLengths,
         MetricalVolumes,
         ImperialMasses,
         ImperialAreas,
         ImperialLengths,
         ImperialVolumes
     };
     SetUnitOnStartup();
     mToMetric     = mConversionProperties.DoUseMetricSystem;
     mToImperial   = !mConversionProperties.DoUseMetricSystem;
     mUnitExpander = mWindowProperties.AreUnitsExpanded;
 }