How do I reference different DLLs in Kaxaml

前端 未结 4 968
情歌与酒
情歌与酒 2021-02-04 17:29

I want to work with a DataGrid in Kaxaml. How do I reference the toolkit dll?

相关标签:
4条回答
  • 2021-02-04 17:55

    Building on top of Todd White's solution (& this is future reference for myself too) your XAML in Kaxaml would reference a 3rd party library as follows:

    <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:dxlc="clr-namespace:DevExpress.Xpf.LayoutControl;assembly=DevExpress.Xpf.LayoutControl.v13.2"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <!-- Layout Control  Start -->
      <dxlc:LayoutControl Orientation="Horizontal">
      </dxlc:LayoutControl>
      <!-- Layout Control  End -->
    </UserControl>
    
    0 讨论(0)
  • 2021-02-04 17:59
    1. Copy WPFToolkit.dll to "C:\Program Files\Kaxaml\"
      • Restart Kaxaml

    Now you can use such namespace:

    xmlns:dg="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
    
    0 讨论(0)
  • 2021-02-04 18:04

    Another option would be to make a junction and add a probing path to Kaxaml's config.

    Make Junction to code

    • run elevated cmd
    • cd "c:\Program Files (x86)\Kaxaml"
    • mklink /J ProbeFolder "c:\path-to-your-code"

    Modify Kaxaml.exe.config

    • run elevated notepad
    • open "C:\Program Files (x86)\Kaxaml\Kaxaml.exe.config"
    • add the following to the <configuration>:
    <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="ProbeFolder"/>
       </assemblyBinding>
    </runtime>
    
    • save the file
    • restart kaxaml
    0 讨论(0)
  • 2021-02-04 18:05

    When mapping custom classes and namespaces in XAML using the clr-namespace/assembly notation, you can't specify the path of the assembly containing the class but just the assembly's name (more details can be found on MSDN), since all referenced assemblies must be linked during the XAML compilation via the project file.

    Kaxaml doesn't support the concept of a project since it doesn't do any compilation but rather dynamically parses and renders the XAML entered in the editor "on-the-fly" by using the System.Windows.Markup.XamlReader class.

    This means that when using Kaxaml you can only reference classes contained in the assemblies that are part of the .NET Framework.

    0 讨论(0)
提交回复
热议问题