MainView Separar Desktop y Mobile layout usando <OnPlatform> #17

Open
opened 2026-04-04 08:53:09 +00:00 by AztiIluna · 0 comments
AztiIluna commented 2026-04-04 08:53:09 +00:00 (Migrated from github.com)

https://docs.avaloniaui.net/docs/platform-specific-guides/xaml

<OnPlatform>
    <!-- if (Android || iOS) -->
    <On Options="Android, iOS">
        <StyleInclude Source="/Styles/Mobile.axaml" />
    </On>
    <!-- else -->
    <On Options="Default">
        <StyleInclude Source="/Styles/Default.axaml" />
    </On>
</OnPlatform>
https://docs.avaloniaui.net/docs/platform-specific-guides/xaml <StackPanel> <OnPlatform> <OnPlatform.Default> <ToggleButton Content="Hello World" /> </OnPlatform.Default> <OnPlatform.iOS> <ToggleSwitch Content="Hello iOS" /> </OnPlatform.iOS> </OnPlatform> </StackPanel> <!-- Only one branch is executed in runtime --> <OnPlatform> <!-- if (Android || iOS) --> <On Options="Android, iOS"> <StyleInclude Source="/Styles/Mobile.axaml" /> </On> <!-- else --> <On Options="Default"> <StyleInclude Source="/Styles/Default.axaml" /> </On> </OnPlatform>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
danel/Domotika#17
No description provided.