Monday, May 6, 2013

button in Popup won't change to Normal from PointerOver(with skydrive sample)

Hello programmer


In your sample code I have added just two lines(Bold Lines) as follow,



private void OnAppBarShowPopupClicked(object sender, RoutedEventArgs e)
{
try
{

if (!DeleteConfirmPopup.IsOpen)
{
// 计算位置
Rect rect = GetElementRect((FrameworkElement)sender);

DeleteConfirmPopup.VerticalOffset = rect.Y - 150;
DeleteConfirmPopup.HorizontalOffset = (rect.X > (Window.Current.Bounds.Width / 2) ? (rect.X - 350) : (rect.X));

DeleteConfirmPopup.IsOpen = true;
DeleteConfirmBtn.Visibility = Visibility.Visible;
}

}
catch (Exception)
{
//
}
}



private void OnBugHelpButtonClicked(object sender, RoutedEventArgs e)
{
if (bottomAppbar_test.IsOpen)
{
bottomAppbar_test.IsOpen = false;

}

if (DeleteConfirmPopup.IsOpen)
{

DeleteConfirmPopup.IsOpen = false;
}
DeleteConfirmBtn.Visibility = Visibility.Collapsed;
}



by doing this way the problem is solved,


but there can be better solution for this. Please check this with your requirement and then implement.


Thanks.


Please remember to mark the replies as answers it will help others too.


No comments:

Post a Comment