Пример #1
0
        private void OpenScript(string scriptName)
        {
            foreach (ClosableTab t in tabs.Items)
            {
                if (t.Title == scriptName)
                {
                    tabs.SelectedItem = t;
                    return;
                }
            }
            _tempFileCounter++;
            var fn  = System.IO.Path.Combine(Settings.Settings.Default.SettingsFolder, string.Format("script{0}.cs", _tempFileCounter));
            var scr = Settings.Settings.Default.GetScriptItem(scriptName);

            if (scr != null)
            {
                System.IO.File.WriteAllText(fn, scr.Code);

                var editor = new CodeTextEditor();
                editor.FontFamily = new FontFamily("Consolas");
                editor.FontSize   = 12;
                editor.Completion = _completion;
                editor.OpenFile(fn);
                editor.SyntaxHighlighting           = HighlightingManager.Instance.GetDefinition("C#");
                editor.TextArea.IndentationStrategy = new ICSharpCode.AvalonEdit.Indentation.CSharp.CSharpIndentationStrategy();

                var tabItem = new ClosableTab();
                tabItem.Content = editor;
                tabItem.Title   = scriptName;
                tabs.Items.Add(tabItem);
                tabs.SelectedItem   = tabItem;
                tabItem.MouseLeave += tabs_MouseLeave;
            }
        }
Пример #2
0
 public TabDataModel(UserControl ctrl)
 {
     this.contentcontrol   = ctrl;
     myClosableTab         = new ClosableTab();
     myClosableTab.Content = contentcontrol;
     myClosableTab.Title   = this.Title;
 }
Пример #3
0
 private static async Task UpdateTabContent(PluginEntry pluginEntry, ClosableTab tab, SessionEntry?entry = null)
 {
     pluginEntry.Plugin.ProgressReportStart    += tab.CreateProgressBar;
     pluginEntry.Plugin.ProgressReportUpdate   += tab.UpdateProgressBar;
     pluginEntry.Plugin.ProgressReportComplete += tab.ClearProgressBarEventHandler;
     pluginEntry.Plugin.ReadFromFileRequest    += ReadFromFileRequestHandler;
     pluginEntry.Plugin.WriteToFileRequest     += WriteToFileRequestHandler;
     try
     {
         await pluginEntry.Plugin.RestoreAsync();
     }
     catch (System.Security.SecurityException)
     {
         string message = "Password has been changed. " + pluginEntry.Name + " plugin state cannot be loaded.";
         string caption = "Plugin state load error";
         var    result  = MessageBox.Show(Application.Current.MainWindow, message, caption, MessageBoxButton.OK, MessageBoxImage.Exclamation);
     }
     tab.Content = pluginEntry.Plugin;
     tab.Title   = pluginEntry.Name;
     if (entry != null)
     {
         if (((SessionEntry)entry).isSelected)
         {
             OnUpdateSelectedTab(new UpdateSelectedTabEventArgs(((SessionEntry)entry).Positon));
         }
     }
 }
Пример #4
0
        private Dictionary <string, TabItem> tabMap = new Dictionary <string, TabItem>();       // хранилище вкладок

        /// <summary> Открытие вкладки альбома. </summary>
        public void OpenAlbumTab(CatalogAlbum album, bool focus = true)
        {
            string tabName = "" + album.Name;

            // проверяем существование вкладки
            if (tabMap.ContainsKey(tabName))
            {
                if (focus)
                {
                    Dispatcher.BeginInvoke((Action)(() => tabMap[tabName].IsSelected = true));
                }
                return;
            }

            // формируем альбомную панель
            AlbumPanel albPanel = new AlbumPanel(album.EntryList);

            albPanel.UpdatePanelContent();
            albPanel.DataContext = album;
            var targetTab = new ClosableTab(tabName, albPanel, CloseTab);

            AddTab(targetTab, tabName, focus);

            // запускаем фоновый генератор обложек для эпизодов в альбоме
            album.RunLoadEntCoversThreaded();
        }
Пример #5
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ClosableTab theTabItem = new ClosableTab();

            theTabItem.Title = "Small title";
            tabControl1.Items.Add(theTabItem);
            theTabItem.Focus();
        }
Пример #6
0
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            ClosableTab theTabItem = new ClosableTab();

            theTabItem.Title = "A much longer title for an example";
            tabControl1.Items.Add(theTabItem);
            theTabItem.Focus();
        }
Пример #7
0
        private static async Task LoadSession()
        {
            var encryptedStream = IOProxy.GetMemoryStreamFromFile(".session");

            byte[] array = new byte[1];
            try
            {
                array = await Authentification.Cryptography.DecryptMemoryStreamAsync(encryptedStream,
                                                                                     Authentification.AppPassword.Password, Authentification.AppPassword.Salt);
            }
            catch (System.Security.SecurityException)
            {
                await NewTab();

                return;
            }
            MemoryStream ms = new MemoryStream();
            await ms.WriteAsync(array, 0, array.Length);

            ms.Position = 0;
            BinaryFormatter     formatter       = new BinaryFormatter();
            List <SessionEntry> lastSessionTabs = (List <SessionEntry>)formatter.Deserialize(ms);

            if (lastSessionTabs.Count == 0)
            {
                await NewTab();

                return;
            }
            var plugins = PluginEntryCollection.Plugins;

            foreach (var entry in lastSessionTabs.ToArray())
            {
                if ((!IsSystemTab(entry.Name)) && !plugins.ContainsKey(entry.Name))
                {
                    lastSessionTabs.Remove(lastSessionTabs.Where(w => w.Equals(entry)).FirstOrDefault());
                }
            }
            Task[] loadTasks = new Task[lastSessionTabs.Count];
            for (int index = 0; index < lastSessionTabs.Count; index++)
            {
                ClosableTab tab = new ClosableTab();
                tab.PluginTabClose += CloseTab;
                MainWindowViewModel.tabs.Add(tab);
            }
            for (int ind = 0; ind < MainWindowViewModel.tabs.Count; ind++)
            {
                if (IsSystemTab(lastSessionTabs[ind].Name))
                {
                    loadTasks[ind] = LoadSystemTab(lastSessionTabs[ind], MainWindowViewModel.tabs[ind]);
                }
                else
                {
                    loadTasks[ind] = UpdateTabContent(plugins[lastSessionTabs[ind].Name], MainWindowViewModel.tabs[ind], lastSessionTabs[ind]);
                }
            }
            await Task.WhenAll(loadTasks);
        }
Пример #8
0
        private void btnAddTab_Click(object sender, RoutedEventArgs e)
        {
            ClosableTab tabclose = new ClosableTab();

            //tabclose.Header = "Teste "+DateTime.Today.Second;
            //tabclose.Title = "Paciente";
            tabclose.Content = new MainPaciente_UserControl();
            this.tabControl.Items.Add(tabclose);
            tabclose.Focus();
        }
Пример #9
0
 private void Fornecedor_Click(object sender, RoutedEventArgs e)
 {
     ClosableTab theTabItem = new ClosableTab();
     theTabItem.Title = FunGer.cFornecedor;
     var cli = new Fornecedor();
     cli.Width = theTabItem.Width;
     theTabItem.Content = cli;
     tbcPadrao.Items.Add(theTabItem);
     theTabItem.Focus();
 }
Пример #10
0
        private void btn_0000_Click(object sender, RoutedEventArgs e)
        {
            Class.Variable.check_for_tab_names.get_tab_names += Localize.PersonSd;
            Class.Variable.check_for_tab_names.get_tab_names += ",";


            ClosableTab tabItem = new ClosableTab();

            tabItem.Title = Localize.PersonSd;
            mainTab.Items.Add(tabItem);
            tabItem.Focus();
            tabItem.Content = new PersonGroup().Content;
        }
Пример #11
0
 private static void openTab()
 {
     try {
         Session.MainWindow.Dispatcher.Invoke((Action)(() => {
             ClosableTab tab = new ClosableTab();
             tab.Title = headerName;
             tab.Content = uc;
             Session.MainWindow.tabControl_tabControl.Items.Add(tab);
             tab.Focus();
         }));
     } catch (Exception) {
     }
 }
Пример #12
0
        private void btnOpenFile_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == true)
            {
                ClosableTab newTab = new ClosableTab();
                newTab.TextContent.Text = File.ReadAllText(openFileDialog.FileName);
                newTab.Title            = openFileDialog.SafeFileName;
                tabControl.Items.Add(newTab);
                tabControl.SelectedIndex = tabControl.Items.Count - 1;
            }
        }
Пример #13
0
        private void OpenOneTab(CustomMenuItem data)
        {
            //这里可以动态加载其他dll文件中的组件
            Assembly assem   = Assembly.LoadFile($"{Directory.GetCurrentDirectory()}\\{data.DllName}");
            var      onePage = assem.CreateInstance(data.ClassName);

            ClosableTab theTabItem = new ClosableTab();

            theTabItem.Content = onePage;
            theTabItem.Title   = data.Title;
            myTabControl.Items.Add(theTabItem);
            theTabItem.Focus();
        }
Пример #14
0
        private void btn_moienCodeManagement_Click_1(object sender, RoutedEventArgs e)
        {
            Class.Variable.check_for_tab_names.get_tab_names += "کدهای معین";
            Class.Variable.check_for_tab_names.get_tab_names += ",";

            ClosableTab theTabItem = new ClosableTab();

            theTabItem.Title     = "کدهای معین";
            theTabItem.Unloaded += tabItem_Unloaded;
            mainTab.Items.Add(theTabItem);
            theTabItem.Focus();

            theTabItem.Content = new AccountingKernel.Forms.MmoienCode.MoeinSearch().Content;
        }
Пример #15
0
 private static async Task AddSettingsTab(ClosableTab tab, SessionEntry?entry = null)
 {
     await Task.Factory.StartNew(() => {
         tab.Title   = "Settings";
         tab.Content = new SettingsViewModel();
         if (entry != null)
         {
             if (((SessionEntry)entry).isSelected)
             {
                 OnUpdateSelectedTab(new UpdateSelectedTabEventArgs(MainWindowViewModel.tabs.IndexOf(tab)));
             }
         }
     }, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.FromCurrentSynchronizationContext());
 }
Пример #16
0
        private void btn_manageMainContent_1_Click(object sender, RoutedEventArgs e)
        {
            //
            Class.Variable.check_for_tab_names.get_tab_names += Localize.MoeinSd;
            Class.Variable.check_for_tab_names.get_tab_names += ",";


            ClosableTab tabItem = new ClosableTab();

            tabItem.Title = Localize.MoeinSd;
            mainTab.Items.Add(tabItem);
            tabItem.Focus();
            tabItem.Content = new AccountingKernel.Forms.MmoienCode.MoeinGroup().Content;
        }
Пример #17
0
        private void btn_hesab_tafsili_Click_1(object sender, RoutedEventArgs e)
        {
            Class.Variable.check_for_tab_names.get_tab_names += "حسابهای تفصیل";
            Class.Variable.check_for_tab_names.get_tab_names += ",";

            AccountingKernel.Class.Variable.Variables.idAccountingMoien = Class.Variable.Variables.ID_for_tarife_hesabe_tafsili;

            ClosableTab tabItem = new ClosableTab();

            tabItem.Title = "حسابهای تفصیل";
            mainTab.Items.Add(tabItem);
            tabItem.Focus();
            tabItem.Content = new ManageTafsiliGroup().Content;
        }
Пример #18
0
        private void tabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ClosableTab item = tabControl.SelectedItem as ClosableTab;

            if (item == null)
            {
                return;
            }
            if (item.Content != null)
            {
                UIElement element = (item.Content as UIElement);
                selCanv = (Canvas)element;
            }
        }
Пример #19
0
        ///<summary> Открытие вкладки настроек. </summary>
        public void OpenSettingTab(object sender, EventArgs e)
        {
            string tabName = "Settings";

            if (tabMap.ContainsKey(tabName))
            {
                Dispatcher.BeginInvoke((Action)(() => tabMap[tabName].IsSelected = true));
                return;
            }

            var setPanel  = new SettingsPanel();
            var targetTab = new ClosableTab(tabName, setPanel, CloseTab);

            AddTab(targetTab, tabName);
        }
Пример #20
0
        public static async void GetSettingsTab()
        {
            ClosableTab settingsTab = isOpened("Settings");

            if (settingsTab == null)
            {
                await AddSettingsTab(GetSelectedTab());
            }
            else
            {
                await CloseTabAsync(GetSelectedTab());

                OnUpdateSelectedTab(new UpdateSelectedTabEventArgs(MainWindowViewModel.tabs.IndexOf(settingsTab)));
            }
        }
Пример #21
0
        public static async void GetPluginUI(PluginEntry sourcePlugin)
        {
            ClosableTab requestedPlugin = isOpened(sourcePlugin.Name);

            if (requestedPlugin == null)
            {
                await UpdateTabContent(sourcePlugin, GetSelectedTab());
            }
            else
            {
                await CloseTabAsync(GetSelectedTab());

                OnUpdateSelectedTab(new UpdateSelectedTabEventArgs(MainWindowViewModel.tabs.IndexOf(requestedPlugin)));
            }
        }
        public void TabClosed(ClosableTab closableTab)
        {
            switch (closableTab.Title)
            {
            case Constants.ENVIRONMENTS:
                IsTabEnvironmentsVisible  = false;
                IsTabEnvironmentsSelected = false;
                break;

            case Constants.USERS:
                IsTabUsersVisible  = false;
                IsTabUsersSelected = false;
                break;
            }
        }
Пример #23
0
        public static Task LoadSystemTab(SessionEntry entry, ClosableTab tab)
        {
            Task load = null;

            switch (entry.Name)
            {
            case "Default":
                load = AddDefaultTab(entry, tab);
                break;

            case "Settings":
                load = AddSettingsTab(tab, entry);
                break;
            }
            return(load);
        }
Пример #24
0
        ///<summary> Открытие основной вкладки каталога. </summary>
        public void OpenMainTab()
        {
            string tabName = "Main";

            if (tabMap.ContainsKey(tabName))
            {
                Dispatcher.BeginInvoke((Action)(() => tabMap[tabName].IsSelected = true));
                return;
            }

            MainPanel             = new AlbumPanel(CatEng.CatRoot.AlbumsList, true);
            MainPanel.DataContext = CatEng.CatRoot;
            var targetTab = new ClosableTab(tabName, MainPanel, CloseTab);

            AddTab(targetTab, tabName);
        }
Пример #25
0
        private static async Task DumpAndRemoveTab(ClosableTab tab)
        {
            int index = MainWindowViewModel.tabs.IndexOf(tab);

            if (index == MainWindowViewModel.tabs.Count - 2 && tab.IsSelected)
            {
                if (MainWindowViewModel.tabs.Count > 2)
                {
                    OnUpdateSelectedTab(new UpdateSelectedTabEventArgs(index - 1));
                }
            }
            if (!IsSystemTab(MainWindowViewModel.tabs[index].Title))
            {
                await((ITab)MainWindowViewModel.tabs[index].Content).DumpAsync();
            }
            MainWindowViewModel.tabs.RemoveAt(index);
        }
Пример #26
0
        private static int GetNextSelectedTabIndex(ClosableTab tab)
        {
            int newSelectedTab = 0;

            if (MainWindowViewModel.tabs.Count > 1)
            {
                if (MainWindowViewModel.tabs.IndexOf(tab) == MainWindowViewModel.tabs.Count - 1)
                {
                    newSelectedTab = MainWindowViewModel.tabs.Count - 2;
                }
                else
                {
                    newSelectedTab = MainWindowViewModel.tabs.IndexOf(tab);
                }
            }
            return(newSelectedTab);
        }
Пример #27
0
        public static void GetAuthentificationTab()
        {
            ClosableTab authTab = new ClosableTab(false)
            {
                Title = "Authentification"
            };

            if (IOProxy.Exists(".key"))
            {
                authTab.Content = new CheckPasswordView();
            }
            else
            {
                authTab.Content = new NewPasswordView();
            }
            MainWindowViewModel.tabs.Add(authTab);
        }
Пример #28
0
        private void click_user(object sender, RoutedEventArgs e)
        {
            try
            {
                Class.Variable.check_for_tab_names.get_tab_names += "تعریف کاربر";
                Class.Variable.check_for_tab_names.get_tab_names += ",";

                ClosableTab tabItem = new ClosableTab();
                tabItem.Title = "تعریف کاربر";
                mainTab.Items.Add(tabItem);
                tabItem.Focus();
                tabItem.Content = new AccountingKernel.Forms.user_personel.frm_user().Content;
            }
            catch
            {
                throw;
            }
        }
Пример #29
0
        private void click_personnel(object sender, RoutedEventArgs e)
        {
            try
            {
                Class.Variable.check_for_tab_names.get_tab_names += "پرسنل";
                Class.Variable.check_for_tab_names.get_tab_names += ",";

                ClosableTab tabItem = new ClosableTab();
                tabItem.Title = "پرسنل";
                mainTab.Items.Add(tabItem);
                tabItem.Focus();
                tabItem.Content = new PersonInfoSubmit().Content;
            }
            catch
            {
                throw;
            }
        }
Пример #30
0
        private void btn_ReturnOfSaleManagement_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Class.Variable.check_for_tab_names.get_tab_names += Localize.ReturnOfSale;
                Class.Variable.check_for_tab_names.get_tab_names += ",";

                ClosableTab tabItem = new ClosableTab();
                tabItem.Title = Localize.ReturnOfSale;
                mainTab.Items.Add(tabItem);
                tabItem.Focus();
                tabItem.Content = new AccountingKernel.Forms.Bills.ReturnOfSale.FrmReturnOfSaleManagment().Content;
            }
            catch
            {
                throw;
            }
        }
Пример #31
0
        private void btn_manageBank_00_Click_1(object sender, RoutedEventArgs e)
        {
            try
            {
                Class.Variable.check_for_tab_names.get_tab_names += "لیست تنخواه";
                Class.Variable.check_for_tab_names.get_tab_names += ",";

                ClosableTab tabItem = new ClosableTab();
                tabItem.Title = "لیست تنخواه";
                mainTab.Items.Add(tabItem);
                tabItem.Focus();
                tabItem.Content = new AccountingKernel.Forms.tankhah.frm_listTankhah().Content;
            }
            catch
            {
                throw;
            }
        }
Пример #32
0
 private void button15_Click(object sender, RoutedEventArgs e)
 {
     ClosableTab ti = new ClosableTab();
     ti.Title = "tab" + (tabControl.Items.Count + 1);
     Canvas c = new Canvas();
     c.Height = 810;
     c.Width = 1234;
     c.Background = Brushes.Gray;
     c.ClipToBounds = true;
     c.Margin = new Thickness(12, -74, 12, 12);
     ti.Content = c;
     TextBox t = new TextBox();
     t.Name = "txt";
     tabControl.Items.Add(ti);
     tabControl.SelectedIndex = tabControl.Items.Count - 1;
     canvasList.Add(c);
     selCanv = canvasList.Last();
 }
Пример #33
0
        private void BtnCreateNewVehicle_Click(object sender, RoutedEventArgs e)
        {
            VehicleInfoWindow page = new VehicleInfoWindow();

            if (CacheManager.MainTabControl == null)
            {
                throw new NotImplementedException("MainTabControl == null");
            }

            ClosableTab tabItem = new ClosableTab();
            tabItem.BackGroundColor = LookAndFeel.VehicleTabColor;
            page.SetParentTabControl(tabItem);
            tabItem.Height = LookAndFeel.TabItemHeight;
            tabItem.Title = "New Vehicle";
            tabItem.Content = page;
            CacheManager.MainTabControl.Items.Add(tabItem);

            tabItem.Focus();
        }
Пример #34
0
        private void BtnSearchTasks_Click(object sender, RoutedEventArgs e)
        {
            TasksSearchPage page = new TasksSearchPage();
            page.HorizontalAlignment = HorizontalAlignment.Stretch;
            page.VerticalAlignment = VerticalAlignment.Stretch;

            if (CacheManager.MainTabControl == null)
            {
                throw new NotImplementedException("MainTabControl == null");
            }

            ClosableTab tabItem = new ClosableTab();
            tabItem.BackGroundColor = LookAndFeel.SearchTasksColor;
            tabItem.Height = LookAndFeel.TabItemHeight;
            tabItem.Title = page.PageTitle;
            tabItem.Content = page;
            CacheManager.MainTabControl.Items.Add(tabItem);
            tabItem.Focus();
        }
Пример #35
0
        private void BtnSearchVehicles_Click(object sender, RoutedEventArgs e)
        {
            VehicleSearchPage page = new VehicleSearchPage();

            if (CacheManager.MainTabControl == null)
            {
                throw new NotImplementedException("MainTabControl == null");
            }

            ClosableTab tabItem = new ClosableTab();
            tabItem.BackGroundColor = LookAndFeel.SearchVehicleColor;
            tabItem.Height = LookAndFeel.TabItemHeight;
            tabItem.Title = page.PageTitle;
            tabItem.Content = page;
            CacheManager.MainTabControl.Items.Add(tabItem);
            tabItem.Focus();
        }
Пример #36
0
        private void BtnCreateNewCustomer_Click(object sender, RoutedEventArgs e)
        {
            CustomerInfoPage page = new CustomerInfoPage();

            if (CacheManager.MainTabControl == null)
            {
                throw new NotImplementedException("MainTabControl == null");
            }

            ClosableTab tabItem = new ClosableTab();
            tabItem.BackGroundColor = LookAndFeel.CustomerTabColor;
            page.SetParentTabControl(tabItem);
            tabItem.Height = LookAndFeel.TabItemHeight;
            tabItem.Title = "New Customer";
            tabItem.Content = page;
            CacheManager.MainTabControl.Items.Add(tabItem);
            tabItem.Focus();

            //CustomerInfoPage customerInfo = new CustomerInfoPage();
            //customerInfo.Show();
        }
Пример #37
0
 private void MenuItem_Click(object sender, RoutedEventArgs e)
 {
     ClosableTab theTabItem = new ClosableTab();
     theTabItem.Title = FunGer.cUsuario;
     var cli = new UsuarioGridView();
     cli.Width = theTabItem.Width;
     theTabItem.Content = cli;
     tbcPadrao.Items.Add(theTabItem);
     theTabItem.Focus();
 }
        private void lstCustomers_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            ListViewItem item = lstCustomers.SelectedItem as ListViewItem;
            if (item == null)
                return;

            CustomerAdminObject customer = item.Content as CustomerAdminObject;
            if (customer == null)
                return;

            CustomerInfoPage customerInfo = new CustomerInfoPage(customer);

            if (CacheManager.MainTabControl == null)
            {
                throw new NotImplementedException("MainTabControl == null");
            }

            ClosableTab tabItem = new ClosableTab();
            tabItem.BackGroundColor = LookAndFeel.CustomerTabColor;
            customerInfo.SetParentTabControl(tabItem);
            tabItem.Height = LookAndFeel.TabItemHeight;
            tabItem.Title = "Customer: " + customer.LastName + ", " + customer.FirstName;
            tabItem.Content = customerInfo;
            CacheManager.MainTabControl.Items.Add(tabItem);
            tabItem.Focus();

            //CustomerInfoPage customerInfo = new CustomerInfoPage(customer);
            //customerInfo.Show();
        }
Пример #39
0
        private void lblCustomerFound_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            Dictionary<CustomerCacheSearchKey, string> searchParam = new Dictionary<CustomerCacheSearchKey, string>();
            CustomerCache cache = null;
            CustomerAdminObject customer = null;
            if (!string.IsNullOrEmpty(TxtCustomerId.Text))
            {
                searchParam.Add(CustomerCacheSearchKey.Id, TxtCustomerId.Text);
                cache = new CustomerCache(searchParam);
            }

            if (cache != null && cache.Count > 0)
            {
                customer = cache[0];
            }
            else
            {
                return;
            }

            CustomerInfoPage customerInfo = new CustomerInfoPage(customer);

            if (CacheManager.MainTabControl == null)
            {
                throw new NotImplementedException("MainTabControl == null");
            }

            ClosableTab tabItem = new ClosableTab();
            tabItem.BackGroundColor = LookAndFeel.CustomerTabColor;
            customerInfo.SetParentTabControl(tabItem);
            tabItem.Height = LookAndFeel.TabItemHeight;
            tabItem.Title = "Customer: " + customer.LastName + ", " + customer.FirstName;
            tabItem.Content = customerInfo;
            CacheManager.MainTabControl.Items.Add(tabItem);
            tabItem.Focus();
        }