1using ICSharpCode.AvalonEdit.Highlighting;
2using ICSharpCode.AvalonEdit.Highlighting.Xshd;
5using System.ComponentModel;
8using System.Windows.Controls;
9using System.Windows.Documents;
18 public partial class DesignTab : UserControl
25 this.model.PropertyChanged += this.Model_PropertyChanged;
30 using MemoryStream ms =
new(Bin);
31 using XmlReader r = XmlReader.Create(ms);
32 IHighlightingDefinition Def = HighlightingLoader.Load(r, HighlightingManager.Instance);
33 HighlightingManager.Instance.RegisterHighlighting(Def.Name, Array.Empty<
string>(), Def);
38 private void Model_PropertyChanged(
object sender, PropertyChangedEventArgs e)
40 switch (e.PropertyName)
43 string Markdown = this.model.HumanReadableMarkdown;
44 if (Markdown != this.HumanReadableMarkdownEditor.Text)
45 this.HumanReadableMarkdownEditor.Text = Markdown;
49 string Xml = this.model.MachineReadable;
50 if (Xml != this.MachineReadableXmlEditor.Text)
51 this.MachineReadableXmlEditor.Text = Xml;
56 private void OpenAiKey_PasswordChanged(
object sender, RoutedEventArgs e)
58 this.model.OpenAiKey = this.OpenAiKey.Password;
61 private void Hyperlink_Click(
object sender, RoutedEventArgs e)
63 if (sender is Hyperlink Link)
67 private void HumanReadableMarkdownEditor_TextChanged(
object sender, EventArgs e)
69 this.model.HumanReadableMarkdown = this.HumanReadableMarkdownEditor.Text;
72 private void MachineReadableXmlEditor_TextChanged(
object sender, EventArgs e)
74 this.model.MachineReadable = this.MachineReadableXmlEditor.Text;
Interaction logic for App.xaml
Interaction logic for MainWindow.xaml
static void OpenUrl(Uri Url)
Opens an URL in the currently selected browser using the Shell.
string HumanReadableMarkdown
Human-readable markdown
string MachineReadable
Machine-Readable XML in the contract
void InitializeComponent()
InitializeComponent
Static class managing loading of resources stored as embedded resources or in content files.
static byte[] LoadResource(string ResourceName)
Loads a resource from an embedded resource.
Static class that dynamically manages types and interfaces available in the runtime environment.
static object InstantiateDefault(Type Type, params object[] Arguments)
Returns an instance of the type Type . If one needs to be created, it is. If the constructor requires...