예제 #1
0
        public BmiPage()
        {
            InitializeComponent();

            this.dataAccess = new UserDataAccess();

            var picker = new Picker {
                Title = "Select a Profile"
            };

            picker.SelectedIndexChanged += picker_SelectedIndexChanged;
            try
            {
                picker.Items.Add(this.dataAccess.GetCustomer(1).UserName);
                picker.Items.Add(this.dataAccess.GetCustomer(2).UserName);
                picker.Items.Add(this.dataAccess.GetCustomer(3).UserName);
            }
            catch
            {
            }
            sl.Children.Add(picker);

            picker.SelectedIndexChanged += (sender, args) =>
            {
                if (picker.SelectedIndex == 0)
                {
                    myProfile = 1;
                }
                if (picker.SelectedIndex == 1)
                {
                    myProfile   = 2;
                    txtAge.Text = this.dataAccess.GetCustomer(myProfile).Age;
                }

                if (picker.SelectedIndex == 2)
                {
                    myProfile   = 3;
                    txtAge.Text = this.dataAccess.GetCustomer(myProfile).Age;
                }
                RetrieveProfileData();
            };


            pickerUnit.SelectedIndex     = 0;
            pickerGender.SelectedIndex   = 0;
            pickerActivity.SelectedIndex = 0;
        }
예제 #2
0
 public Profile()
 {
     InitializeComponent();
     this.dataAccess = new UserDataAccess();
 }