diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-07-25 01:58:40 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-07-25 01:58:40 +0300 |
| commit | b885adb509065d964d628f90a3800f519f49f622 (patch) | |
| tree | d3779856aaae3f777269ad9aa7aed341c62a43d3 /Software/Visual_Studio/Scripting/Tango.Scripting.Editors/XamlEditor.cs | |
| parent | 84b3861addbb2f60c8b45e74d2748d4de5c39d86 (diff) | |
| download | Tango-b885adb509065d964d628f90a3800f519f49f622.tar.gz Tango-b885adb509065d964d628f90a3800f519f49f622.zip | |
Procedure custom dialogs !
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.Editors/XamlEditor.cs')
| -rw-r--r-- | Software/Visual_Studio/Scripting/Tango.Scripting.Editors/XamlEditor.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/XamlEditor.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/XamlEditor.cs new file mode 100644 index 000000000..22b425ba2 --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/XamlEditor.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; + +namespace Tango.Scripting.Editors +{ + public class XamlEditor : TextEditor + { + private bool preventCodeUpdate; + + public String Xaml + { + get { return (String)GetValue(XamlProperty); } + set { SetValue(XamlProperty, value); } + } + public static readonly DependencyProperty XamlProperty = + DependencyProperty.Register("Xaml", typeof(String), typeof(XamlEditor), new PropertyMetadata(null, (d, e) => (d as XamlEditor).OnXamlChanged())); + + public XamlEditor() + { + TextChanged += XamlEditor_TextChanged; + } + + private void XamlEditor_TextChanged(object sender, EventArgs e) + { + if (!preventCodeUpdate) + { + preventCodeUpdate = true; + Xaml = Text; + preventCodeUpdate = false; + } + } + + private void OnXamlChanged() + { + if (!preventCodeUpdate) + { + preventCodeUpdate = true; + Text = Xaml; + preventCodeUpdate = false; + } + } + } +} |
