Windows phone 7 如何在xaml文件中使用动态变量?

Windows phone 7 如何在xaml文件中使用动态变量?,windows-phone-7,Windows Phone 7,我的Windows Phone 7应用程序的xaml文件中存在一些绑定问题,我不确定问题在哪里..我从一个应该传递文本参数的按钮开始: <Button Content="More Info" Height="60" HorizontalAlignment="Center" Name="top40button" VerticalAlignment="Top" Width="216" FontSize="11" Click="top40button_click" /> 然后,我在son

我的Windows Phone 7应用程序的xaml文件中存在一些绑定问题,我不确定问题在哪里..我从一个应该传递文本参数的按钮开始:

<Button Content="More Info" Height="60" HorizontalAlignment="Center" Name="top40button" VerticalAlignment="Top" Width="216" FontSize="11" Click="top40button_click" />
然后,我在songpage.xaml文件的cs文件中有以下内容:

    protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);
        string songname = NavigationContext.QueryString["songname"];
    }
我不知道如何继续,我已经尝试将它绑定到页面标题中,但是没有成功,我如何将变量(此时的测试)真正地获取到我的xaml文件中

<TextBlock x:Name="PageTitle" Text="{Binding songname}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>

如果要绑定变量songname,它应该在ViewModel中。它应该是ViewModel的一个属性

在代码中,现在最好直接设置标题:

PageTitle.Text = songname;
PageTitle.Text = songname;