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);
        }
Example #2
0
 public VideoService(params string[] visionApiSubscriptionKeys)
 {
     InitVisionServiceClients(visionApiSubscriptionKeys);
     _loadingService = DependencyInjectionUtil.Resolve <ILoadingService>();
 }
Example #3
0
 public static void RegisterInstance()
 {
     DependencyInjectionUtil.RegisterInstance <IDispatcher>(new Dispatcher(Thread.CurrentThread));
 }
 public BaseViewModel()
 {
     LoadingService = DependencyInjectionUtil.Resolve <ILoadingService>();
 }