public void SelectEntry(ResourceTableEntry entry) { SelectedTabIndex = 0; Dispatcher.BeginInvoke(DispatcherPriority.Background, () => { ResourceViewModel.SelectEntry(entry); }); }
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); } }
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(); }); }
public ShellViewModel([NotNull] ResourceViewModel resourceViewModel) { _resourceViewModel = resourceViewModel; resourceViewModel.SelectedEntities.CollectionChanged += SelectedEntities_CollectionChanged; }