Note that there are some explanatory texts on larger screens.

plurals
  1. POGet Popup new target origin when screen edge is encountered
    text
    copied!<p>I have an issue with popup placement and especially the target origin. I want to apply a Metro UI style to my combobox so there's no border between the textbox and the itemslist.</p> <p>It works well when the popup is placed at the bottom</p> <p><code>Placement="Bottom"</code></p> <p>but when it encounters the bottom edge of the screen the target origin becomes the top of the placement target.</p> <p>I'd like to know when the target origin changes to the top left corner, that way i could change the borderthickness of the control. Unfortunately the placement property is not reset to the new target origin so I'm a bit lost here.</p> <p>Here's the code of the usercontrol. The placement is set to custom here, it's the only workaround i've found to have something that suits me. But if I want metro like comboboxes I need to know where the popup really shows up...</p> <pre><code> &lt;Grid&gt; &lt;formElement:LabelBoxPC x:Name="NameFilter" LabelName="{Binding FilterLabel, ElementName=UCInlineFilterPreSelected}" TextBoxCommand="{Binding GoToEntityManagementCommand}" TextBoxValue="{Binding SearchValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"&gt; &lt;formElement:LabelBoxPC.InputBindings&gt; &lt;KeyBinding Key="F4" Command="{Binding GoToEntityManagementCommand}" /&gt; &lt;/formElement:LabelBoxPC.InputBindings&gt; &lt;/formElement:LabelBoxPC&gt; &lt;Popup x:Name="ResultsGrid" Placement="Custom" IsOpen="{Binding ElementName=NameFilter, Path=TextBoxFocus, Mode=OneWay}" AllowsTransparency="True" Focusable="False" PopupAnimation="None"&gt; &lt;StackPanel&gt; &lt;Border Padding="5px" Background="#FFF" BorderBrush="#000000" BorderThickness="2,2,2,0"&gt; &lt;Button HorizontalAlignment="Right" Style="{StaticResource SmallIconButton}" Background="{StaticResource DarkCloseIcon}"&gt;&lt;/Button&gt; &lt;/Border&gt; &lt;ListBox x:Name="Results" Width="220" Style="{StaticResource InlineFilterListBox}" Height="150" ItemsSource="{Binding Results}" SelectedItem="{Binding SelectedObject, ElementName=UCInlineFilterPreSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /&gt; &lt;/StackPanel&gt; &lt;/Popup&gt; &lt;/Grid&gt; </code></pre> <p><img src="https://i.stack.imgur.com/UEbbD.png" alt="Metro combobox"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload