示例#1
0
        public TranslationAggregatorWindow(TranslationAggregatorViewModel viewModel)
        {
            _viewModel = viewModel;

            _windowRect = new Rect(20, 20, _viewModel.Width, WindowHeight);

            _originalText       = new ScrollPositioned();
            _defaultTranslation = new ScrollPositioned();
            _translationViews   = viewModel.AvailableTranslators.Select(x => new ScrollPositioned <TranslatorViewModel>(x)).ToArray();
        }
 public AggregatedTranslationViewModel(TranslationAggregatorViewModel parent, List <Translation> translations)
 {
     _parent                = parent;
     _translations          = translations;
     AggregatedTranslations = parent.AvailableTranslators.Select(
         x => new IndividualTranslatorTranslationViewModel(
             x,
             new IndividualTranslationViewModel(
                 x,
                 translations.Select(y => new Translation(y.OriginalText, null)).ToList()))).ToList();
 }
示例#3
0
 public TranslationAggregatorOptionsWindow(TranslationAggregatorViewModel viewModel)
 {
     _viewModel = viewModel;
     _toggles   = _viewModel.AllTranslators.Select(x =>
                                                   new ToggleViewModel(
                                                       " " + x.Endpoint.Endpoint.FriendlyName,
                                                       null,
                                                       null,
                                                       () => x.IsEnabled = !x.IsEnabled,
                                                       () => x.IsEnabled,
                                                       x.Endpoint.Error == null)).ToList();
 }