Exemplo n.º 1
0
        protected override void OnBindingContextChanged()
        {
            base.OnBindingContextChanged();

            DeckSetView rouleurDeckSetView = new DeckSetView()
            {
                Rider = "Rouleur"
            };

            rouleurDeckSetView.SetBinding(DeckSetView.BindingContextProperty, "RouleurSet");
            rouleurDeckSetView.SetInnerScale(scaling);

            DeckSetView sprinteurDeckSetView = new DeckSetView()
            {
                Rider = "Sprinteur"
            };

            sprinteurDeckSetView.SetBinding(DeckSetView.BindingContextProperty, "SprinteurSet");
            sprinteurDeckSetView.SetInnerScale(scaling);

            foreach (View v in gameGrid.Children)
            {
                v.BindingContext = null;
            }
            gameGrid.Children.Clear();

            gameGrid.Children.Add(rouleurDeckSetView, 0, 0);
            gameGrid.Children.Add(sprinteurDeckSetView, 0, 1);
        }
Exemplo n.º 2
0
        private void sizeChanged()
        {
            double scalingX = Width / 1080.0;
            double scalingY = Height / 780.0;

            scaling = Math.Min(scalingX, scalingY);
            foreach (View v in gameGrid.Children)
            {
                DeckSetView dsv = v as DeckSetView;
                if (dsv != null)
                {
                    dsv.SetInnerScale(scaling);
                }
            }
        }