зеркало из https://github.com/AvaloniaUI/Avalonia.git
38 строки
977 B
C#
38 строки
977 B
C#
using System.Collections;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.Platform;
|
|
using ControlCatalog.Pages;
|
|
|
|
namespace ControlCatalog
|
|
{
|
|
public class MainView : UserControl
|
|
{
|
|
public MainView()
|
|
{
|
|
this.InitializeComponent();
|
|
if (AvaloniaLocator.Current.GetService<IRuntimePlatform>().GetRuntimeInfo().IsDesktop)
|
|
{
|
|
IList tabItems = ((IList)this.FindControl<TabControl>("Sidebar").Items);
|
|
tabItems.Add(new TabItem()
|
|
{
|
|
Header = "Dialogs",
|
|
Content = new DialogsPage()
|
|
});
|
|
tabItems.Add(new TabItem()
|
|
{
|
|
Header = "Screens",
|
|
Content = new ScreenPage()
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
}
|
|
}
|