示例#1
0
        public GameView()
        {
            this.InitializeComponent();
            if (this.DataContext != null)
            {
                this.ViewModel = (VolleyballGameViewModel)this.DataContext;

                //ViewModel = new VolleyballGame();

                //ViewModel.LooseReasons.Add(new Reason() { Name = "Ace", Win = true, ServeReturned = false });
                //ViewModel.LooseReasons.Add(new Reason() { Name = "Spike", Win = true });
                //ViewModel.LooseReasons.Add(new Reason() { Name = "Tip", Win = true });
                //ViewModel.LooseReasons.Add(new Reason() { Name = "Dump", Win = true });
                //ViewModel.LooseReasons.Add(new Reason() { Name = "Block", Win = true });
                //ViewModel.LooseReasons.Add(new Reason() { Name = "Down Ball", Win = true });
                //ViewModel.WinReasons.Add(new Reason() { Name = "Receive Error", Win = false, ServeReturned = false });
                //ViewModel.WinReasons.Add(new Reason() { Name = "Attack Error", Win = false });
                //ViewModel.WinReasons.Add(new Reason() { Name = "Set Error", Win = false });
                //ViewModel.WinReasons.Add(new Reason() { Name = "Ball Handling", Win = false });
                //ViewModel.WinReasons.Add(new Reason() { Name = "Free ball", Win = false });
                //ViewModel.WinReasons.Add(new Reason() { Name = "Fault", Win = false });


                //ViewModel.Sets.Add(new Set() { Number= ViewModel.Sets.Count + 1 });

                ViewModel.InitGame();
            }

            //this.DataContext = ViewModel;
        }
示例#2
0
        public StatsView()
        {
            this.InitializeComponent();
            if (this.DataContext != null)
            {
                this.ViewModel = (VolleyballGameViewModel)this.DataContext;
            }

            this.ViewModel.Game.PrepPlayerStats();

            reasonStats.HorizontalAlignment = HorizontalAlignment.Left;
            reasonStats.VerticalAlignment   = VerticalAlignment.Top;


            var column = new ColumnDefinition();

            column.Width = new GridLength(1, GridUnitType.Star);
            this.reasonStats.ColumnDefinitions.Add(column);
            column       = new ColumnDefinition();
            column.Width = new GridLength(1, GridUnitType.Star);
            this.reasonStats.ColumnDefinitions.Add(column);
            this.reasonStats.RowDefinitions.Add(NewRowDefinition());
            this.reasonStats.RowDefinitions.Add(NewRowDefinition());
            GetTextBlock("Player", 0, 1, true, null);
            int ColumnCount = 1;

            foreach (var reason in ViewModel.Game.PlayerReasonStatBindList[0].Reasons)
            {
                column       = new ColumnDefinition();
                column.Width = new GridLength(1, GridUnitType.Star);
                this.reasonStats.ColumnDefinitions.Add(column);
                GetTextBlock(reason.Name, ColumnCount, 1, true, null);

                ColumnCount += 1;
            }

            //int ColumnCount = 1;
            int RowCount = 2;

            foreach (var player in ViewModel.Game.PlayerReasonStatBindList)
            {
                this.reasonStats.RowDefinitions.Add(NewRowDefinition());

                ColumnCount = 1;
                GetTextBlock(player.Name, 0, RowCount, true, null);
                foreach (var stat in player.Reasons)
                {
                    GetTextBlock(stat.Count.ToString(), ColumnCount, RowCount, true, stat.Win);
                    ColumnCount += 1;
                }
                RowCount += 1;
            }
        }
示例#3
0
        public LineUpControl(Popup popup)
        {
            if (popup == null)
            {
                throw new ArgumentNullException("popup");
            }
            this.popup = popup;

            this.InitializeComponent();

            if (this.DataContext != null)
            {
                this.ViewModel = (VolleyballGameViewModel)this.DataContext;
            }
            //var bounds = Window.Current.Bounds;
            //this.RootPanel.Width = bounds.Width;
            //this.RootPanel.Height = bounds.Height;
        }