I create new Uno Cross-Platform App 2.2 from template. When I open Shared->MainPage.xaml in doesn't open designer in code view there is a underlined error The type 'page' does not support direct content
<Page
x:Class="App6.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App6"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Text="Hello, world!" Margin="20" FontSize="30" />
</Grid>
</Page>
This is an Intellisense issue which happens when the project selector (the DropDown at the top of the XAML editor) is not on the UWP project, but rather on iOS, Android or another platform.
If you select the UWP project, close the editor, and re-open it again, the errors will disappear.
As of Visual Studio 2019 16.5 the issue is still present, but is likely to be addressed in a future version.
At the beginning I can use designer to edit MainPage.xaml in Shared folder, after one moment (there was an error that crashed my VS) not any more...
So solution is to move MainPage.xml to UWP project, edit there, and than move it back. That's work for now.
Maybe it would work with linked file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With