コード例 #1
0
        public ActionEverybodyGetsOneView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            var mainStack = new StackPanel();

            mainStack.Orientation = Orientation.Horizontal;
            var player = new PlayerUI(actionContainer, false, 50, 800);

            mainStack.Children.Add(player);
            StackPanel finalStack = new StackPanel();

            mainStack.Children.Add(finalStack);
            FluxxHandWPF otherHand = new FluxxHandWPF();

            otherHand.LoadList(actionContainer.TempHand !, "");
            otherHand.Margin = new Thickness(3, 15, 0, 0);
            finalStack.Children.Add(otherHand);
            var button = GetGamingButton("Give Cards To Selected Player", nameof(ActionEverybodyGetsOneViewModel.GiveCardsAsync)); // i think

            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            finalStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            finalStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
コード例 #2
0
        public ActionDrawUseView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            StackPanel   mainStack = new StackPanel();
            FluxxHandWPF hand      = new FluxxHandWPF();

            hand.LoadList(actionContainer !.TempHand !, "");                                          // i think this is the only difference for this one.
            mainStack.Children.Add(hand);
            var button = GetGamingButton("Choose Card", nameof(ActionDrawUseViewModel.DrawUseAsync)); //hopefully this simple (?)

            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            mainStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            mainStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
コード例 #3
0
        public ActionFirstCardRandomView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            StackPanel   mainStack = new StackPanel();
            FluxxHandWPF thisHand  = new FluxxHandWPF();

            thisHand.LoadList(actionContainer !.OtherHand !, "");
            thisHand.MinWidth = 400;
            mainStack.Children.Add(thisHand);
            var button = GetGamingButton("Choose Card", nameof(ActionFirstCardRandomViewModel.ChooseCardAsync)); // i think

            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            mainStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            mainStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="element">the unique parts</param>
        /// <returns>this is supposed to be the content you set.</returns>
        internal static StackPanel GetFinalStack(UIElement element, FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            StackPanel mainStack = new StackPanel();

            Grid tempGrid = new Grid();

            tempGrid.Margin = new Thickness(3, 3, 3, 5);
            AddLeftOverColumn(tempGrid, 50);
            AddLeftOverColumn(tempGrid, 50);
            AddAutoColumns(tempGrid, 1);
            var currentCard = new ShowCardUI(model, actionContainer, keeperContainer, EnumShowCategory.MainAction);

            currentCard.Width = 700;
            AddControlToGrid(tempGrid, currentCard, 0, 0);
            var actionCard = new ShowCardUI(model, actionContainer, keeperContainer, EnumShowCategory.CurrentAction);

            AddControlToGrid(tempGrid, actionCard, 0, 1);
            actionCard.Width = 700; // since it does not seem to autosize.
            GoalHandWPF goal1 = new GoalHandWPF();

            goal1.LoadList(actionContainer.PrivateGoals !, "");
            AddControlToGrid(tempGrid, goal1, 0, 2);
            mainStack.Children.Add(tempGrid);
            tempGrid = new Grid();
            AddLeftOverColumn(tempGrid, 50);
            AddLeftOverColumn(tempGrid, 50);
            var yourCards = new FluxxHandWPF();

            yourCards.LoadList(actionContainer.YourCards !, "");
            AddControlToGrid(tempGrid, yourCards, 0, 0);
            var yourKeepers = new KeeperHandWPF();

            yourKeepers.MinWidth = 400;
            yourKeepers.LoadList(actionContainer.YourKeepers !, "");
            AddControlToGrid(tempGrid, yourKeepers, 0, 1);
            tempGrid.Margin = new Thickness(3, 3, 3, 5);
            mainStack.Children.Add(tempGrid);
            mainStack.Children.Add(element);
            return(mainStack);
        }
コード例 #5
0
        public ActionTakeUseView(FluxxVMData model, ActionContainer actionContainer, KeeperContainer keeperContainer)
        {
            var mainStack = new StackPanel();
            var player    = new PlayerUI(actionContainer, true, 50, 800);

            //player.ItemHeight = 50;
            //player.ItemWidth = 1300;
            mainStack.Children.Add(player);
            var otherHand = new FluxxHandWPF();

            otherHand.LoadList(actionContainer !.OtherHand !, "");
            otherHand.MinWidth = 400;
            mainStack.Children.Add(otherHand);
            var button   = GetGamingButton("Choose Card", nameof(ActionTakeUseViewModel.ChooseCardAsync));
            var thisBind = GetVisibleBinding(nameof(ActionTakeUseViewModel.ButtonChooseCardVisible));

            button.SetBinding(Button.VisibilityProperty, thisBind);
            button.HorizontalAlignment = HorizontalAlignment.Left;
            button.VerticalAlignment   = VerticalAlignment.Top;
            mainStack.Children.Add(button);
            button = ActionHelpers.GetKeeperButton();
            mainStack.Children.Add(button);
            Content = ActionHelpers.GetFinalStack(mainStack, model, actionContainer, keeperContainer);
        }