How can I show a "Link" Content in code the same way i can when i click it with the mouse ?

Sep 15, 2013 at 1:22 PM
Hi I want to do a very simple, not supposed to be complex navigation here...

when you click a link with your mouse it navigates to it right ?

how can i do the same-in code- without having the user to go and click on the link ??


please please i am tired of searching and nothing works for me,,, don't ignore me please.
Sep 15, 2013 at 3:00 PM
Edited Sep 15, 2013 at 3:13 PM
there is a xaml way of doing this,,, i need the c# way to do it...

we can use the BBCodeBlock in xaml and achieve it like this but still needs to be automatically done without the must of the user click on the link
            <mui:BBCodeBlock BBCode="» navigate to the [url=/Pages/translator.xaml]translator page[/url]" x:Name="CodeBlock"/>
Sep 15, 2013 at 3:06 PM
And when using code like this on a page constructor...

new DefaultLinkNavigator().Navigate(new Uri("/Pages/translator.xaml", UriKind.Relative), LayoutRoot);


an error with this description arises:


System.ArgumentException was unhandled by user code
HResult=-2147024809
Message=Unable to navigate to /Pages/translator.xaml, could not find a ModernFrame target ''
Source=FirstFloor.ModernUI
StackTrace:
   at FirstFloor.ModernUI.Windows.Navigation.DefaultLinkNavigator.Navigate(Uri uri, FrameworkElement source, String parameter)
   at Active_Dictionary.Pages.aboutKhaterah..ctor() in d:\Projects\ActiveDict\Active Dictionary\Pages\aboutKhaterah.xaml.cs:line 15
InnerException:
Sep 16, 2013 at 2:24 PM
it's very simply,just use the code(.net 4.5):
NavigationCommands.GoToPage.Execute("your xaml uri", Application.Current.MainWindow);
but it use Application.LoadComponent(uri)(DefaultContentLoader.cs),so first time may be you will has a new interface class instance...

if you use .net 4,you should reference the shell library.