Skip to content

Commit

Permalink
(MahAppsGH-3746) Fix some issues from Codacy/PR Quality Review
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed May 6, 2020
1 parent f1b17c6 commit 35814a0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/MahApps.Metro/Controls/TimePicker/DateTimePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected override void FocusElementAfterIsDropDownOpenChanged()
// have been set even before the template for the DatePicker is
// applied. And this would mean that the visuals wouldn't be available yet.

this.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate()
this.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate
{
// setting the focus to the calendar will focus the correct date.
this.calendar.Focus();
Expand Down Expand Up @@ -200,13 +200,11 @@ private void CalendarDisplayDateChanged(object sender, CalendarDateChangedEventA

private void CalendarPreviewKeyDown(object sender, RoutedEventArgs e)
{
var calendar = sender as Calendar;
var keyEventArgs = (KeyEventArgs)e;

Debug.Assert(calendar != null);
Debug.Assert(keyEventArgs != null);

if (keyEventArgs.Key == Key.Escape || ((keyEventArgs.Key == Key.Enter || keyEventArgs.Key == Key.Space) && calendar.DisplayMode == CalendarMode.Month))
if (keyEventArgs.Key == Key.Escape || ((keyEventArgs.Key == Key.Enter || keyEventArgs.Key == Key.Space) && this.calendar.DisplayMode == CalendarMode.Month))
{
this.SetCurrentValue(IsDropDownOpenProperty, false);
if (keyEventArgs.Key == Key.Escape)
Expand Down
2 changes: 1 addition & 1 deletion src/MahApps.Metro/Controls/TimePicker/TimePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected override void FocusElementAfterIsDropDownOpenChanged()
// have been set even before the template for the DatePicker is
// applied. And this would mean that the visuals wouldn't be available yet.

this.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate()
this.Dispatcher.BeginInvoke(DispatcherPriority.Input, (Action)delegate
{
// setting the focus to the calendar will focus the correct date.
this.hourInput.Focus();
Expand Down
4 changes: 2 additions & 2 deletions src/MahApps.Metro/Controls/TimePicker/TimePickerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public abstract class TimePickerBase : Control
private bool deactivateTextChangedEvent;
private bool textInputChanged;
private UIElement hourHand;
public Selector hourInput;
protected Selector hourInput;
private UIElement minuteHand;
private Selector minuteInput;
protected Popup popUp;
private Popup popUp;
private bool disablePopupReopen;
private UIElement secondHand;
private Selector secondInput;
Expand Down

0 comments on commit 35814a0

Please sign in to comment.