Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

WPF Popup: Placement Positions
 
What effect does the placement have on a WPF popup control?
 

<Popup Name="popupFolders" IsOpen="False" MouseLeave="Popup_MouseLeave" HorizontalAlignment="Left"
 
FlowDirection="LeftToRight"
Placement="Left" >
<ListBox Name="lstFolders">

</ListBox>
</Popup>

 
WPF Popup Placement = Left

 
WPF Popup Placement = Bottom

 
WPF PopupPlacement = Relative

 
WPF PopupPlacement = RelativePoint

 
WPF Popup Placement = Right

WPF PopupPlacement = Custom

 
 
Structure of the XAML in UserControl

<UserControl
.. >
 
<Grid Name="BaseControl" MouseEnter="BaseControl_MouseEnter" MouseDown="BaseControl_MouseDown" >
<StackPanel x:Name="pnlPath" Orientation="Horizontal" >
<Image x:Name="imgFolder" Source="/wpf_Browse_Folders;component/_images/imgExpand_Right.png" VerticalAlignment="Top" />
<Label x:Name="lblPath" Content="Path" VerticalAlignment="Top" />
</StackPanel>

<Popup Name="popupFolders" IsOpen="False" MouseLeave="Popup_MouseLeave" HorizontalAlignment="Left" FlowDirection="LeftToRight"
Placement="Custom" >
<ListBox Name="lstFolders">

</ListBox>
</Popup>
 

 
 
</Grid>

</UserControl>

 
 
The popup is opened with IsOpen = true

private void BaseControl_MouseDown(object sender, MouseButtonEventArgs e)
{
//------------< StackPanel_MouseDown() >------------
if (popupFolders.IsOpen==false )
{
pnlPath.Background = new SolidColorBrush(Color.FromArgb(250, 200, 200, 200));
load_Folders();
popupFolders.IsOpen = true;
}
else
{
popupFolders.IsOpen = false ;
}
//------------</ StackPanel_MouseDown() >------------
}

 
Mobile
»
WPF Datagrid: Set Color of Row when it has no Focus
»
WPF Datagrid: Change the Color of Selected Row
»
WPF: Change Selected Row Color in DataGrid
»
WPF: Read SelectedItem from DataGrid with Dynamic As Anonymous Type
»
WPF: Elements too wide, edge Cut off
»
Solved: System.InvalidCastException HResult 0x80004002 in Select DataGrid
»
WPF: Combobox Selected Value
»
WPF Datagrid: Column is not displayed
»
WPF: Show video in preview
»
WPF Webbrowser: Suppress Java Errors or Set WebBrowser to Silent

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de