MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

PopupBox: Deleting Children while hovering over them will close the PopupBox

Open Splinti opened this issue 7 years ago • 0 comments

Hi,

I think there is an issue with the calculations on "when i hover over a popupbox". I've got a normal PopupBox like this:

<materialDesign:PopupBox StaysOpen="True" Name="popupbox_notifications" PopupMode="Click">
    <Grid Height="500" Width="500">
        <TextBlock Grid.Row="0" Margin="10">
            Notifications
        </TextBlock>
        <ScrollViewer Height="500" Width="500" Grid.Row="1">
            <StackPanel Name="stackpanel_notifications">

            </StackPanel>
        </ScrollViewer>
    </Grid>
</materialDesign:PopupBox>

I add children to stackpanel_notifications when I receive a new Notification for example. A "Notification" is a custom Usercontrol which has the following content:

<materialDesign:Card Name="card">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100*"/>
            <ColumnDefinition Width="50"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <TextBlock Name="textblock_text" Grid.Column="1" Grid.Row="0" TextWrapping="WrapWithOverflow">
                
        </TextBlock>
        <Button Margin="1" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Column="2" Grid.Row="0" Name="button_dismiss" Click="button_dismiss_Click">
            X
        </Button>
    </Grid>
</materialDesign:Card>

Basicalls it's a Text, and on the right of it is a "closing" icon. This closing button will Delete the UIElement from the popupbox. This infact will close the PopupBox, because the calculations think I have (maybe clicked?) on an element which is not a child of the PopupBox itself, correct me if I am wrong.

Furthermore, I have noticed that, if I delay that "deletion" by making an Animation, I can actually Click somewhere else in the PopupBox and it does not close.

I am unsure if this is the desired behaviour, but I would like to let you know that this happens, because I couldn't find a Issue that addresses this.

Splinti avatar Dec 23 '17 03:12 Splinti