Ejemplo n.º 1
0
        public UserControl OpenNewPage(string path, string title, string tag = null)
        {
            var    v = (UserControl)AF.Reflection.Create(path);
            string errMsg;

            if (v == null)
            {
                errMsg = "Open new page of path '" + path + "' failed.";
                Utils.ErrorLog.Current.AppendLog(errMsg);
                return(v);
            }
            var tabItem = new Model.ClosableTabItem();

            tabItem.Title   = title;
            tabItem.Content = v;
            tabItem.Tag     = tag;
            tabMain.Items.Add(tabItem);
            SelectTabItem(tabItem);

            var vdc = (ViewModel.ViewModelBase)v.DataContext;

            VM.CurrentPageVM = vdc;
            _ribMgr.LoadRibbon(vdc);
            return(v);
        }
Ejemplo n.º 2
0
        public UserControl OpenNewPage(string path, string title, string tag = null)
        {
            var v = (UserControl)AF.Reflection.Create(path);
            string errMsg;
            if (v == null)
            {
                errMsg = "Open new page of path '" + path + "' failed.";
                Utils.ErrorLog.Current.AppendLog(errMsg);
                return v;
            }
            var tabItem = new Model.ClosableTabItem();
            tabItem.Title = title;
            tabItem.Content = v;
            tabItem.Tag = tag;
            tabMain.Items.Add(tabItem);
            SelectTabItem(tabItem);

            var vdc = (ViewModel.ViewModelBase)v.DataContext;
            VM.CurrentPageVM = vdc;
            _ribMgr.LoadRibbon(vdc);
            return v;
        }