-1

I found source of WPF.MDI and I try to use it in my project without any specific dlls. So, I added source into the project

Then, wrote xmlns declaration xmlns:mdi="clr-namespace:WPF.MDI" and created a container with MdiChild

    <mdi:MdiContainer Theme="Aero">
        <mdi:MdiChild />
    </mdi:MdiContainer>

But, I received an error XamlParseException.

I guess, I do it wrong at all. But, there is any solutions for this?

UPDATE: When I put WPF.MDI.dll into folder with .exe file and start it - there is no errors. Why it wants to find dll?

Community
  • 1
  • 1
Artem Kyba
  • 855
  • 1
  • 11
  • 30
  • Did you also receive some kind of detailed error message about what went wrong? – Thorsten Dittmar Feb 27 '14 at 14:17
  • `Call the constructor for type"WPF.MDI.MdiContainer", satisfying the specified binding constraints, led to an exception." Row number "7" and the position in the "10."` the string is `` – Artem Kyba Feb 27 '14 at 14:20

2 Answers2

0

Try setting your namespace declaration like this:

 xmlns:mdi="clr-namespace:WPF.MDI;assembly=MDISource"

So add the assembly part. You need to add this if your class is in a different assembly. See MSDN:

assembly= The assembly that contains some or all of the referenced CLR namespace. This value is typically just the name of the assembly, not the path, and does not include the extension (such as .dll or .exe). The path to that assembly must be established as a project reference in the project file that contains the XAML you are trying to map. In order to incorporate versioning and strong-name signing, the assembly value can be a string as defined by AssemblyName, rather than the simple string name.

assembly can be omitted if the clr-namespace referenced is being defined within the same assembly as the application code that is referencing the custom classes. Or, an equivalent syntax for this case is to specify assembly=, with no string token following the equals sign.

UPDATE Read this answer.

Community
  • 1
  • 1
Loetn
  • 3,832
  • 25
  • 41
0

The problem was solved after deleting the strings 96-100 in MdiContainer.cs

        if (Environment.OSVersion.Version.Major == 5)
            ThemeValueChanged(this, new DependencyPropertyChangedEventArgs(ThemeProperty, Theme, ThemeType.Luna));
        else
            ThemeValueChanged(this, new DependencyPropertyChangedEventArgs(ThemeProperty, Theme, ThemeType.Aero));
Artem Kyba
  • 855
  • 1
  • 11
  • 30