placing pop up based on the mouse position(x,y)RSS Feed
Posted
by prince23
on Stack Overflow
See other posts from Stack Overflow
or by prince23
Published on 2010-05-24T05:34:22Z
Indexed on
2010/05/24
5:41 UTC
Read the original article
Hit count: 303
Silverlight
|silverlight-4.0
hi, right now i am showing pop at the botton of the screen. i need to change them according to the value(x,y) whhere i have moved the mouse here i need to get the MouseEventArgs e postion that is its x:value and y:value based on that i need to place the pop up in the screen i need to get the mouse x, y postion? is it possiable to get its value?
private void DG_LoadingRow(object sender, DataGridRowEventArgs e) { DataGridRow row = e.Row;
int index = 0;
foreach (DataGridColumn colGrid in DG.Columns)
{
if(colGrid .Header == "ID" || colGrid .Header == "Name")
{
FrameworkElement cellContent = colGrid .GetCellContent(e.Row);
DataGridCell cell = cellContent.Parent as DataGridCell;
cell.MouseEnter -= cell_MouseEnter;
cell.MouseEnter += new MouseEventHandler(cell_MouseEnter);
cell.MouseLeave -= cell_MouseLeave;
cell.MouseLeave += new MouseEventHandler(cell_MouseLeave);
}
}
}
void cell_MouseLeave(object sender, MouseEventArgs e)
{
//Hide your popup
}
void cell_MouseEnter(object sender, MouseEventArgs e)
{
**// here i need to get the mouse position that is its x,y value based on that i can place my modal pop up in that postion.
my pop is defined in xaml page here i will be assigning only its position where i need to place my modal pop up.**
//
© Stack Overflow or respective owner