C#C
C#10mo ago
art1ord

when I minimize the popup menu window, how do I fix this?

C#
<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:vm="clr-namespace:ReCraft.ViewModels"
             xmlns:customControls="clr-namespace:ReCraft.ViewModels.CustomControls"
             x:Class="ReCraft.Views.CustomControls.UserProfileMenu"
             x:DataType="customControls:UserProfileMenuViewModel"
             Width="175" MinHeight="50">
    <Grid>
        <ToggleButton Width="175" Name="ProfileButton" IsChecked="{Binding IsMenuOpen}" Background="Transparent" BorderBrush="Transparent">
            <StackPanel Orientation="Horizontal" Spacing="10">
                <Image Source="{Binding Avatar}" Width="40" Height="40" ClipToBounds="True">
                    <Image.Clip>
                        <EllipseGeometry Center="20,20" RadiusX="20" RadiusY="20"/>
                    </Image.Clip>
                </Image>
                <TextBlock Text="{Binding Username}" VerticalAlignment="Center"/>
            </StackPanel>
        </ToggleButton>

        <Popup Width="175" PlacementTarget="{Binding #ProfileButton}" Placement="Bottom" IsOpen="{Binding IsMenuOpen}">
            <Border Background="Transparent" CornerRadius="5" Padding="10" BorderBrush="#50FFFFFF" BorderThickness="0.6">
                <StackPanel HorizontalAlignment="Center">
                    <Button Content="Профиль" Command="{Binding OpenProfileCommand}" Background="Transparent" BorderBrush="Transparent"/>
                    <Button Content="Выйти" Command="{Binding LogoutCommand}" Background="Transparent" BorderBrush="Transparent"/>
                </StackPanel>
            </Border>
        </Popup>
    </Grid>
</UserControl>
Was this page helpful?