Exemple #1
0
        private Grid BuildItems(ObservableCollection <MenuViewModel> items)
        {
            ScrollViewer sv = new ScrollViewer();

            sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
            sv.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            //已经作废
            //Style st = App.Current.Resources["ScrollViewerStyle"] as Style;
            //if (st != null)
            //    sv.Style = st;


            SMT.SAAS.Platform.Controls.CWrapPanel.WrapPanel wp = new Controls.CWrapPanel.WrapPanel();
            foreach (var item in items)
            {
                ShortCut shortcut = new ShortCut();
                shortcut.Margin             = new Thickness(10);
                shortcut.Titel              = item.MenuName;
                shortcut.tbTitel.Foreground = new SolidColorBrush(Color.FromArgb(255, 17, 17, 17));
                shortcut.Icon        = item.MenuIconPath;
                shortcut.DataContext = item;

                shortcut.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonDown);
                shortcut.MouseMove           += new System.Windows.Input.MouseEventHandler(ShortCut_MouseMove);
                shortcut.MouseLeftButtonUp   += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonUp);

                wp.Children.Add(shortcut);
            }
            sv.Content = wp;
            Grid grid = new Grid();

            grid.Children.Add(sv);
            return(grid);
        }
Exemple #2
0
        public Grid LoadAll()
        {
            var items = _menuViewModel.GetChildMenu("");

            SMT.SAAS.Platform.Controls.CWrapPanel.WrapPanel wp = new Controls.CWrapPanel.WrapPanel();
            foreach (var item in items)
            {
                ShortCut shortcut = new ShortCut();
                shortcut.Margin             = new Thickness(10);
                shortcut.tbTitel.Foreground = new SolidColorBrush(Color.FromArgb(255, 17, 17, 17));
                shortcut.Titel       = item.MenuName;
                shortcut.Icon        = item.MenuIconPath;
                shortcut.DataContext = item;

                shortcut.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonDown);
                shortcut.MouseMove           += new System.Windows.Input.MouseEventHandler(ShortCut_MouseMove);
                shortcut.MouseLeftButtonUp   += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonUp);

                wp.Children.Add(shortcut);
            }

            Grid grid = new Grid();

            grid.Children.Add(wp);
            return(grid);
        }
Exemple #3
0
        private Grid BuildMenus(List <V_UserMenuPermission> items)
        {
            ScrollViewer sv = new ScrollViewer();

            sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
            sv.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            SMT.SAAS.Platform.Controls.CWrapPanel.WrapPanel wp = new Controls.CWrapPanel.WrapPanel();
            foreach (var item in items)
            {
                ShortCut shortcut = new ShortCut();
                shortcut.Margin             = new Thickness(10);
                shortcut.Titel              = item.MENUNAME;
                shortcut.tbTitel.Foreground = new SolidColorBrush(Color.FromArgb(255, 17, 17, 17));
                shortcut.Icon        = item.MENUICONPATH;
                shortcut.DataContext = item;

                shortcut.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonDown);
                shortcut.MouseMove           += new System.Windows.Input.MouseEventHandler(ShortCut_MouseMove);
                shortcut.MouseLeftButtonUp   += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonUp);

                wp.Children.Add(shortcut);
            }
            sv.Content = wp;
            Grid grid = new Grid();

            grid.Children.Add(sv);
            return(grid);
        }
Exemple #4
0
        private void Menu48Icon_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            ShortCut s = sender as ShortCut;

            if (s != null)
            {
                MenuViewModel datecontext = s.DataContext as MenuViewModel;
                if (ShortCutClick != null)
                {
                    ShortCutClick(this, new OnShortCutClickEventArgs(datecontext, null));
                }
            }
        }
Exemple #5
0
        private static void OnIconPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ShortCut item      = d as ShortCut;
            string   uriString = string.Empty;

            if (e.NewValue != null)
            {
                uriString = e.NewValue.ToString();
            }
            if (string.IsNullOrEmpty(uriString))
            {
                uriString = "/Images/icons/Comicon.png";
            }

            var source = new BitmapImage(new Uri(uriString, UriKind.Relative));

            item.imIoc.Source = source;
        }
Exemple #6
0
        private static void OnTitelPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ShortCut item = d as ShortCut;

            item.tbTitel.Text = e.NewValue.ToString();
        }
        public Grid LoadAll()
        {
            var items = _menuViewModel.GetChildMenu("");
            SMT.SAAS.Platform.Controls.CWrapPanel.WrapPanel wp = new Controls.CWrapPanel.WrapPanel();
            foreach (var item in items)
            {
                ShortCut shortcut = new ShortCut();
                shortcut.Margin = new Thickness(10);
                shortcut.tbTitel.Foreground = new SolidColorBrush(Color.FromArgb(255,17,17,17));
                shortcut.Titel = item.MenuName;
                shortcut.Icon = item.MenuIconPath;
                shortcut.DataContext = item;

                shortcut.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonDown);
                shortcut.MouseMove += new System.Windows.Input.MouseEventHandler(ShortCut_MouseMove);
                shortcut.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonUp);

                wp.Children.Add(shortcut);
            }

            Grid grid = new Grid();
            grid.Children.Add(wp);
            return grid;
        }
        private Grid BuildItems(ObservableCollection<MenuViewModel> items)
        {
            ScrollViewer sv = new ScrollViewer();
            sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
            sv.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            //已经作废
            //Style st = App.Current.Resources["ScrollViewerStyle"] as Style;
            //if (st != null)
            //    sv.Style = st;


            SMT.SAAS.Platform.Controls.CWrapPanel.WrapPanel wp = new Controls.CWrapPanel.WrapPanel();
            foreach (var item in items)
            {
                ShortCut shortcut = new ShortCut();
                shortcut.Margin = new Thickness(10);
                shortcut.Titel = item.MenuName;
                shortcut.tbTitel.Foreground = new SolidColorBrush(Color.FromArgb(255, 17, 17, 17));
                shortcut.Icon = item.MenuIconPath;
                shortcut.DataContext = item;

                shortcut.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonDown);
                shortcut.MouseMove += new System.Windows.Input.MouseEventHandler(ShortCut_MouseMove);
                shortcut.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonUp);

                wp.Children.Add(shortcut);
            }
            sv.Content=wp;
            Grid grid = new Grid();
            grid.Children.Add(sv);
            return grid;
        }
Exemple #9
0
        private Grid BuildMenus(List<V_UserMenuPermission> items)
        {
            ScrollViewer sv = new ScrollViewer();
            sv.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
            sv.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            SMT.SAAS.Platform.Controls.CWrapPanel.WrapPanel wp = new Controls.CWrapPanel.WrapPanel();
            foreach (var item in items)
            {
                ShortCut shortcut = new ShortCut();
                shortcut.Margin = new Thickness(10);
                shortcut.Titel = item.MENUNAME;
                shortcut.tbTitel.Foreground = new SolidColorBrush(Color.FromArgb(255, 17, 17, 17));
                shortcut.Icon = item.MENUICONPATH;
                shortcut.DataContext = item;

                shortcut.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonDown);
                shortcut.MouseMove += new System.Windows.Input.MouseEventHandler(ShortCut_MouseMove);
                shortcut.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(Menu48Icon_MouseLeftButtonUp);

                wp.Children.Add(shortcut);
            }
            sv.Content = wp;
            Grid grid = new Grid();
            grid.Children.Add(sv);
            return grid;
        }