Skip to content

Instantly share code, notes, and snippets.

@kw0006667
Created October 20, 2012 18:07
Show Gist options
  • Save kw0006667/3924230 to your computer and use it in GitHub Desktop.
Save kw0006667/3924230 to your computer and use it in GitHub Desktop.
將點擊選單後,會將選單關閉的事件寫入
private void pageTitle_Click_1(object sender, RoutedEventArgs e)
{
// 若是第一次按,則將物件新增到 Popup 物件裡。
if (!this.isAddedToPopup)
{
this.headerMenuPopup = ShowPopup(this.pageTitle, this.headerMenuCtl);
this.headerMenuCtl.Tapped += headerMenuCtl_Tapped;
this.isAddedToPopup = true;
}
// 顯示 Popup
this.headerMenuPopup.IsOpen = true;
}
void headerMenuCtl_Tapped(object sender, TappedRoutedEventArgs e)
{
this.headerMenuPopup.IsOpen = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment