Link navigation with BBCodeBlock to local folder

Sep 12, 2014 at 11:13 AM

I would like to use a BBCodeBlock to let user navigate to a local folder. I tried to use something like:

[url=file:///C:/Users] open folder[/url]


[url=C:/Users] open folder[/url]

But the error I get when I click on the link created is:

Unable to navigate to file:///C:/Users, could not find a ModernFrame taget ''

Any ideas on how to do that?

Thank you,

Sep 15, 2014 at 4:30 PM
I haven't been able to get a folder to open by using the file:// protocol, but I instead made my BBCode have a link with a command that when executed, will open up the folder or exe.

<mui:BBCodeBlock Grid.Row="1"
                         BBCode="[url=cmd://openFile|pathToFileOrFolder]click here[/url]}"
                         Foreground="{DynamicResource WindowTextReadOnly}"
                         LinkNavigator="{Binding LinkNavigator}" />
view model:
OpenReportCommand = new RelayCommand<string>(s => ExecuteOpenReport(s));
LinkNavigator = new DefaultLinkNavigator();
LinkNavigator.Commands.Add(new Uri("cmd://openFile", UriKind.Absolute), OpenReportCommand);

public RelayCommand<string> OpenReportCommand { get; private set; }
private void ExecuteOpenReport(string r)

    catch (Exception ex)
        logger.Warn("unable to open " + r, ex);
Sep 15, 2014 at 5:29 PM

How can I find references for types OpenReportCommand, RelayCommand, LinkNavigator and so on.

My project does not find any namespaces for these types.

Thank you,

Sep 16, 2014 at 2:11 AM
So I'm following the MVVM pattern and using mvvmlight's implementation of ICommand called RelayCommand. But MUI does provide one too (also called RelayCommand) - you need to use the proper namespace:
using FirstFloor.ModernUI.Presentation;
and for the LinkNavigator, use
I think you need to read the MUI documentation and perhaps some on the MVVM pattern. Check the demo application source too - its a great resource.
Sep 19, 2014 at 4:07 PM
In order to support file:// navigation in BBCodeBlock you'll need to register the file scheme as external scheme in the link navigator. By default the DefaultLinkNavigator supports http, https and mailto. Adding file support is as easy as defining the following:
<mui:BBCodeBlock BBCode="[url=file:///C:/Users]open folder[/url] ">
        <x:Array Type="sys:String" xmlns:sys="clr-namespace:System;assembly=mscorlib">
You can move this to a default BBCodeBlock style, so the LinkNavigator is shared with all BBCodeBlock instances.