-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
83 deletions.
There are no files selected for viewing
84 changes: 42 additions & 42 deletions
84
MAUI.FreakyControls/MAUI.FreakyControls/Shared/FreakyDatePicker/FreakyDatePickerHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
using System; | ||
using Maui.FreakyControls.Extensions; | ||
using Microsoft.Maui.Handlers; | ||
|
||
namespace Maui.FreakyControls; | ||
using System; | ||
using Maui.FreakyControls.Extensions; | ||
using Microsoft.Maui.Handlers; | ||
|
||
#if ANDROID || IOS | ||
public partial class FreakyDatePickerHandler : DatePickerHandler | ||
{ | ||
public FreakyDatePickerHandler() | ||
{ | ||
Mapper.AppendToMapping("FreakyDatePickerCustomization", MapDatePicker); | ||
} | ||
|
||
// Todo: Remove try-catch added as a quickfix for https://github.com/FreakyAli/Maui.FreakyControls/issues/76 | ||
private void MapDatePicker(IDatePickerHandler datePickerHandler, IDatePicker datePicker) | ||
{ | ||
try | ||
{ | ||
if (datePicker is FreakyDatePicker freakyDatePicker && | ||
datePickerHandler is FreakyDatePickerHandler freakyDatePickerHandler) | ||
{ | ||
if (PlatformView != null && VirtualView != null) | ||
{ | ||
if (freakyDatePicker.ImageSource != default(ImageSource)) | ||
{ | ||
freakyDatePickerHandler.HandleAndAlignImageSourceAsync(freakyDatePicker).RunConcurrently(); | ||
} | ||
} | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
ex.TraceException(); | ||
} | ||
} | ||
} | ||
|
||
#else | ||
public partial class FreakyDatePickerHandler : DatePickerHandler | ||
{ | ||
} | ||
#endif | ||
namespace Maui.FreakyControls; | ||
|
||
#if ANDROID || IOS | ||
public partial class FreakyDatePickerHandler : DatePickerHandler | ||
{ | ||
public FreakyDatePickerHandler() | ||
{ | ||
Mapper.AppendToMapping("FreakyDatePickerCustomization", MapDatePicker); | ||
} | ||
|
||
// Todo: Remove try-catch added as a quickfix for https://github.com/FreakyAli/Maui.FreakyControls/issues/76 | ||
private void MapDatePicker(IDatePickerHandler datePickerHandler, IDatePicker datePicker) | ||
{ | ||
try | ||
{ | ||
if (datePicker is FreakyDatePicker freakyDatePicker && | ||
datePickerHandler is FreakyDatePickerHandler freakyDatePickerHandler) | ||
{ | ||
if (PlatformView != null && VirtualView != null) | ||
{ | ||
if (freakyDatePicker.ImageSource != default(ImageSource)) | ||
{ | ||
freakyDatePickerHandler.HandleAndAlignImageSourceAsync(freakyDatePicker).RunConcurrently(); | ||
} | ||
} | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
ex.TraceException(); | ||
} | ||
} | ||
} | ||
|
||
#else | ||
public partial class FreakyDatePickerHandler : DatePickerHandler | ||
{ | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters