コード例 #1
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            to_hardware_overview to = (to_hardware_overview)e.Parameter;

            testname_box.Text              = to.testname1;
            soil_type_combo.SelectedIndex  = to.soiltype;
            land_covered_box.Text          = to.landcover;
            season_box_combo.SelectedIndex = to.season;
            if (to.temp_c1 != "")
            {
                temp_to_db_block.Text = to.temp_c1;
            }
            else
            {
                temp_to_db_block.Text = "Unavailable";
            }
            if (to.humidity1 != "")
            {
                humidity_to_db_block.Text = to.humidity1;
            }
            else
            {
                humidity_to_db_block.Text = "Unavailable";
            }
        }
コード例 #2
0
 async private void soil_test_commom_cont_button_Click(object sender, RoutedEventArgs e)
 {
     if (soil_type_combo.SelectedIndex != -1 && land_covered_box.Text != "" && season_box.SelectedIndex != -1)
     {
         to_hardware_overview to = new to_hardware_overview()
         {
             testname1 = testname, temp_c1 = temp_c, humidity1 = humidity, soiltype = soil_type_combo.SelectedIndex, landcover = land_covered_box.Text, season = season_box.SelectedIndex
         };
         this.Frame.Navigate(typeof(hardware_overview), to);
     }
     else
     {
         MessageDialog msg = new MessageDialog("Missed some fields, please enter them to continue", "Error");
         await msg.ShowAsync();
     }
 }