public MainWindow() { InitializeComponent(); _loadingService = new LoadingService(); DependencyInjectionUtil.RegisterInstance <ILoadingService>(_loadingService); _loadingService.CurrentStatusChanged += (sender, s) => { Dispatcher.Invoke(() => LoadingTextBlock.Text = s); }; _loadingService.IsLoadingChanged += (sender, b) => { Dispatcher.Invoke(() => { LoadingTextBlock.Visibility = b ? Visibility.Visible : Visibility.Hidden; Loader.Visibility = b ? Visibility.Visible : Visibility.Hidden; }); }; if (string.IsNullOrEmpty((string)Settings.Default["RootFolderPath"])) { Settings.Default["RootFolderPath"] = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos); } NavigateToVideos(null, null); }
public VideoService(params string[] visionApiSubscriptionKeys) { InitVisionServiceClients(visionApiSubscriptionKeys); _loadingService = DependencyInjectionUtil.Resolve <ILoadingService>(); }
public static void RegisterInstance() { DependencyInjectionUtil.RegisterInstance <IDispatcher>(new Dispatcher(Thread.CurrentThread)); }
public BaseViewModel() { LoadingService = DependencyInjectionUtil.Resolve <ILoadingService>(); }