void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.UserControl = ((KarliCards_GUI.CardControl)(target));
                return;

            case 2:
                this.SuitLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.RankLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.RankLabelInverted = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.TopRightImage = ((System.Windows.Controls.Image)(target));
                return;

            case 6:
                this.BottomLeftImage = ((System.Windows.Controls.Image)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #2
0
        public GameClient()
        {
            InitializeComponent();
            var position = new Point(15, 15);

            for (var i = 0; i < 4; i++)
            {
                var suit = (Ch13CardLib.Suit)i;
                position.Y = 15;
                for (int rank = 1; rank < 14; rank++)
                {
                    position.Y += 30;
                    var card = new CardControl(new Ch13CardLib.Card((Ch13CardLib.Suit)suit, (Ch13CardLib.Rank)rank));
                    card.VerticalAlignment   = VerticalAlignment.Top;
                    card.HorizontalAlignment = HorizontalAlignment.Left;
                    card.Margin = new Thickness(position.X, position.Y, 0, 0);
                    contentGrid.Children.Add(card);
                }
                position.X += 112;
            }
        }