コード例 #1
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (_loaded)
            {
                return;
            }
            _loaded = true;

            AboutHelper.Instance.PropertyChanged += OnAboutPropertyChanged;
            UpdateAboutIsNew();

            var background = AppArguments.Get(AppFlag.Background);

            if (string.IsNullOrWhiteSpace(background))
            {
                FancyBackgroundManager.Instance.AddListener(this);
                SetThemeDynamicBackgroundListener();
            }
            else
            {
                background = FileUtils.GetFullPath(background, () => FilesStorage.Instance.GetDirectory("Themes", "Backgrounds"));
                ApplyDynamicBackground(background, AppArguments.GetDouble(AppFlag.BackgroundOpacity, 0.5));
            }

            if (CupViewModel.Instance.ToUpdate.Count > 0)
            {
                FancyHints.ContentUpdatesArrived.Trigger();
            }
            else
            {
                CupViewModel.Instance.NewUpdate += (o, args) => FancyHints.ContentUpdatesArrived.Trigger();
            }
            Logging.Debug("Main window is loaded and ready");
        }
コード例 #2
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (_loaded)
            {
                return;
            }
            _loaded = true;

            AboutHelper.Instance.PropertyChanged += OnAboutPropertyChanged;
            UpdateAboutIsNew();

            var background = AppArguments.Get(AppFlag.Background);

            if (string.IsNullOrWhiteSpace(background))
            {
                FancyBackgroundManager.Instance.AddListener(this);
                SetThemeDynamicBackgroundListener();
            }
            else
            {
                background = FileUtils.GetFullPath(background, () => FilesStorage.Instance.GetDirectory("Themes", "Backgrounds"));
                ApplyDynamicBackground(background, AppArguments.GetDouble(AppFlag.BackgroundOpacity, 0.5));
            }
        }