Hello,
My WPF application (WpfApplication1) is, for its XAML part, composed of an single empty grid.
Elements are loaded inside this grid from an external XAML file, read through XamlReader.
This external Xaml file contains (for the purpose of this example) a URL to an image which should be located in the 'My documents' user folder.

The problem is that during importation the url from images should be relative to the application which is loading the file!
In other words, this URL should be relative to the application (pack://siteoforigin:, pack://application)
...and in my case, this path is 'outside' from that context and should be built this way:
Environment.GetFolderPath(Environment.SpecialFolde r.MyDocuments) & "Theme\"

So, I wrote a Converter, hoping to build the complete path url...but without succes!!
> 'Impossible to create the unknow type '{clr-namespace:WpfApplication1}imgurlConvert'.'

The application XAML part:
Code:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:test"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Class="MainWindow" Title="main" Height="600" Width="800">
<Grid></Grid>
</Window>
The application VB part:
Code:
Imports System.IO
Class MainWindow
    Public Shared ThemeTempFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Theme\"
    Public Shared themeGrid As Grid
    Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
        Debug.Print(ThemeTempFolder)
        loadInterface()
    End Sub
    Sub loadInterface()
        ' Load extracted (grid) xaml file as content of the window
        Dim GridUri As String = ThemeTempFolder & "theme.xaml"
        Dim fs As FileStream = New FileStream(GridUri, FileMode.Open, FileAccess.Read)
        Dim sri = TryCast(System.Windows.Markup.XamlReader.Load(fs), Grid)
        Me.Content = sri
        fs.Close()
        ' Liens, dans le code, aux ?l?ments de l'interface charg?e en Xaml.
        themeGrid = LogicalTreeHelper.FindLogicalNode(sri, "themeGrid")
    End Sub
End Class
Public Class imgurlConvert
    Implements IValueConverter
    Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
        Dim valConv As String = MainWindow.ThemeTempFolder & value
        If File.Exists(valConv) Then
            Return valConv
        End If
        Return Nothing
    End Function
    Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
        Return value
    End Function
End Class
The XAML file to load:
Code:
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:local="clr-namespace:WpfApplication1" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib" Name="themeGrid">
    <Grid.Resources>
        <local:imgurlConvert x:Key="urlConvert" />
    </Grid.Resources>
    <Grid Name="mainGrid">
        <Image Source={Binding Path="image.png", Converter={StaticResource urlConvert}} CacheOption="OnLoad" x:Name="Image1"/>
    </Grid>
</Grid>
I hope that I was clear enough!? Thanks for helping me!!