/// <summary>
        /// Initializes a new instance of the <see cref="ShellViewModel"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="commonServices">The common services.</param>
        /// <param name="settingsService">The settings services.</param>
        /// <param name="logger">The logger factory.</param>
        /// <param name="themeService">The theme selector service.</param>
        /// <param name="localizationFunctions">The localization functions.</param>
        public ShellViewModel(
            IContext context,
            ICommonServices commonServices,
            IBaseApplicationSettingsService settingsService,
            ILogger logger,
            IThemeService themeService,
            LocalizationFunctions localizationFunctions)
            : base(context, commonServices, settingsService, logger, themeService, localizationFunctions)
        {
            CommonServices = commonServices;

            Title       = commonServices.InfoService.ProductName;
            Version     = commonServices.InfoService.ProductVersion;
            DisplayName = "User";

            Display_Command        = new Command(async() => await OpenDisplayAsync());
            Info_Command           = new Command(async() => await OpenInfoAsync());
            Browse_Command         = new Command(async() => await BrowseFileAsync());
            Converter_Command      = new Command(async() => await OpenConvertersAsync());
            SelectionTest_Command  = new Command(async() => await OpenSelectionTestAsync());
            ListViewTest_Command   = new Command(async() => await OpenListViewTestAsync());
            ValidationTest_Command = new Command(async() => await OpenValidationTestAsync());

            PopulateNavItems();
        }
Пример #2
0
        public void CheckIfCultureIsSetToEnglishTest()
        {
            var x = new LocalizationFunctions(Context, Settings);

            x.SetLocalizationLanguage("en");

            Assert.AreEqual("en", Settings.Culture);
        }
Пример #3
0
        public void CheckIfCurrencyIsSetToDollarTest()
        {
            var x = new LocalizationFunctions(Context, Settings);

            x.SetLocalizationLanguage("en");

            Assert.AreEqual("$", Context.CurrencySymbol);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LanguageViewModel"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="commonServices">The common services.</param>
        /// <param name="appSettingsService">The settings services.</param>
        /// <param name="localizationFunctions">The localization functions.</param>
        /// <param name="logger">The logger factory.</param>
        public LanguageViewModel(
            IContext context,
            IBaseCommonServices commonServices,
            IBaseApplicationSettingsService appSettingsService,
            LocalizationFunctions localizationFunctions,
            ILogger logger)
            : base(context, commonServices, logger)
        {
            _localizationFunctions = localizationFunctions;
            _appSettingsService    = appSettingsService;

            SetLanguage_Command = new Command <string>((e) => SelectedItem = e);
            SelectedItem        = _appSettingsService.Settings.Culture;
        }