Пример #1
0
        public void LoadList(SorryCardGamePlayerItem tempPlayer, CommandContainer command)
        {
            _thisPlayer = tempPlayer;
            StackPanel thisStack = new StackPanel();

            thisStack.Orientation = Orientation.Horizontal;
            _clickCommand         = tempPlayer.GetPlainCommand(command, nameof(SorryCardGamePlayerItem.SorryPlayerAsync)); //not just player anymore.
            _thisList             = new CustomBasicList <CardGraphicsWPF>();
            for (int x = 1; x <= 4; x++)
            {
                var thisCard = new CardGraphicsWPF();
                _thisList.Add(thisCard);
                thisCard.SendSize("", new SorryCardGameCardInformation());
                thisCard.DataContext = null;
                thisStack.Children.Add(thisCard);
            }
            Text        = _thisPlayer.NickName;
            DataContext = _thisPlayer;
            var thisRect = ThisFrame.GetControlArea();

            thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3);
            var thisGrid = new Grid();

            thisGrid.Children.Add(ThisDraw);
            thisGrid.Children.Add(thisStack);
            Content = thisGrid;
            _clickCommand !.CanExecuteChanged += ClickCommandChange;
            MouseUp += BoardWPF_MouseUp;
            _thisPlayer.PropertyChanged += ThisPlayerPropertyChange;
            RefreshList();
        }
Пример #2
0
        public void LoadList(SorryCardGamePlayerItem tempPlayer, CommandContainer command)
        {
            _thisPlayer = tempPlayer;
            StackLayout thisStack = new StackLayout();

            thisStack.Orientation      = StackOrientation.Horizontal;
            _clickCommand              = tempPlayer.GetPlainCommand(command, nameof(SorryCardGamePlayerItem.SorryPlayerAsync)); //not just player anymore.
            thisStack.InputTransparent = true;
            _thisList = new CustomBasicList <CardGraphicsXF>();
            for (int x = 1; x <= 4; x++)
            {
                var thisCard = new CardGraphicsXF();
                _thisList.Add(thisCard);
                thisCard.SendSize("", new SorryCardGameCardInformation());
                thisCard.BindingContext   = null;
                thisCard.InputTransparent = true;
                thisStack.Children.Add(thisCard);
            }
            Text           = _thisPlayer.NickName;
            BindingContext = _thisPlayer;
            var thisRect = ThisFrame.GetControlArea();

            thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3);
            var thisGrid = new Grid();

            ThisDraw.EnableTouchEvents = true;
            ThisDraw.Touch            += ThisDraw_Touch;
            thisGrid.Children.Add(ThisDraw);
            thisGrid.Children.Add(thisStack);
            Content = thisGrid;
            _clickCommand !.CanExecuteChanged += ClickCommandChange;
            _thisPlayer.PropertyChanged       += ThisPlayerPropertyChange;
            RefreshList();
        }