diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs index 1993e8cae..6aa92d15e 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchPanel.cs @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -23,7 +22,6 @@ namespace Tango.Touch.Controls private TouchIconButton _comboBoxCloseButton; private TouchCalendar _calendar; private Grid _calendar_grid; - private bool _isDialogGridMaskMouseDown; static TouchPanel() { @@ -32,19 +30,19 @@ namespace Tango.Touch.Controls public TouchPanel() { - ComboBoxPickedCommand = new RelayCommand((x) => + ComboBoxPickedCommand = new RelayCommand((x) => { CurrentComboBox.SetResultFromTouchPanel(x); CurrentComboBox = null; }); - DateSelectedCommand = new RelayCommand(() => + DateSelectedCommand = new RelayCommand(() => { CurrentDatePicker.SetResultFromTouchPanel(_calendar.SelectedDate.Value); CurrentDatePicker = null; }); - CancelDateCommand = new RelayCommand(() => + CancelDateCommand = new RelayCommand(() => { CurrentDatePicker = null; }); @@ -72,9 +70,6 @@ namespace Tango.Touch.Controls _comboBoxCloseButton = GetTemplateChild("PART_comboboxCloseButton") as TouchIconButton; _calendar_grid = GetTemplateChild("PART_datepicker_grid") as Grid; _calendar = GetTemplateChild("PART_calendar") as TouchCalendar; - var gridDialogsMask = GetTemplateChild("PART_gridDialogsMask") as Grid; - gridDialogsMask.MouseUp += GridDialogsMask_MouseUp; - gridDialogsMask.MouseDown += GridDialogsMask_MouseDown; _comboBoxCloseButton.RegisterForPreviewMouseOrTouchUp(OnComboBoxClose); _combobox_grid.RegisterForMouseOrTouchDown(OnComboBoxGridDown); @@ -84,34 +79,6 @@ namespace Tango.Touch.Controls _calendar.SelectedDatesChanged += _calendar_SelectedDatesChanged; } - private void GridDialogsMask_MouseDown(object sender, MouseButtonEventArgs e) - { - _isDialogGridMaskMouseDown = true; - } - - private void GridDialogsMask_MouseUp(object sender, MouseButtonEventArgs e) - { - if (_isDialogGridMaskMouseDown) - { - if (e.Source == sender) - { - try - { - if ((CurrentDialog.DataContext as DialogViewVM).CanClose) - { - (CurrentDialog.DataContext as DialogViewVM).CloseCommand?.Execute(null); - } - } - catch (Exception ex) - { - Debug.WriteLine($"Error in touch panel {ex.ToString()}"); - } - } - } - - _isDialogGridMaskMouseDown = false; - } - private void _calendar_SelectedDatesChanged(object sender, SelectionChangedEventArgs e) { Mouse.Capture(null); @@ -181,7 +148,7 @@ namespace Tango.Touch.Controls set { SetValue(CurrentComboBoxProperty, value); } } internal static readonly DependencyProperty CurrentComboBoxProperty = - DependencyProperty.Register("CurrentComboBox", typeof(TouchComboBox), typeof(TouchPanel), new PropertyMetadata(null, (d, e) => (d as TouchPanel).OnCurrentComboBoxChanged())); + DependencyProperty.Register("CurrentComboBox", typeof(TouchComboBox), typeof(TouchPanel), new PropertyMetadata(null,(d,e) => (d as TouchPanel).OnCurrentComboBoxChanged())); internal TouchDatePicker CurrentDatePicker { |
