下面的程序是从选择器中选择米和厘米,它们都被连接起来,如果米是 53,厘米是 4,那么结果是 53.4。我要做的是,最终输出的高度(例如:53.4),年龄,性别应该通过Page1.xaml(下一页)访问。我有许多需要在公式中实现的此类值。如何通过 Windows Phone 中的 IsolatedStorage 将这些值传输到下一页?谢谢你。
//Selecting height
private void MHSelect_Click(object sender, RoutedEventArgs e)
{
int mhvalue1 = MHMeterSelector.SelectedItem;
int mhvalue2 = MHCentimeterSelector.SelectedItem;
if(mhvalue1 == 0)
{
mhvalue1 = MHMeterSelector.DefaultValue;
}
MHeight_btn.Content = float.Parse(string.Format("{0}.{1}", mhvalue1.ToString(), mhvalue2.ToString())) + " cm";
//height is selected and concatenated here. mhvalue1 and mhvalue2 are the metre and centimetre values.
}
//Selecting Age
private void MASelect_Click(object sender, RoutedEventArgs e)
{
int mavalue1 = MAMeterSelector.SelectedItem;
if(mavalue1 == 0)
{
mavalue1 = MAMeterSelector.DefaultValue;
}
MAge_btn.Content = mavalue1;
//Age is selected and mavalue1 is the selected age.
}
//Selecting Gender
private void MGenderListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ListBoxItem kbi = ((sender as ListBox).SelectedItem as ListBoxItem);
MGender_btn.Content = kbi.Content.ToString();
//kbi is selected and kbi.Content should be transfered to next page
}