Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

How to select control in XAML based on platform

$
0
0

I have the existing xaml with DatePicker and TimePicker Attached/shown below.

Because DatePicker and TimePicker are not working on macOS I have to create myMacOSDatePicker and myMacOSTimePicker.

How do I select control in the XAML based on platform, so that On "Droid, iOS, UWP" the DatePicker and TimePicker are used, but On "macOS" myMacOSDatePicker and myMacOSTimePicker are used ?

Thanks in advance
Eigil/

Existing XAML:
<StackLayout <DatePicker x:Name="StartDatePicker" DateSelected="StartDatePicker_DateSelected" Style="{DynamicResource baseDatePickerStyle}" TabIndex="2" /> <TimePicker x:Name="StartTimePicker" PropertyChanged="StartTimePicker_PropertyChanged" Style="{StaticResource baseTimePickerStyle}" TabIndex="3" /> <Label x:Name="StartDayName" Style="{StaticResource baseStartEndDateTimeEntryLabelStyle}" Text=" MMM " /> <Button x:Name="StartDateTimeNowButton" Clicked="OnStartDateTimeNowButtonClicked" Style="{StaticResource baseButtonStyle}" TabIndex="4" Text="Now" /> </StackLayout>


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>