Exemplo n.º 1
0
        void dib_Click(object sender, RoutedEventArgs e)
        {
            DynamicImageButton btn_Dynamic = sender as DynamicImageButton;

            if (btn_Dynamic != null)
            {
                int index = (int)btn_Dynamic.Tag;
                base.NavigationToUserPage(this.Grid_Container, GetUserControlNameFromDic(index));
            }
        }
Exemplo n.º 2
0
        private void LoadMenu()
        {
            ObservableCollection <DynamicImageButton> ButList = new ObservableCollection <DynamicImageButton>();
            List <MenuModel> Menulist = cb.GetMenuList();

            for (int i = 0; i < Menulist.Count; i++)
            {
                string             ImagePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Resources\" + Menulist[i].IconPath);
                DynamicImageButton dib       = new DynamicImageButton();
                dib.IconImageUri = ImagePath;
                dib.Tag          = Menulist[i].UserControlIndex;
                dib.Click       += new RoutedEventHandler(dib_Click);
                ButList.Add(dib);
            }
            this.lv_Menu.ItemsSource = ButList;
            Checktime.Elapsed       += new ElapsedEventHandler(Checktime_Elapsed);
            Checktime.Start();
        }
Exemplo n.º 3
0
 private void LoadMenu()
 {
     ObservableCollection<DynamicImageButton> ButList = new ObservableCollection<DynamicImageButton>();
     List<MenuModel> Menulist = cb.GetMenuList();
     for (int i = 0; i < Menulist.Count; i++)
     {
         string ImagePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Resources\" + Menulist[i].IconPath);
         DynamicImageButton dib = new DynamicImageButton();
         dib.IconImageUri = ImagePath;
         dib.Tag = Menulist[i].UserControlIndex;
         dib.Click += new RoutedEventHandler(dib_Click);
         ButList.Add(dib);
     }
     this.lv_Menu.ItemsSource = ButList;
     Checktime.Elapsed += new ElapsedEventHandler(Checktime_Elapsed);
     Checktime.Start();
 }