wpfXamlEditor

UNDER CONSTRUCTION

Overview

wpfXamlEditor is a Xaml editor for an APL variable in a workspace or for a file on disk. The user command is able to show the Xaml in color with folding, print it, reorganize it so it is more readable according to some settings set by the user. It is inspired by the work of Robby Ingebretsen of Kaxaml (http://www.Kaxaml.com). It is particularly valuable to the users that like to keep their Xaml in the workspace. With XamlEditor they have a tool to maintain it without effort.

Usage

Once installed the user command can be invoke by typing ]XamlEditor (casing is not important, no argument). The following start-up screen should appear:

InitialView.png
Here is a short description for each buttons:

Button

Explanation

Button

Explanation

Exec32.png

Execute the Xaml and Show the Result in a Separate Window

SelectAll24.png

Select All the Xaml

Scrubber24.png

Scrub the Xaml According to Settings

Delete24.png

Delete the Selected Text

OpenObject24.png

Open a Dialog Box to Select a Xaml Variable in the WS

ClearClipboard24.png

Clear the Clipboard

SaveObject24.png

Open a Dialog Box to Save the Xaml as a Variable in the WS

Undo24.png

Undo Last Operation

Open24.png

Open a Dialog Box to Select a File on Disk

Redo24.png

Redo Previous Operation

Save24.png

Open a Dialog Box to Save the Xaml to a File

Print32.png

Print All the Xaml

Cut24.png

Cut the Selected Text to The Clipboard

PrintPreview32.png

Print Preview All the Xaml

Copy24.png

Copy the Selected Text to the Clipboard

Comments24.png

Make Selected Text a Comment

Paste24.png

Paste the Text From the clipboard

Settings24.png

Choose the Settings when Scrubbing


The settings for scrubbing are saved in a xml file named XED.Settings.xml. The file will be created automatically the first time the user command runs. It will be located next to the wpfXamlEditor.dyalog file or in the AppData directory depending on the Windows version and security. The data of the file looks like this:

<Settings>
  <EditorFont>APL385 Unicode</EditorFont>
  <EditorFontSize>14</EditorFontSize>
  <ReducePrecision>0</ReducePrecision>
  <Precision>10</Precision>
  <AttributeCounteTolerance>2</AttributeCounteTolerance>
  <ReorderAttributes>1</ReorderAttributes>
  <RemoveCommonDefaultValues>1</RemoveCommonDefaultValues>
  <ConvertTabsToSpaces>1</ConvertTabsToSpaces>
  <SpaceCount>2</SpaceCount>
</Settings>


It is used to build the Settings window (button Settings24.png of the command bar).
Settings.png
Look at the individual tooltips on the Window for more information on each settings.

Installation

Download the following file wpfXamlEditor.1.0.zip. UnZip and copy the files to your user command directory (for advice how to organize your User Commands see UserCommands/WhereShouldTheyGo). The downloaded file contains the Dyalog user command file wpfXamlEditor.dyalog and a dll named ICSharpCode.AvalonEdit.dll. That dll is free of charge and can be downloaded from CodeProject or from AvalonEdit but is included in the zip file for commodity.

If the first time you run the user command you get an error similar to this: EXCEPTION: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561 934e089' failed. it is because the dll cannot run. Depending on the version of Windows and the security you will need to either right click on the dll and if you see and UnBlock button, click on it and try again. If the UnBlock button is not present you will need to modify the manifest file named dyalog.exe.config that is located in the same directory as dyalog.exe. The manifest file should look like this (if not present you will need to create it and add it to the directory while in administrator mode):

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
  <runtime>
    <!-- <NetFx40_LegacySecurityPolicy enabled="true"/> -->
    <loadFromRemoteSources enabled="true"/>
    <trust level="Full"/>
  </runtime>
</configuration>