Пример #1
0
        /// <summary>
        /// Runs the application.
        /// </summary>
        public void Run()
        {
            Styles.Add(new DefaultTheme());

            var loader    = new AvaloniaXamlLoader();
            var baseLight = (IStyle)loader.Load(
                new Uri("resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"));

            Styles.Add(baseLight);

            Styles.Add(new SampleTabStyle());
            DataTemplates = new DataTemplates
            {
                new FuncTreeDataTemplate <Node>(
                    x => new TextBlock {
                    Text = x.Name
                },
                    x => x.Children),
            };

            MainWindow.RootNamespace = "TestApplication";
            var wnd = MainWindow.Create();

            wnd.AttachDevTools();

            Run(wnd);
        }
Пример #2
0
        private static void Main(string[] args)
        {
            // The version of ReactiveUI currently included is for WPF and so expects a WPF
            // dispatcher. This makes sure it's initialized.
            System.Windows.Threading.Dispatcher foo = System.Windows.Threading.Dispatcher.CurrentDispatcher;
            new App();
            MainWindow.RootNamespace = "TestApplication";
            var wnd = MainWindow.Create();

            DevTools.Attach(wnd);
            Application.Current.Run(wnd);
        }