我有一个我的Pushpins的OnClick事件如下。如何将变量传递给另一个Silverlight页面?
void BusStop1061_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
MessageBox.Show("Buses from this station: City Link");
}
我想给bustop号传递到另一个页面,并为int“PassedVariable”
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
{
string site = "http://www.sourceDomain?stop=" + PassedVariable;
webBrowser1.Navigate(new Uri(site, UriKind.Absolute));
}
我想在第一页上创建的整型,然后将它传递到页面2使用urimapping,但它似乎并没有工作,我想有人可能有更好的选择
我曾看过类似的帖子,但他们不完全回答我的问题。
可能重复[调用从另一种形式的C#变量(HTTP ://stackoverflow.com/questions/5928071/call-variable-from-another-form-c) –
也http://stackoverflow.com/questions/5865588/how-to-pass-value-from-textbox-to -label-on-different-form和http://stackoverflow.com/questions/4247807/passing-variable-between-winforms –
和http:// stackoverflow。com/questions/7316965/data-sharing-multiple-viewmodels/7338294#7338294 –