Keep popup within window bounds
I'm trying to display a popup under a button. This is what it looks like now : But I want it to stay within the window borders, something like this (example in paint) This is my top bar with the popup declared at the bottom: <Grid> <Grid.RowDefinitions> <RowDefinition Height="55" /> <RowDefinition Height="35" /> </Grid.RowDefinitions> <Grid x:Name="AdminContainer" Grid.Row="0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="4*" /> <ColumnDefinition Width="10" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Border Background="Transparent"> <Viewbox StretchDirection="DownOnly"