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 | |
| 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')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Controls/DoubleClickDataGrid.cs | 37 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj | 3 |
2 files changed, 39 insertions, 1 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); + } + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 65f2fe46b..a8bd06040 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -67,6 +67,7 @@ <Compile Include="Components\SelectedObjectCollection.cs" /> <Compile Include="Components\TextController.cs" /> <Compile Include="Controls\AdornerContentPresenter.cs" /> + <Compile Include="Controls\DoubleClickDataGrid.cs" /> <Compile Include="Controls\HexagonControl.cs" /> <Compile Include="Controls\HiveControl.xaml.cs"> <DependentUpon>HiveControl.xaml</DependentUpon> @@ -234,7 +235,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
