Beispiel #1
0
        /// <summary>
        /// 아코디언메뉴 Show/Hiden
        /// </summary>
        /// <param name="obj"></param>
        private void MenuShowHidenAction(object obj)
        {
            Storyboard sb;

            AccordionControl accr = (AccordionControl)mainwin.FindName("accrMenu");
            Button           btn  = (Button)mainwin.FindName("btnMenuSlide");

            if (bMenuShowHiden)
            {
                sb = mainwin.FindResource("Menuin") as Storyboard;

                btn.Margin = new Thickness(0, 0, 18, 0);
                accr.CollapseAll();
                accr.RootItemExpandButtonPosition = ExpandButtonPosition.None;
                accr.ExpandItemOnHeaderClick      = false;
            }
            else
            {
                sb = mainwin.FindResource("Menuout") as Storyboard;

                btn.Margin = new Thickness(0, 0, 6, 0);
                accr.ExpandAll();
                accr.RootItemExpandButtonPosition = ExpandButtonPosition.Right;
                accr.ExpandItemOnHeaderClick      = true;
            }

            sb.Begin(mainwin);
            bMenuShowHiden = !bMenuShowHiden;
        }
Beispiel #2
0
        /// <summary>
        /// 탑메뉴 클릭시 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMenu_Click(object sender, RoutedEventArgs e)
        {
            AccordionControl accrMenu = mainwin.FindName("accrMenu") as AccordionControl;

            foreach (AccordionItem item in accrMenu.Items)
            {
                //메인윈도우에 객체를 삭제/추가한다...
                mainwin.UnregisterName(item.Name);

                foreach (AccordionItem citem in item.Items)
                {
                    item.UnregisterName(citem.Name);
                }
            }

            accrMenu.Items.Clear();

            DataRow[] drmidMENU;
            DataRow[] drsmMENU;
            drmidMENU = dtMenuList.Select("MNU_STEP = '2' AND UPPER_CD ='" + ((Button)sender).Name.Replace("MN_", "").ToString() + "'", "ORD");

            //중메뉴
            foreach (DataRow r in drmidMENU)
            {
                try
                {
                    //중메뉴 권한 필터링 (N)인경우 NO
                    if (!Logs.htPermission[r["MNU_CD"].ToString()].ToString().Equals("N"))
                    {
                        AccordionItem acctwoitem = new AccordionItem
                        {
                            Name       = "MN_" + r["MNU_CD"].ToString(),
                            Header     = r["MNU_NM"].ToString(),
                            Foreground = new SolidColorBrush(Colors.White),
                            FontSize   = 14,
                            Glyph      = new BitmapImage(new Uri("/Resources/Images/MNUImage/" + r["MNU_IMG"].ToString(), UriKind.Relative))
                        };
                        if (ThemeApply.strThemeName.Equals("GTINavyTheme"))
                        {
                            acctwoitem.Glyph = new BitmapImage(new Uri("/Resources/Navy/Images/MNUImage/" + r["MNU_IMG"].ToString(), UriKind.Relative));
                        }
                        else
                        {
                            acctwoitem.Glyph = new BitmapImage(new Uri("/Resources/Blue/Images/MNUImage/" + r["MNU_IMG"].ToString(), UriKind.Relative));
                        }
                        acctwoitem.Margin = new Thickness(3, 0, 3, 0);

                        mainwin.RegisterName(acctwoitem.Name, acctwoitem); //메인윈도우에 객체를 추가한다...
                        accrMenu.Items.Add(acctwoitem);

                        drsmMENU = null;
                        drsmMENU = dtMenuList.Select("MNU_STEP = '3' AND UPPER_CD ='" + acctwoitem.Name.Replace("MN_", "").ToString() + "'", "ORD");

                        //소메뉴
                        foreach (DataRow drthree in drsmMENU)
                        {
                            try
                            {
                                //소메뉴 권한 필터링 (N)인경우 NO
                                if (!Logs.htPermission[drthree["MNU_CD"].ToString()].ToString().Equals("N"))
                                {
                                    AccordionItem accthreeitem = new AccordionItem
                                    {
                                        Name       = "MN_" + drthree["MNU_CD"].ToString(),
                                        Header     = " ⁃ " + drthree["MNU_NM"].ToString(),
                                        FontSize   = 14,
                                        Foreground = new SolidColorBrush(Colors.White),
                                        //Background = (Brush)new BrushConverter().ConvertFrom("#195A92")
                                    };
                                    mainwin.RegisterName(accthreeitem.Name, accthreeitem);
                                    acctwoitem.Items.Add(accthreeitem);
                                }
                            }
                            catch (Exception ex)
                            {
                                Messages.ErrLog(ex);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Messages.ErrLog(ex);
                }

                //편의를 위해 확장 추후 결정
                accrMenu.ExpandAll();
            }
        }