|
|
Questions and answers for Application and Deployment Page.
|
42. Application and Deployment Page
|
| 42.1 Are
XAML Browser Applications OS independent ?
|
| 42.2 When
I run an XBAP application, I get Application Deployment Error. What do I do to
overcome this error ?
|
| 42.3 How
to navigate between pages in an application ?
|
42.1 Are XAML Browser Applications OS independent ?
|
|
No. An XAML Browser application works only on Windows and requires .NET
Framework 3.0 or a later version to be installed. It can be hosted in Internet
Explorer or in any other browser that hosts the Microsoft WebBrowser ActiveX
control.
|
42.2 When I run an XBAP application, I get Application Deployment Error. What
do I do to overcome this error ?
|
|
XBAP applications are cached when you run for the first time. In order to give
maximum performance, subsequent requests run the application from the cache
until the version number of the application is changed. Therefore, if you make
any changes to the code, re-compile and then run it and you don't see any
changes to the result or if you get the application deployment error, run the
"mage-cc" command from the Visual Studio Command Prompt and try running the
application again.
|
42.3 How to navigate between pages in an application ?
|
|
Navigation in an application can be done in a pre-determined linear sequence, a
user driven path through hierarchy or a dynamically generated path.
Navigation can be performed using the following methods:
Navigate method in the Navigation service can be used to navigate to a page in
the application.
|
[C#]
//Navigate using URI.
this.NavigationService.Navigate(new Uri("mypage.xaml", UriKind.Relative));
//Navigate to an instance of a page.
mypage newpage = new mypage();
this.NavigationService.Navigate(newpage);
|
|
“NavigateUri†property of Hyperlink markup extension can be used to open a page
using hyperlink.
|
[XAML]
<TextBlock>
<Hyperlink NavigateUri="mypage.xaml">New Page</Hyperlink>
</TextBlock>
|
|
Both navigation containers have a journal that records navigation history like
a web browser. The journal maintains two stacks for 'Back' and 'Forward' stacks
to record navigation.
|
|