Ejemplo n.º 1
0
        private void InitUncloseFile()
        {
            var files = Init.InitUncloseFile();

            foreach (var file in files)
            {
                TabItemName.Add(file.FileName);
                var item = new TabItemClose
                {
                    Header   = $"{file.FileName}",
                    Height   = 30,
                    MinWidth = 100
                };
                var content = new Grid();
                content.Margin = new Thickness(-3);
                var npage = new NewPage.NewPage(item, this);
                npage.FilePath = file.FilePath;
                npage.vm.Text  = file.FileText;
                //npage.tb.Text = file.FileText;
                var f = new Frame {
                    Content = npage
                };
                content.Children.Add(f);
                item.Content   = content;
                item.GotFocus += Item_GotFocus;
                tabcontol.Items.Add(item);
                item.Focus();
                CurrentTabItem = item;
            }
        }
Ejemplo n.º 2
0
        private void OpenNewSqlFile()
        {
            var item = new TabItemClose
            {
                Header   = $"{GetName(1)}.sql*",
                Height   = 30,
                MinWidth = 100
            };
            var content = new Grid();

            content.Margin = new Thickness(-3);
            var npage = new NewPage.NewPage(item, this);
            var f     = new Frame {
                Content = npage
            };

            content.Children.Add(f);
            item.Content   = content;
            item.GotFocus += Item_GotFocus;
            tabcontol.Items.Add(item);
            item.Focus();
            CurrentTabItem = item;
        }