コード例 #1
0
 public Principal()
 {
     this.DataContext = new PrincipalViewModel();
     InitializeComponent();
     
     var item = new CloseableTabItem() { Content = new BoasVindas() };
     item.SetHeader(new TextBlock() { Text = "Bem-vindo! " });
     TabbedPanel.Items.Add(item);
     TabbedPanel.SelectedIndex = TabbedPanel.Items.Count - 1;
 }
コード例 #2
0
        private void MenuItem_Click_1(object sender, RoutedEventArgs e)
        {
            foreach (var child in TabbedPanel.Items)
            {
                var tab = child as CloseableTabItem;

                if (tab != null)
                    if (string.Equals(tab.Name, "Cadastros"))
                    {
                        TabbedPanel.SelectedItem = tab;
                        return;
                    }
            }
            var item = new CloseableTabItem() { Content = new SeletorCadastros(), Name = "Cadastros" };
            item.SetHeader(new TextBlock() { Text = "Cadastros " });
            TabbedPanel.Items.Add(item);
            TabbedPanel.SelectedIndex = TabbedPanel.Items.Count - 1;
        }