Octgn.Play.PlayWindow.OnLoaded C# (CSharp) Method

OnLoaded() private method

private OnLoaded ( object sen, RoutedEventArgs routedEventArgs ) : void
sen object
routedEventArgs System.Windows.RoutedEventArgs
return void
        private void OnLoaded(object sen, RoutedEventArgs routedEventArgs)
        {
            this.Loaded -= OnLoaded;
            _fadeIn = (Storyboard)Resources["ImageFadeIn"];
            _fadeOut = (Storyboard)Resources["ImageFadeOut"];

            // I think this is the thing that previews a card if you hover it.
            cardViewer.Source = StringExtensionMethods.BitmapFromUri(new Uri(Program.GameEngine.Definition.CardSize.Back));
            //if (Program.GameEngine.Definition.CardCornerRadius > 0)
            cardViewer.Clip = new RectangleGeometry();
            AddHandler(CardControl.CardHoveredEvent, new CardEventHandler(CardHovered));
            AddHandler(CardRun.ViewCardModelEvent, new EventHandler<CardModelEventArgs>(ViewCardModel));

            Loaded += (sender, args) => Keyboard.Focus(table);
            // Solve various issues, like disabled menus or non-available keyboard shortcuts

            GroupControl.groupFont = new FontFamily("Segoe UI");
            GroupControl.fontsize = 12;
            chat.output.FontFamily = new FontFamily("Segoe UI");
            //chat.output.FontSize = Prefs.ChatFontSize;
            chat.watermark.FontFamily = new FontFamily("Segoe UI");

            UpdateFont();

            Log.Info(string.Format("Checking if the loaded game has boosters for limited play."));
            int setsWithBoosterCount = Program.GameEngine.Definition.Sets().Where(x => x.Packs.Count() > 0).Count();
            Log.Info(string.Format("Found #{0} sets with boosters.", setsWithBoosterCount));
            if (setsWithBoosterCount == 0)
            {
                LimitedGameMenuItem.Visibility = Visibility.Collapsed;
                Log.Info("Hiding limited play in the menu.");
            }
            //SubTimer.Start();

            if (!X.Instance.Debug)
            {
                // Show the Scripting console in dev only
                if (Application.Current.Properties["ArbitraryArgName"] == null) return;
                string fname = Application.Current.Properties["ArbitraryArgName"].ToString();
                if (fname != "/developer") return;
            }

        }