1

I know this is a generic bug but i haven't see any kind of solution towards this kind of exceptions. I know this happens when i resize or add more content on runtine and then resize. Whenever i shrink the window my app crashes and throws a generic exception. Idk if this is to much UI for MAUI to handle, it does not seem to be the problem form me. I tried a lot of different answers on different forums regarding this generic issue but no one seems to work for my particular case...

    <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiApp2.NewPage1"
             Title="NewPage1">
    <ScrollView>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="200" />
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid Grid.Row="0">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="4*"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Frame Grid.Row="0" Grid.Column="0" BorderColor="Transparent">
                        <Border Stroke="orange"
                        StrokeThickness="2"
                        Margin="20,0,0,0"
                        StrokeShape="RoundRectangle 10,10,10,10"
                        HeightRequest="100"
                        >
                         
                            <Grid>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="2*"/>
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>

                                <Grid Grid.Row="0" Grid.Column="0">
                                 
                                    <Label Text="Felicitaciones Ahorraste 200 horas con automatizaciones "
                                        TextColor="black"
                                        FontSize="25"
                                        HorizontalOptions="Start"
                                        VerticalOptions="Center"
                                        Margin="10,0,0,0"    
                                    />
                                </Grid>

                                <Image 
                                    Source="digardo.png"
                                    Grid.Row="0" Grid.Column="1"
                                    HorizontalOptions="End" VerticalOptions="Center"
                                    Aspect="Fill"
                                    
                                ></Image>
                            </Grid>
                        </Grid>
                    </Border>

                </Frame>
                <HorizontalStackLayout Grid.Row="0" Grid.Column="1">
                    <Button Text="Ir a DOT" BackgroundColor="Orange" HeightRequest="35" Margin="10,0,30,0"></Button>
                    <Button Text="Ir a DOT" BackgroundColor="Orange" HeightRequest="35"></Button>

                </HorizontalStackLayout>
            </Grid>
            <Grid Grid.Row="1" Grid.Column="0">
                <Frame Background="lightgray" Margin="70,20,70,20">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Row="0" Grid.Column="0">
                            <SearchBar BackgroundColor="White" Placeholder="Search items..." HeightRequest="20" />
                        </Grid>
                        <HorizontalStackLayout Grid.Row="0" Grid.Column="1" Margin="30,0,0,0">
                            <Button VerticalOptions="Start" Text="hola" Background="lightgray" HeightRequest="30" Command="{Binding GetTopBotsByLoSAsyncCommand}"></Button>
                        </HorizontalStackLayout>
                        
                        <Grid>
                            
                            <CollectionView ItemsSource="{Binding list}"
                             ItemsLayout="HorizontalGrid, 4">
                                <CollectionView.ItemTemplate>
                                    <DataTemplate>
                                        <Grid Padding="10">
                                    
                                            <Label Grid.Column="1"
                                               Text="{Binding .}"
                                                TextColor="Red"
                                               FontAttributes="Bold"
                                               LineBreakMode="TailTruncation" />        
                                        </Grid>
                                    </DataTemplate>
                                </CollectionView.ItemTemplate>
                            </CollectionView>
                        </Grid>
                    </Grid>
                </Frame>
            </Grid>
        </Grid>
    </ScrollView>
</ContentPage>

Error message Error message 2

  • 1
    Please download latest [.Net 8 Preview](https://dotnet.microsoft.com/en-us/download/dotnet/8.0). Create a new project. Select .Net 8 as target. Copy over just enough xaml+code to cause the problem. If you are able to cause the problem in the latest .Net 8 preview, then create a new issue at https://github.com/dotnet/maui/issues. Put the new project into a public github repo, and put link to repo in that issue. – ToolmakerSteve Aug 04 '23 at 19:24
  • 1
    @ToolmakerSteve I solved it with a temporary fix which was not using to much static heigths, width, margins and paddings by letting native controls to solve the ui "natural" size... it kind of sucks but it works now. – Francisco José Goñi Aug 09 '23 at 16:38
  • Try getting rid of the Frame maybe? Typically Frame is used to navigate to a Page, not static content. – sjb-sjb Aug 25 '23 at 10:05

0 Answers0