private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            ThemeSetterManager.SetThemeSelectedThemes();
            UpdateHelpers.OnAutoUpdate = () =>
            {
                this.Dispatcher.Invoke(() =>
                {
                    var nhmUpdaterDialog = new CustomDialog()
                    {
                        Title            = Translations.Tr("NiceHash Miner Starting Update"),
                        Description      = Translations.Tr("NiceHash Miner auto updater in progress."),
                        OkText           = Translations.Tr("OK"),
                        CancelVisible    = Visibility.Collapsed,
                        OkVisible        = Visibility.Collapsed,
                        AnimationVisible = Visibility.Visible
                    };
                    ShowContentAsModalDialog(nhmUpdaterDialog);
                });
            };
            await MainWindow_OnLoadedTask();

            _vm.GUISettings.PropertyChanged += GUISettings_PropertyChanged;
            NotificationsManager.Instance.PropertyChanged += Instance_PropertyChanged;
            MiningState.Instance.PropertyChanged          += MiningStateInstance_PropertyChanged;
            SetNotificationCount(NotificationsManager.Instance.NotificationNewCount);
        }
Beispiel #2
0
        private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            ThemeSetterManager.SetThemeSelectedThemes();
            UpdateHelpers.OnAutoUpdate = () =>
            {
                this.Dispatcher.Invoke(() =>
                {
                    var nhmUpdaterDialog = new CustomDialog()
                    {
                        Title            = Translations.Tr("NiceHash Miner Starting Update"),
                        Description      = Translations.Tr("NiceHash Miner auto updater in progress."),
                        OkText           = Translations.Tr("OK"),
                        CancelVisible    = Visibility.Collapsed,
                        OkVisible        = Visibility.Collapsed,
                        AnimationVisible = Visibility.Visible,
                        ExitVisible      = Visibility.Collapsed
                    };
                    ShowContentAsModalDialog(nhmUpdaterDialog);
                });
            };
            await MainWindow_OnLoadedTask();

            _vm.GUISettings.PropertyChanged += GUISettings_PropertyChanged;
            NotificationsManager.Instance.PropertyChanged += Instance_PropertyChanged;
            MiningState.Instance.PropertyChanged          += MiningStateInstance_PropertyChanged;
            SetNotificationCount(NotificationsManager.Instance.NotificationNewCount);

            if (!HasWriteAccessToFolder(Paths.Root))
            {
                this.Dispatcher.Invoke(() =>
                {
                    var nhmNoPermissions = new CustomDialog()
                    {
                        Title            = Translations.Tr("Folder lacks permissions"),
                        Description      = Translations.Tr("NiceHash Miner folder doesn't have write access. This can prevent some features from working."),
                        OkText           = Translations.Tr("OK"),
                        CancelVisible    = Visibility.Collapsed,
                        OkVisible        = Visibility.Visible,
                        AnimationVisible = Visibility.Collapsed
                    };
                    ShowContentAsModalDialog(nhmNoPermissions);
                });
            }
        }