public PopupMenuSamplePage() { InitializeComponent(); BitmapPool.AddBitmap("back", "Images/menu/dropbox/dropbox-menu-back.png"); BitmapPool.AddBitmap("sync", "Images/menu/dropbox/dropbox-menu-item-sync.png"); BitmapPool.AddBitmap("syncsel", "Images/menu/dropbox/dropbox-menu-item-sync-selected.png"); BitmapPool.AddBitmap("signout", "Images/menu/dropbox/dropbox-menu-item-signout.png"); BitmapPool.AddBitmap("signoutsel", "Images/menu/dropbox/dropbox-menu-item-signout-selected.png"); _mnu = new PopupMenu { MenuBackground = BitmapPool.Bmp("back") }; _mnu.ItemClicked += (x, xe) => { }; _mnu.AddMenuItem(0, 22, 9, BitmapPool.Bmp("sync"), BitmapPool.Bmp("syncsel")); _mnu.AddMenuItem(1, 0, 0, BitmapPool.Bmp("signout"), BitmapPool.Bmp("signoutsel")); this.LayoutRoot.Children.Add(_mnu); _mnu.Hide(); }
/// <summary> /// Initialize new menu /// </summary> void InitializeNewMenu() { _newmenu = new PopupMenu { MenuBackground = BitmapPool.Bmp(BMP_ID_NEW_MENU_BACK) }; _newmenu.ItemClicked += new EventHandler<PopupMenuEventArgs>(OnNewMenuItemClicked); _newmenu.AddMenuItem(MNU_ID_NEW_TEXT_MEMO, 12, 12, BMP_ID_NEW_TEXT_MEMO, BMP_ID_NEW_TEXT_MEMO_SEL); _newmenu.AddMenuItem(MNU_ID_NEW_CAMERA, 0, 0, BMP_ID_NEW_CAMERA, BMP_ID_NEW_CAMERA_SEL); _newmenu.AddMenuItem(MNU_ID_NEW_GALLERY, 0, 0, BMP_ID_NEW_GALLERY, BMP_ID_NEW_GALLERY_SEL); this.LayoutRoot.Children.Add(_newmenu); _newmenu.Hide(); }
/// <summary> /// Initialize sync menu /// </summary> void InitializeSyncMenu() { _syncmenu = new PopupMenu { MenuBackground = BitmapPool.Bmp(BMP_ID_SYNC_MENU_BACK) }; _syncmenu.ItemClicked += new EventHandler<PopupMenuEventArgs>(OnSyncMenuItemClicked); _syncmenu.AddMenuItem(MNU_ID_SYNC, 22, 9, BMP_ID_DROPBOX_SYNC, BMP_ID_DROPBOX_SYNC_SEL); _syncmenu.AddMenuItem(MNU_ID_DROPBOX_LOGOUT, 0, 0, BMP_ID_DROPBOX_SIGNOUT, BMP_ID_DROPBOX_SIGNOUT_SEL); this.LayoutRoot.Children.Add(_syncmenu); _syncmenu.Hide(); }