Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the ItemsControl elements leave when the window opens WindowState="FullScreen" #15975

Closed
waxmask opened this issue Jun 10, 2024 · 3 comments
Closed

Comments

@waxmask
Copy link

waxmask commented Jun 10, 2024

Describe the bug

Windows 10. Avalonia 11.0
I am developing a windows application, I follow the mvvm pattern as shown in the todolist instructions. I would like to place the list of items in the ItemsControl, but if I set WindowState="FullScreen" in the axaml file, my items leave.

To Reproduce

the code for my view:

             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:vm="using:RobotCarWashGUI.ViewModels"
             x:DataType="vm:MainViewModel"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="RobotCarWashGUI.Views.MainView">

    <Grid RowDefinitions="auto * auto" Margin="10">

        <StackPanel Grid.Row="2">
            <Border HorizontalAlignment="Center"
                    Background="#fff"
                    Padding="15 15 15 0"
                    CornerRadius="15 15 0 0">
                <TextBlock FontWeight="Bold" FontSize="24">Перед мойной убедитесь</TextBlock>
            </Border>

            <Border HorizontalAlignment="Center"
                    Background="#fff"
                    Padding="15 "
                    CornerRadius="15 ">
                <ItemsControl ItemsSource="{Binding Descriptions}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Margin="10"
                                       TextAlignment="Center"
                                       FontSize="24"
                                       TextWrapping="Wrap"
                                       Text="{Binding Text}">
                            </TextBlock>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Border>

            <Button Margin="0 20 0 0"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch"
                    Height="40"
                    Classes="AppButton">
                Далее
            </Button>
        </StackPanel>
    </Grid>
</UserControl>```

as well as the code of my window

<Window.Background>
    <ImageBrush Source="{Binding ApplicationBackgroundImage}" Stretch="UniformToFill"></ImageBrush>
</Window.Background>
```

Expected behavior

No response

Avalonia version

11.0.10

OS

Windows

Additional context

No response

@waxmask waxmask added the bug label Jun 10, 2024
@waxmask
Copy link
Author

waxmask commented Jun 10, 2024

image

@waxmask
Copy link
Author

waxmask commented Jun 10, 2024

image
the problem only appears if you set the HorizontalAlignment to center value for this element. Take a look at the screenshot

@timunie
Copy link
Contributor

timunie commented Jun 11, 2024

Can't reproduce with the snippets provided. Please file a very minimal sample to reproduce.

@timunie timunie removed the bug label Jun 11, 2024
@AvaloniaUI AvaloniaUI locked and limited conversation to collaborators Jun 11, 2024
@timunie timunie converted this issue into discussion #15986 Jun 11, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants