Example #1
0
        public SettingsViewModel(IMorseCoderSettings morseCoderSettings, INavigationService navigationService)
        {
            _morseCoderSettings = morseCoderSettings;
            _navigationService = navigationService;

            _currentTranslationDirection = morseCoderSettings.Direction;

            MorseToAlphabetCommand = new RelayCommand(MorseToAlphabetCommandAction);
            AlphabetToMorseCommand = new RelayCommand(AlphabetToMorseCommandAction);
            BackNavigationCommand = new RelayCommand(BackNavigationCommandAction);
        }
Example #2
0
        public MainViewModel(IMorseCoderSettings morseCoderSettings, INavigationService navigationService)
        {
            _morseCoderSettings = morseCoderSettings;
            _navigationService = navigationService;

            _input = _morseCoderSettings.Input;
            _direction = morseCoderSettings.Direction;

            DotCommand = new RelayCommand(DotCommandAction);
            DashCommand = new RelayCommand(DashCommandAction);
            SpaceCommand = new RelayCommand(SpaceCommandAction);

            AboutNavigateCommand = new RelayCommand(AboutNavigateCommandAction);
            SettingsNavigateCommand = new RelayCommand(SettingsNavigateCommandAction);

            ConfigureTranslator(_direction);

            Translation = _translator.Translate(Input);

            MessengerInstance.Register<SettingsChangedMessage>(this, SettingsChangedMessageHandler);
        }