11 instantiations of DevicePlatform
Microsoft.Maui.Essentials (11)
Types\DevicePlatform.shared.cs (11)
15
public static DevicePlatform Android { get; } = new
DevicePlatform
(nameof(Android));
20
public static DevicePlatform iOS { get; } = new
DevicePlatform
(nameof(iOS));
26
public static DevicePlatform macOS { get; } = new
DevicePlatform
(nameof(macOS));
32
public static DevicePlatform MacCatalyst { get; } = new
DevicePlatform
(nameof(MacCatalyst));
37
public static DevicePlatform tvOS { get; } = new
DevicePlatform
(nameof(tvOS));
42
public static DevicePlatform Tizen { get; } = new
DevicePlatform
(nameof(Tizen));
48
public static DevicePlatform UWP { get; } = new
DevicePlatform
(nameof(WinUI));
53
public static DevicePlatform WinUI { get; } = new
DevicePlatform
(nameof(WinUI));
58
public static DevicePlatform watchOS { get; } = new
DevicePlatform
(nameof(watchOS));
63
public static DevicePlatform Unknown { get; } = new
DevicePlatform
(nameof(Unknown));
82
new
DevicePlatform
(devicePlatform);
71 references to DevicePlatform
Microsoft.Maui.Controls (20)
DeviceStateTrigger.cs (4)
43
var
device =
DevicePlatform
.Create(Device);
45
if (device ==
DevicePlatform
.Create("UWP"))
46
SetActive(DeviceInfo.Platform ==
DevicePlatform
.WinUI);
FlyoutPage\FlyoutPage.cs (1)
303
return DeviceInfo.Platform ==
DevicePlatform
.macOS;
ListView\ListView.cs (4)
120
if (DeviceInfo.Platform ==
DevicePlatform
.Unknown ||
121
DeviceInfo.Platform ==
DevicePlatform
.Android ||
122
DeviceInfo.Platform ==
DevicePlatform
.iOS ||
123
DeviceInfo.Platform ==
DevicePlatform
.macOS)
OnPlatform.cs (1)
50
if (onPlat.Platform != null && onPlat.Platform.Contains("UWP") && DeviceInfo.Platform ==
DevicePlatform
.WinUI)
Shell\BaseShellItem.cs (3)
432
else if (DeviceInfo.Platform ==
DevicePlatform
.Tizen)
463
else if (DeviceInfo.Platform ==
DevicePlatform
.Tizen)
515
else if (DeviceInfo.Platform ==
DevicePlatform
.Tizen)
Shell\Shell.cs (1)
85
defaultValueCreator: (b) => DeviceInfo.Platform ==
DevicePlatform
.Android);
TemplatedItemsList.cs (1)
1221
if (DeviceInfo.Platform ==
DevicePlatform
.iOS && CachingStrategy == ListViewCachingStrategy.RetainElement)
Visuals\VisualMarker.cs (3)
31
if (DeviceInfo.Platform ==
DevicePlatform
.iOS || DeviceInfo.Platform ==
DevicePlatform
.Android || DeviceInfo.Platform ==
DevicePlatform
.Tizen)
WebView\WebView.cs (2)
123
if (DeviceInfo.Platform !=
DevicePlatform
.Android)
127
if (DeviceInfo.Platform !=
DevicePlatform
.WinUI)
Microsoft.Maui.Controls.Xaml (11)
MarkupExtensions\OnPlatformExtension.cs (10)
130
if (DeviceInfo.Platform ==
DevicePlatform
.Android && Android != s_notset)
135
if (DeviceInfo.Platform ==
DevicePlatform
.Create("GTK") && GTK != s_notset)
140
if (DeviceInfo.Platform ==
DevicePlatform
.iOS && iOS != s_notset)
145
if (DeviceInfo.Platform ==
DevicePlatform
.macOS && macOS != s_notset)
150
if (DeviceInfo.Platform ==
DevicePlatform
.MacCatalyst && MacCatalyst != s_notset)
155
if (DeviceInfo.Platform ==
DevicePlatform
.Tizen && Tizen != s_notset)
160
if (DeviceInfo.Platform ==
DevicePlatform
.WinUI && WinUI != s_notset)
166
if (DeviceInfo.Platform ==
DevicePlatform
.WinUI && UWP != s_notset)
171
if (DeviceInfo.Platform ==
DevicePlatform
.Create("UWP") && UWP != s_notset)
177
if (DeviceInfo.Platform ==
DevicePlatform
.Create("WPF") && WPF != s_notset)
XamlParser.cs (1)
303
if (targetPlatform == "Windows" && DeviceInfo.Platform ==
DevicePlatform
.WinUI)
Microsoft.Maui.Essentials (40)
DeviceInfo\DeviceInfo.netstandard.cs (2)
18
public
DevicePlatform
Platform =>
DevicePlatform
.Unknown;
DeviceInfo\DeviceInfo.shared.cs (2)
55
DevicePlatform
Platform { get; }
102
public static
DevicePlatform
Platform => Current.Platform;
FilePicker\FilePicker.shared.cs (4)
134
readonly IDictionary<
DevicePlatform
, IEnumerable<string>> fileTypes;
140
fileTypes = new Dictionary<
DevicePlatform
, IEnumerable<string>>();
151
public FilePickerFileType(IDictionary<
DevicePlatform
, IEnumerable<string>> fileTypes) =>
164
protected virtual IEnumerable<string> GetPlatformFileType(
DevicePlatform
platform)
Types\DevicePlatform.shared.cs (32)
8
public readonly struct DevicePlatform : IEquatable<
DevicePlatform
>
13
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents Android.
15
public static
DevicePlatform
Android { get; } = new DevicePlatform(nameof(Android));
18
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents iOS.
20
public static
DevicePlatform
iOS { get; } = new DevicePlatform(nameof(iOS));
23
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents macOS.
26
public static
DevicePlatform
macOS { get; } = new DevicePlatform(nameof(macOS));
29
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents Mac Catalyst.
32
public static
DevicePlatform
MacCatalyst { get; } = new DevicePlatform(nameof(MacCatalyst));
35
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents Apple tvOS.
37
public static
DevicePlatform
tvOS { get; } = new DevicePlatform(nameof(tvOS));
40
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents Samsung Tizen.
42
public static
DevicePlatform
Tizen { get; } = new DevicePlatform(nameof(Tizen));
45
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents UWP.
48
public static
DevicePlatform
UWP { get; } = new DevicePlatform(nameof(WinUI));
51
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents WinUI.
53
public static
DevicePlatform
WinUI { get; } = new DevicePlatform(nameof(WinUI));
56
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents Apple watchOS.
58
public static
DevicePlatform
watchOS { get; } = new DevicePlatform(nameof(watchOS));
61
/// Gets an instance of <see cref="
DevicePlatform
"/> that represents an unknown platform. This is used for when the current platform is unknown.
63
public static
DevicePlatform
Unknown { get; } = new DevicePlatform(nameof(Unknown));
80
/// <returns>A new instance of <see cref="
DevicePlatform
"/> with the specified platform identifier.</returns>
81
public static
DevicePlatform
Create(string devicePlatform) =>
85
/// Compares the underlying <see cref="
DevicePlatform
"/> instances.
87
/// <param name="other"><see cref="
DevicePlatform
"/> object to compare with.</param>
89
public bool Equals(
DevicePlatform
other) =>
97
obj is
DevicePlatform
&& Equals((
DevicePlatform
)obj);
123
public static bool operator ==(
DevicePlatform
left,
DevicePlatform
right) =>
132
public static bool operator !=(
DevicePlatform
left,
DevicePlatform
right) =>