Пример #1
0
 /// <summary>
 /// 子项选择改变
 /// </summary>
 private void Item_SelectionChanged(CascadeMenuItemBase arg1, object arg2)
 {
     // invoke & close menu
     SelectionChanged?.Invoke(arg1, arg2);
     Close();
 }
Пример #2
0
 //
 //        cascade.Items.Add(new CascadeMenuSeparator());
 //                var galleries = _viewController.GetAllGalleriesData(); // 有相册
 //                if (galleries != null && galleries.Count > 0)
 //                {
 //                    cascade.Items.Add(new CascadeMenuListViewItem()
 //        {
 //            Header = "添加到",
 //                        ItemDataTemplate = Resources["CascadeListViewItemDataTemplate"] as DataTemplate, // 是CascadeMenuSubItem , Items绑定Items
 //                        ItemsSource = new ObservableCollection<CascadeItem>()
 //                        {
 //                            new CascadeItem()
 //                            {
 //                                Icon = new Uri(resource+ "albums.png"),
 //                                Text = "已有相册",
 //                                Items = new ObservableCollection<CascadeMenuItemBase>() {new CascadeMenuListViewItem() { ItemsSource = galleries} }
 //                            }
 //                        }
 //                        //DataContext = new List<CascadeMenuListViewItem>()
 //                        //{
 //                        //    new CascadeMenuListViewItem() {ItemsSource = galleries, MaxHeight = 200, Tag = CASCADE_GALLERY}
 //                        //}
 //                    });
 //                    cascade.Items.Add(new CascadeMenuSeparator());
 //                }
 //}
 //public class CascadeItem
 //{
 //    public Uri Icon { get; set; }
 //    public string Text { get; set; }
 //    public ObservableCollection<CascadeMenuItemBase> Items { get; set; } // HERE
 //}
 /// <summary>
 /// 选择发生改变
 /// </summary>
 private void _cascadeMenu_SelectionChanged(CascadeMenuItemBase arg1, object arg2)
 {
     Debug.WriteLine(arg1);
     Debug.WriteLine(arg2);
 }
Пример #3
0
 /// <summary>
 /// 关闭某个item的子项菜单
 /// </summary>
 private void CloseItemSubMenu(CascadeMenuItemBase item)
 {
     item.CloseSubMenu();
 }
Пример #4
0
 /// <summary>
 /// invoke 选择改变事件
 /// </summary>
 protected void OnSelectionChanged(CascadeMenuItemBase item, object param)
 {
     SelectionChanged?.Invoke(item, param);
 }