Example #1
0
        public CrosswordView()
        {
            InitializeComponent();

            ResetVariables();

            NavigationPage.SetHasNavigationBar(this, false);

            // Grid Crossword
            mainGrid.Children.Add(GenerateCrosswordGrid(CrosswordViewModel.Instance().DisplayBoard), 1, 1);

            // Definition List
            _defList = GenerateDefinitionList(CrosswordViewModel.Instance().Definitions);
            definitionGrid.Children.Add(_defList, 0, 1);

            ScoreLabel.BindingContext = _score;
            ScoreLabel.SetBinding(Label.TextProperty, new Binding("Value", BindingMode.OneWay, new StringToIntConverter()));
            SizeChanged += OnSizeChanged;
        }
Example #2
0
        private void BindingInitialize()
        {
            Binding DifficultyBinding = new Binding("Difficulty")
            {
                Source = Host
            };

            DifficultyLabel.SetBinding(Label.ContentProperty, DifficultyBinding);

            Binding LevelBinding = new Binding("Level")
            {
                Source = Host
            };

            LevelLabel.SetBinding(Label.ContentProperty, LevelBinding);

            Binding ScoreBinding = new Binding("Score")
            {
                Source = Host
            };

            ScoreLabel.SetBinding(Label.ContentProperty, ScoreBinding);
            ResultScore.SetBinding(Label.ContentProperty, ScoreBinding);

            Binding LevelupProgressBinding = new Binding("LevelupProgress")
            {
                Source = Host
            };
            Binding LevelupMaximumBinding = new Binding("LevelupMaximum")
            {
                Source = Host
            };

            LevelupProgressBar.SetBinding(ProgressBar.ValueProperty, LevelupProgressBinding);
            LevelupProgressBar.SetBinding(ProgressBar.MaximumProperty, LevelupMaximumBinding);

            Binding TotalClearRowsBinding = new Binding("TotalClearRows")
            {
                Source = Host
            };

            ResultClearRows.SetBinding(Label.ContentProperty, TotalClearRowsBinding);
        }