Ejemplo n.º 1
0
        public void setDataContext()
        {
            LabeledTextBoxContext       name           = new LabeledTextBoxContext();
            LabeledTextBoxContext       nation         = new LabeledTextBoxContext();
            LabeledTextBoxContext       stadium        = new LabeledTextBoxContext();
            LabeledComboBoxContext      teamtype       = new LabeledComboBoxContext();
            LabeledComboBoxContext      reputation     = new LabeledComboBoxContext();
            LabeledComboBoxContext      region         = new LabeledComboBoxContext();
            LabeledNumericMinMaxContext transferBudget = new LabeledNumericMinMaxContext();
            LabeledNumericMinMaxContext wageBudget     = new LabeledNumericMinMaxContext();
            ImageTextButtonContext      search         = new ImageTextButtonContext();
            ImageTextButtonContext      wonder         = new ImageTextButtonContext();

            name.LabelWidth   = 60;
            name.TextBoxWidth = 110;

            nation.LabelWidth   = 60;
            nation.TextBoxWidth = 110;

            stadium.LabelWidth   = 60;
            stadium.TextBoxWidth = 110;

            teamtype.LabelWidth    = 70;
            teamtype.ComboBoxWidth = 100;

            reputation.LabelWidth    = 70;
            reputation.ComboBoxWidth = 100;

            region.LabelWidth    = 70;
            region.ComboBoxWidth = 100;

            transferBudget.LabelWidth = 100;
            transferBudget.NumericUpDownMinMaxWidth = 82;
            transferBudget.Maximum = 200000000;

            wageBudget.LabelWidth = 100;
            wageBudget.Maximum    = 200000000;
            wageBudget.NumericUpDownMinMaxWidth = 82;

            search.ImageSource  = TryFindResource("search") as ImageSource;
            search.ImageStretch = Stretch.Uniform;
            search.ImageHeight  = 12;
            search.ImageWidth   = 12;
            search.ImageMargin  = new Thickness(0, 2, 0, 0);
            wonder.ImageSource  = TryFindResource("awards") as ImageSource;
            wonder.ImageStretch = Stretch.Uniform;
            wonder.ImageHeight  = 16;
            wonder.ImageWidth   = 16;

            ScoutLocalization localization = globalFuncs.localization;

            teamtype.ComboBoxItems   = localization.teamtypes;
            region.ComboBoxItems     = localization.regions;
            reputation.ComboBoxItems = localization.reputations;

            vm                  = new TeamSearchTabItemViewModel();
            vm.name             = name;
            vm.nation           = nation;
            vm.stadium          = stadium;
            vm.teamtype         = teamtype;
            vm.reputation       = reputation;
            vm.region           = region;
            vm.transferBudget   = transferBudget;
            vm.wageBudget       = wageBudget;
            vm.search           = search;
            vm.wonder           = wonder;
            vm.groupboxsearch   = new LabeledHeaderContext();
            vm.groupboxresults  = new LabeledHeaderContext();
            vm.customizecolumns = new LabeledHeaderContext();
            vm.results          = new TextBlockContext();

            setControlValues();
            setLocalization();

            this.DataContext = vm;
        }
        public void setDataContext()
        {
            TeamSearchTabItemViewModel vm   = new TeamSearchTabItemViewModel();
            LabeledTextBoxContext      name = new LabeledTextBoxContext();

            name.LabelContent = "Name";
            name.LabelWidth   = 70;
            name.TextBoxText  = "name";
            name.TextBoxWidth = 110;

            LabeledTextBoxContext nation = new LabeledTextBoxContext();

            nation.LabelContent = "Nation";
            nation.LabelWidth   = 70;
            nation.TextBoxText  = "nation";
            nation.TextBoxWidth = 110;

            LabeledTextBoxContext stadium = new LabeledTextBoxContext();

            stadium.LabelContent = "Stadium";
            stadium.LabelWidth   = 70;
            stadium.TextBoxText  = "stadium";
            stadium.TextBoxWidth = 110;

            LabeledComboBoxContext teamType = new LabeledComboBoxContext();

            teamType.LabelContent  = "Team Type";
            teamType.LabelWidth    = 70;
            teamType.ComboBoxWidth = 100;
            teamType.ComboBoxItems = Globals.teamTypes;

            LabeledComboBoxContext reputation = new LabeledComboBoxContext();

            reputation.LabelContent  = "Reputation";
            reputation.LabelWidth    = 70;
            reputation.ComboBoxWidth = 100;
            reputation.ComboBoxItems = Globals.reputations;

            LabeledComboBoxContext region = new LabeledComboBoxContext();

            region.LabelContent  = "Region";
            region.LabelWidth    = 70;
            region.ComboBoxWidth = 100;
            region.ComboBoxItems = Globals.regions;

            LabeledNumericMinMaxContext transferBudget = new LabeledNumericMinMaxContext();

            transferBudget.LabelContent             = "Transfer Budget";
            transferBudget.LabelWidth               = 100;
            transferBudget.ValueMax                 = 200000000;
            transferBudget.Maximum                  = 200000000;
            transferBudget.NumericUpDownMinMaxWidth = 86;

            LabeledNumericMinMaxContext wageBudget = new LabeledNumericMinMaxContext();

            wageBudget.LabelContent             = "Wage Budget";
            wageBudget.LabelWidth               = 100;
            wageBudget.ValueMax                 = 200000000;
            wageBudget.Maximum                  = 200000000;
            wageBudget.NumericUpDownMinMaxWidth = 86;

            vm.name           = name;
            vm.nation         = nation;
            vm.stadium        = stadium;
            vm.teamType       = teamType;
            vm.reputation     = reputation;
            vm.region         = region;
            vm.transferBudget = transferBudget;
            vm.wageBudget     = wageBudget;

            this.DataContext = vm;
        }