Hello,I need to open xaml page in new browser at each time.Scenario :-I have a grid having id in each row as a hyperlinkbutton.When I click on Id suppose 1 I need to open another xaml page in new window.The same way for Id 2,3,4....so on.I tried thisHtmlPage.Window.Navigate(new Uri("Web.CortexTestPage.aspx", UriKind.Relative), "_blank");but did not get how to bind the xaml to the above page...Please suggest the solution.Thanks in advance...
Hi,
So you're using the XamGrid?
I'm not 100% sure about what you're asking.
But if you just want to bind to a Uri property you can use the HyperlinkColumn:
<ig:HyperlinkColumn Key="YourUriProperty" TargetName="_blank"/>
If you need to customize your UriProperty, or convert it to a Uri, you can use the ValueConverter property on the HyperlinkColumn with your own IValueConverter:
<ig:HyperlinkColumn Key="YourUriProperty" TargetName="_blank" ValueConverter="{StaticResource yourConverter}"/>
Or, if you need to build a uri off of various properties of your data, you can use an UnboundColumn:
<ig:UnboundColumn Key="navigate">
<ig:UnboundColumn.ItemTemplate>
<DataTemplate>
<HyperlinkButton NavigateUri="{Binding RowData, Converter={StaticResource yourConverter}}" TargetName="_blank"/>
</DataTemplate>
</ig:UnboundColumn.ItemTemplate>
</ig:UnboundColumn>
Hope this helps,
-SteveZ
Thanks for your reply...Yes I am using xamwebgrid.I want to open an xaml page when I click on hyperlinkbutton.not in the parent browser but out of browser(means in new browser).on each hyperlink button click I want tje new window get open.Hope you got my point...
-Pankaj
So you cannot simply load a XAML document in a new browser window, you would need to load an HTML page that hosts a Silverlight application. If you wanted the Silverlight application to load a specific place or page in the app, you should look at using the Silverlight Navigation framework which allows you to create URL addressable pages in your application. A great intro blog on the framework can be found here:
http://www.wintellect.com/CS/blogs/jprosise/archive/2009/04/07/silverlight-3-s-new-navigation-framework.aspx
You can see this by visiting our Silverlight samples browser which uses the navigation framework.
http://samples.infragistics.com
As you navigate samples the framework changes the URL, allowing each sample to be individually addressable even though it lives within a larger single application.
Hope that helps.
Devin
Thanks for your reply
but this is not what I want.
I don't want to navigate I want to open seprately a new window on click of hyperlinkbutton.
I used the following
<HyperlinkButton Click="Navigate_Click" Content="NewPage" NavigateUri="http://localhost:1254/NavigateTestPage.aspx#/View/Page1.xaml?TestCaseid=12" TargetName="_blank" Tag="/View/Page1.xaml"></HyperlinkButton>
It opens the new browser window with the contents of my mainpage as well as Page1.But here I get stucked.I want to show the content of Page1 only in new browser.
Can you help me out.
- Pankaj
I solved the problem
In the app.xaml.cs, I did
private void Application_Startup(object sender, StartupEventArgs e) { string url = App.Current.Host.NavigationState.ToString(); if (url != "") { string[] pagename = url.Split('/'); string page = string.Empty; foreach (string str in pagename) { int indexval = str.IndexOf('?'); if (indexval != -1) page = str.Substring(0, indexval); } if (page == "MainPage.xaml") this.RootVisual = new MainPage(); } else { this.RootVisual = new Page1(); } }
and on hyperlinkbutton click event of MainPage.xaml.cs
btn.TargetName="_blank"; string url = @"http://localhost:8185/modules/tcm/Web.CortexTestPage.aspx#/MainPage.xaml?TestCaseId=" + btn.Content.ToString(); btn.NavigateUri = new Uri(url, UriKind.RelativeOrAbsolute);
Now I can be able to open multiple window in new browser.
Any other alternative or suggestion are welcome.
Thanks for everyone support...