Can someone please place me in the right direction.
I dont want to use hyperlink buttons. I want to use a normal silver light button from a usercontrol xaml.
At the moment I have no clue how to navigate to another page using a regular button. I know how to do it with Hyperlinks. I only want to use buttons at the moment.
Loading
David SmithPosted Aug 10, 2011, 6:50 PM
David SmithPosted Aug 10, 2011, 12:35 PM
I have a few more questions.
Is there a value or a way i can iterate through all the buttons via the secondpage an do the Visibility.Collapsed;
for all the buttons I do not need.
private void button1_Click(object sender, RoutedEventArgs e)
{
Button theButton = sender as Button;
string url = theButton.Tag.ToString();
this.Frame.Navigate(new Uri(url, UriKind.Relative));
//I want to the foreach in this location
button1.Visibility = Visibility.Collapsed;
}
This is what i dont want to do below
this.SetConfigButton.Visibility = Visibility.Collapsed;
this.richTextBoxFilename.Visibility = Visibility.Collapsed;
this.labelConfigSettings.Visibility = Visibility.Collapsed;
this.labelFrames.Visibility = Visibility.Collapsed;
this.labelOperator.Visibility = Visibility.Collapsed;
this.labelPath.Visibility = Visibility.Collapsed;
this.labelTestType.Visibility = Visibility.Collapsed;
this.labelPartNumber.Visibility = Visibility.Collapsed;
this.labelPartNumber.Visibility = Visibility.Collapsed;
this.labelSerialNumber.Visibility = Visibility.Collapsed;
this.labelInformation.Visibility = Visibility.Collapsed;
Priya LingePosted Aug 10, 2011, 3:41 AM
Navigate to second Page then ,it will be,
http://localhost:6680/drawlineTestPage.aspx#/Views/SecondPage.xaml.
Navigate to Third Page then ,it will be,
http://localhost:6680/drawlineTestPage.aspx#/Views/ThirdPage.xaml
like this.
David SmithPosted Aug 10, 2011, 3:16 AM
it will be something like this
http://localhost:6680/drawlineTestPage.aspx
on click the SecondButton which is on MainPage,url changes to,
http://localhost:6680/drawlineTestPage.aspx#/Views/SecondPage.xaml
on click the ThirdButton which is on MainPage,url changes to,
http://localhost:6680/drawlineTestPage.aspx#/Views/SecondPage.xaml/ThirdPage.xaml
and so far so on.
Can you email me [email protected]
Priya LingePosted Aug 10, 2011, 3:01 AM
As i said mainPage is a root page ,so the element which is on mainpage is always be there.
As we doing in asp Response.Redirect we are going to other page tht page url we can see.
in silverlight one default page i.e TestPage.aspx,url is same when we navigate to other page.
http://localhost:6680/drawlineTestPage.aspx
on click the SecondButton which is on MainPage,url changes to,
http://localhost:6680/drawlineTestPage.aspx#/Views/SecondPage.xaml
Thanks.
David SmithPosted Aug 10, 2011, 2:51 AM
What does this particular line do, it this a valid fix. It seems like we are just hiding the button and thats its, I just made a example to go from page 1, to page 2, and to page 3, and all three buttons was still on the page.
Priya LingePosted Aug 10, 2011, 2:47 AM
private void button1_Click(object sender, RoutedEventArgs e)
{
Button theButton = sender as Button;
string url = theButton.Tag.ToString();
this.Frame.Navigate(new Uri(url, UriKind.Relative));
button1.Visibility = Visibility.Collapsed;
}
Thanks.
David SmithPosted Aug 10, 2011, 2:35 AM
Priya LingePosted Aug 10, 2011, 2:35 AM
David SmithPosted Aug 10, 2011, 2:21 AM
Priya LingePosted Aug 10, 2011, 2:16 AM
Given code is for silverlight. did you tried this for navigate to other page in silverlight.
i took normal button instead of hyperlink button in silverlight.
is this helpful or not?
Thanks.
David SmithPosted Aug 10, 2011, 1:51 AM
I want to navigate using a normal button, not a hyper link button. Also can you guys point me to a good sight for learning silverlight
Jaganathan BantheswaranPosted Aug 10, 2011, 12:57 AM
You need to navigate another asp page or silverlight page?
Priya LingePosted Aug 10, 2011, 12:55 AM
We can navigate to another using silverligh Button by following way,
In MainPage.Xaml we have 1 frame as follow,
Button
I have another page is SecondPage.Xaml.
Mainpage.xaml.cs,On Button Click
private void button1_Click(object sender, RoutedEventArgs e)
{
Button theButton = sender as Button;
string url = theButton.Tag.ToString();
this.Frame.Navigate(new Uri(url, UriKind.Relative));
}
Please find attached file.
Hope this will help you.
Thanks.