110,533
社区成员
发帖
与我相关
我的任务
分享
<Grid>
<Frame X:Name=page1 margin……/>
<RadioButton X:Name=page1 margin……/> <RadioButton X:Name=page3 margin……/>
<RadioButton X:Name=page2 margin……/> <RadioButton X:Name=page4 margin……/>
<Grid>
private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
RadioButton button = (RadioButton)sender;
Uri uri= new Uri(button.Name + ".xaml", UriKind.Relative);
frame.Source = uri;
}
ObservableCollection<Uri> list = new ObservableCollection<Uri>();
private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
RadioButton button = (RadioButton)sender;
Uri uri= new Uri(button.Name + ".xaml", UriKind.Relative);
bool cont = list.Contains(uri);
if (cont != true) { list.Add(uri); frame.Source = uri;}
else
{
int s = list.IndexOf(uri);
for (int i = 0; i < list.Count; i++) { if (frame.CanGoBack) frame.GoBack(); }
for (int i = 0; i < s; i++) { frame.GoForward(); }
}
}
没办法,只能用笨办法,各位师兄! 此法是否可行?