---
title: "Comment by Mohamed Noordin on \"Platform-specific XAML in .NET MAUI\" | Hashnode"
description: "Actually, the View control can&#39;t be used as a base class for the return type (I&#39;m not sure why), but we have to use another View-derived control like a"
url: "https://hashnode.com/posts/platform-specific-xaml-in-net-maui/653648cf27cbfb771f1ce248/comment/653d532e8bb1c48f931a2794"
---

[Discussion](https://hashnode.com/posts/platform-specific-xaml-in-net-maui/653648cf27cbfb771f1ce248)

Comment [Platform-specific XAML in .NET MAUI](https://hashnode.com/posts/platform-specific-xaml-in-net-maui/653648cf27cbfb771f1ce248)

[Mohamed Noordin](https://hashnode.com/@MohamedNoordin)

[Oct 28, 2023](https://hashnode.com/posts/platform-specific-xaml-in-net-maui/653648cf27cbfb771f1ce248/comment/653d532e8bb1c48f931a2794)

Actually, the View control can't be used as a base class for the return type (I'm not sure why), but we have to use another View-derived control like a Grid or any layout. Also, the above use of the <OnIdiom> markup is invalid. This markup does not use the <On> tag, nor Idiom attribute like what <OnPlatform> does. It should be like:

<OnIdiom x:TypeArguments="Grid"> <OnIdiom.Desktop> <views:DesktopView /> </OnIdiom.Desktop> <OnIdiom.Phone> <views:MobileView /> </OnIdiom.Phone> </OnIdiom> May I ask Microsoft, where is constancy? You can also use these markups in a short-handed way:

<Grid BackgroundColor="{OnIdiom Desktop=AliceBlue, Phone=Aqua}"/> Thanks for the great work! Hashnode first experience to create an account is a matter of time-waste though.

[Julian Ewers-Peters](https://hashnode.com/@ewerspej)

[Feb 17, 2024](https://hashnode.com/posts/platform-specific-xaml-in-net-maui/653648cf27cbfb771f1ce248/comment/653d532e8bb1c48f931a2794#reply-65d0693b0dbcb6e7f2a36400)

Not sure what you mean.
