コード例 #1
0
        public void SelectEntry(ResourceTableEntry entry)
        {
            SelectedTabIndex = 0;

            Dispatcher.BeginInvoke(DispatcherPriority.Background, () =>
            {
                ResourceViewModel.SelectEntry(entry);
            });
        }
コード例 #2
0
        public ResourceView(IExportProvider exportProvider)
        {
            _resourceManager   = exportProvider.GetExportedValue <ResourceManager>();
            _resourceViewModel = exportProvider.GetExportedValue <ResourceViewModel>();
            _configuration     = exportProvider.GetExportedValue <Configuration>();
            _tracer            = exportProvider.GetExportedValue <ITracer>();
            _resourceViewModel.ClearFiltersRequest += ResourceViewModel_ClearFiltersRequest;

            try
            {
                this.SetExportProvider(exportProvider);

                _resourceManager.Loaded += ResourceManager_Loaded;

                InitializeComponent();

                DataGrid?.SetupColumns(_resourceManager, _resourceViewModel, _configuration);
            }
            catch (Exception ex)
            {
                exportProvider.TraceXamlLoaderError(ex);
            }
        }
コード例 #3
0
        public TranslationsViewModel(TranslatorHost translatorHost, ResourceManager resourceManager, ResourceViewModel resourceViewModel, IConfiguration configuration)
        {
            TranslatorHost     = translatorHost;
            _resourceManager   = resourceManager;
            _resourceViewModel = resourceViewModel;

            Configuration = configuration;

            _resourceManager.Loaded += ResourceManager_Loaded;

            SourceCulture = _resourceManager.Cultures.FirstOrDefault();

            var selectedTargetCultures = new ObservableCollection <CultureKey>();

            selectedTargetCultures.CollectionChanged += SelectedTargetCultures_CollectionChanged;
            SelectedTargetCultures = selectedTargetCultures;

            TranslatorHost.SessionStateChanged += (_, __) => Dispatcher.BeginInvoke(() =>
            {
                OnPropertyChanged(nameof(TranslatorHost));
                CommandManager.InvalidateRequerySuggested();
            });
        }
コード例 #4
0
        public ShellViewModel([NotNull] ResourceViewModel resourceViewModel)
        {
            _resourceViewModel = resourceViewModel;

            resourceViewModel.SelectedEntities.CollectionChanged += SelectedEntities_CollectionChanged;
        }