diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-03-25 14:35:30 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-03-25 14:35:30 +0200 |
| commit | cbb5066b1997bb430e33a89e742fd0b5c440a388 (patch) | |
| tree | 3b45ad87006780a11f0323a5716cdd0a85d30d30 /Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs | |
| parent | 0a3f882fe4d388d7387a165349595208cf96a3ae (diff) | |
| parent | df1a05d5586fbce72e9aa2cb05cd64f74d1b98e9 (diff) | |
| download | Tango-cbb5066b1997bb430e33a89e742fd0b5c440a388.tar.gz Tango-cbb5066b1997bb430e33a89e742fd0b5c440a388.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs')
| -rw-r--r-- | Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs new file mode 100644 index 000000000..ad6c65f22 --- /dev/null +++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Controls/SolutionItemControl.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.Scripting.IDE.Controls +{ + public class SolutionItemControl : Control + { + public ISolutionItem SolutionItem + { + get { return (ISolutionItem)GetValue(SolutionItemProperty); } + set { SetValue(SolutionItemProperty, value); } + } + public static readonly DependencyProperty SolutionItemProperty = + DependencyProperty.Register("SolutionItem", typeof(ISolutionItem), typeof(SolutionItemControl), new PropertyMetadata(null)); + + public ICommand OpenCommand + { + get { return (ICommand)GetValue(OpenCommandProperty); } + set { SetValue(OpenCommandProperty, value); } + } + public static readonly DependencyProperty OpenCommandProperty = + DependencyProperty.Register("OpenCommand", typeof(ICommand), typeof(SolutionItemControl), new PropertyMetadata(null)); + + static SolutionItemControl() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(SolutionItemControl), new FrameworkPropertyMetadata(typeof(SolutionItemControl))); + } + + public SolutionItemControl() + { + PreviewMouseDoubleClick += (_, __) => + { + if (SolutionItem.CanOpen) + { + OpenCommand?.Execute(SolutionItem); + } + }; + } + } +} |
