Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            Trace.Listeners.Add(new TextBoxTraceListener(Options.OptionsTrackerLogging.TextBoxLog));
            EnableMenuItems(false);
            TagControlEdit.StackPanelFilterOptions.Visibility       = Collapsed;
            TagControlEdit.GroupBoxSortingAllConstructed.Visibility = Collapsed;
            TagControlEdit.GroupBoxSortingArena.Visibility          = Collapsed;
            SortFilterDecksFlyout.HideStuffToCreateNewTag();
            FlyoutNotes.ClosingFinished += (sender, args) => DeckNotesEditor.SaveDeck();
            WarningFlyout.OnComplete    += () =>
            {
                FlyoutWarnings.IsOpen = false;
                Config.Instance.CheckConfigWarnings();
            };
#if (DEBUG)
            Title += " [DEBUG]";
#endif
#if (DEV)
            StatusBarDev.Visibility = Visible;
#endif
            Config.Instance.OnConfigWarning += warning =>
            {
                WarningFlyout.SetConfigWarning(warning);
                FlyoutWarnings.IsOpen = true;
            };
            Config.Instance.CheckConfigWarnings();

            HsReplayDecks.OnLoaded += () =>
            {
                DeckPickerList.RefreshDisplayedDecks();
                OnPropertyChanged(nameof(HsReplayButtonVisibility));
                Influx.OnHsReplayDataLoaded();
            };
        }
        public MainWindow()
        {
            InitializeComponent();
            TagControlEdit.StackPanelFilterOptions.Visibility       = Collapsed;
            TagControlEdit.GroupBoxSortingAllConstructed.Visibility = Collapsed;
            TagControlEdit.GroupBoxSortingArena.Visibility          = Collapsed;
            SortFilterDecksFlyout.HideStuffToCreateNewTag();
            FlyoutNotes.ClosingFinished += (sender, args) => DeckNotesEditor.SaveDeck();
            WarningFlyout.OnComplete    += () =>
            {
                FlyoutWarnings.IsOpen = false;
                Config.Instance.CheckConfigWarnings();
            };
#if (DEBUG)
            Title += " [DEBUG]";
#endif
#if (DEV)
            StatusBarDev.Visibility = Visible;
#endif
            Config.Instance.OnConfigWarning += warning =>
            {
                WarningFlyout.SetConfigWarning(warning);
                FlyoutWarnings.IsOpen = true;
            };
            Config.Instance.CheckConfigWarnings();

            HsReplayDataManager.Decks.OnLoaded += () =>
            {
                DeckPickerList.RefreshDisplayedDecks();
                OnPropertyChanged(nameof(HsReplayButtonVisibility));
                Influx.OnHsReplayDataLoaded();
            };

            HSReplayNetOAuth.Authenticated += ActivateWindow;

            RemoteConfig.Instance.Loaded += data =>
            {
                OnPropertyChanged(nameof(CollectionSyncingBannerVisbiility));
                OnPropertyChanged(nameof(CollectionSyncingBannerRemovable));
            };

            HSReplayNetHelper.CollectionUploaded += () =>
            {
                OnPropertyChanged(nameof(CollectionSyncingBannerRemovable));
            };

            HSReplayNetOAuth.LoggedOut += () =>
            {
                OnPropertyChanged(nameof(CollectionSyncingBannerVisbiility));
                OnPropertyChanged(nameof(CollectionSyncingBannerRemovable));
            };
        }