c# - 现代用户界面 : How i can select TAB from Moderntab by code

标签 c# wpf wpf-controls modern-ui

我有一个 ModernTab 控件,我正在向其动态添加一个链接:

var link = new FirstFloor.ModernUI.Presentation.Link { DisplayName = "Otra Ventana", Source = new Uri("/pages/operations/confirm.xaml", UriKind.RelativeOrAbsolute) };

mtabs.Links.Add(link);

我想以编程方式转到或选择最后一个 TabPage ,我试过这段代码:

   //  var frame = FirstFloor.ModernUI.Windows.Navigation.NavigationHelper.FindFrame(null, this);

     //   if (frame != null)
      //      frame.Source = new Uri("/pages/operations/confirm.xaml", UriKind.Relative);

但它只能导航到没有 moderntab 的页面!!

请大家帮忙?

最佳答案

要选择链接,请使用 ModernTab 类中现有的 SelectedSouce 属性:

mtabs.SelectedSource = new Uri("pages/operations/confirm.xaml", UriKind.Relative);

关于c# - 现代用户界面 : How i can select TAB from Moderntab by code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49580483/

相关文章:

C# WPF 绑定(bind)行为

wpf DependencyProperty 不接受短默认值

WPF:在鼠标悬停在特定控件上时,增加其大小并在其他控件上重叠

wpf - WPF 中的文件 uploader

c# - Linq 日期时间差和

c# - .net Core 中所有 HttpClient 实例的默认配置

c# - C#中的gRPC客户端不适用于具有mTLS支持的Go中的gRPC服务器

c# - 我可以在标准 .Net 应用程序中使用 PCL 库吗?

wpf - 是否可以在不同的线程中初始化 WPF 用户控件?

.net - WPF 中 Calendar 和 Datepicker 控件之间的区别?