Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7595599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:42:40+00:00 2026-05-30T21:42:40+00:00

I created new SL Application based on MVVM Light template by Laurent Bugnion. Then

  • 0

I created new SL Application based on MVVM Light template by Laurent Bugnion. Then I created several navigation pages in /Views directory – Home.xaml,TaskPlans.xaml, Tasks.xaml and Tasks.xaml. Those pages are empty – I created only simple textblock into each page.

According to Tim Heuers template for implementing navigation framework I modified /Views/MainPage.xaml

<UserControl x:Class="Valachy.Administration.Views.MainPage"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"             
         xmlns:Helpers="clr-namespace:Valachy.Administration.Helpers" 
         xmlns:res="clr-namespace:Valachy.Administration.Resources"
         xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
         xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
         d:DesignWidth="640" d:DesignHeight="480"
         mc:Ignorable="d"             
         DataContext="{Binding Main, Source={StaticResource Locator}}">

<UserControl.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="../Skins/MainSkin.xaml" />
            <ResourceDictionary>
                <Helpers:ResourceWrapper x:Key="ResourceWrapper" />
                <Helpers:NotOperatorValueConverter x:Key="NotOperatorValueConverter" />
            </ResourceDictionary>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</UserControl.Resources>

<Grid x:Name="LayoutRoot">
    <StackPanel Orientation="Horizontal" VerticalAlignment="Top">
        <StackPanel Orientation="Horizontal" Width="250">
            <HyperlinkButton Click="NavigateButtonClick" Tag="Home" Content="Home" FontFamily="24"></HyperlinkButton>
            <HyperlinkButton Click="NavigateButtonClick" Tag="/Views/Tasks.xaml" Content="Tasks" FontFamily="24"></HyperlinkButton>
            <HyperlinkButton Click="NavigateButtonClick" Tag="/Views/TaskPlans.xaml" Content="Plans" FontFamily="24"></HyperlinkButton>
        </StackPanel>
    </StackPanel>
    <navigation:Frame x:Name="MainFrame" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="20" Source="/Views/Home.xaml"  />
</Grid>
</UserControl>

And here is method handling hyperling click:

private void NavigateButtonClick(object sender, System.Windows.RoutedEventArgs e)
    {
        HyperlinkButton hyperlinkButton = sender as HyperlinkButton;
        if (hyperlinkButton != null)
        {
            string urlString = hyperlinkButton.Tag.ToString();                
            Uri url = new Uri(urlString,UriKind.Relative);
            MainFrame.Navigate(url);
        }
    }

I also changed /App.xaml to hide /Views/Home.xaml in address bar after # character and changed Tag attribute value in first hyperlink button in MainPage.xaml.

<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
         x:Class="Valachy.Administration.App"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:vm="clr-namespace:Valachy.Administration.ViewModel"
         xmlns:navcore="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
         mc:Ignorable="d">
<Application.Resources>

    <!--Global View Model Locator-->
    <vm:ViewModelLocator x:Key="Locator"
                         d:IsDataSource="True" />
    <navcore:UriMapper x:Key="uriMapper">            
        <navcore:UriMapping Uri="Home" MappedUri="/Views/Home.xaml" />
        <navcore:UriMapping Uri="Tasks" MappedUri="/Views/Tasks.xaml" />
        <navcore:UriMapping Uri="TaskPlans" MappedUri="/Views/TaskPlans.xaml" />
    </navcore:UriMapper>
</Application.Resources>
</Application>

When I run application and provide navigation events clicking on “Tasks” and “TaskPlans” button, everything is working o.k. If I click on “Home” hyperlink button, I receive System Argument exception in iexplore.exe with message “Content for the URI cannot be loaded. The URI may be invalid.”

When I change Tag content of first hyperlink button back to “/Views/Home.xaml”, navigation works fine.

Can I change Tag Value somehow or there is a difference how Urimapper works in SL 5?

Thank you for any advice, Rudolf.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:42:42+00:00Added an answer on May 30, 2026 at 9:42 pm

    Check out Laurent’s talk at Mix “deep dive MVVM”

    in this talk he speaks about how to Navigate with MVVM. He suggest a navigation Service…
    This talk is really a good watch for some advanved MVVM techniques…

    http://channel9.msdn.com/Events/MIX/MIX11/OPN03

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a new application using the Split View-based Application template. I then added
I've created a new View-based Application in XCode. In the ViewController, the only code
I've just created a new view based application, and now I want to set
I've created a new Pylons application and added a controller (main.py) with a template
In Visual Studio 2010 Beta 2 I created a new navigation Silverlight application. Without
I am building an application that is based on MVVM-Light. I am in the
I am new to iphone development.I have created a view based application.Now i want
i created a navigation based project but instead of tableview i added a new
I created a new window based application, and a RootViewController that sublcasses UIViewController. I
I'm fairly new to WPF, and I want to create an MVVM based application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.