diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-18 12:00:50 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-18 12:00:50 +0200 |
| commit | b73ca494e24ad83f8768946a5bd2e91a60d7d65e (patch) | |
| tree | e65285f9af71da2dc75b22b85b070d18a138ba69 /Software/Visual_Studio/Tango.SharedUI/Controls | |
| parent | 1b0cc929b5641c58faf5830ec70d3dec4030b1fd (diff) | |
| download | Tango-b73ca494e24ad83f8768946a5bd2e91a60d7d65e.tar.gz Tango-b73ca494e24ad83f8768946a5bd2e91a60d7d65e.zip | |
Implemented open dispensers & machine designer via double click.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Controls')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Controls/DoubleClickDataGrid.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/DoubleClickDataGrid.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/DoubleClickDataGrid.cs new file mode 100644 index 000000000..85b104aa8 --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/DoubleClickDataGrid.cs @@ -0,0 +1,37 @@ +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.Input; + +namespace Tango.SharedUI.Controls +{ + public class DoubleClickDataGrid : DataGrid + { + public ICommand DoubleClickCommand + { + get { return (ICommand)GetValue(DoubleClickCommandProperty); } + set { SetValue(DoubleClickCommandProperty, value); } + } + public static readonly DependencyProperty DoubleClickCommandProperty = + DependencyProperty.Register("DoubleClickCommand", typeof(ICommand), typeof(DoubleClickDataGrid), new PropertyMetadata(null)); + + + + public DoubleClickDataGrid() + { + this.MouseDoubleClick += DoubleClickDataGrid_MouseDoubleClick; + } + + private void DoubleClickDataGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) + { + if (SelectedItem != null) + { + DoubleClickCommand?.Execute(SelectedItem); + } + } + } +} |
