Beispiel #1
0
        // This provides a simple UI tree for testing input handling, drawing, etc
        public static Window CreateSimpleWindow()
        {
            Window window = new Window
            {
                Title = "Avalonia Test Application",
                Background = Brushes.Red,
                Content = new StackPanel
                {
                    Margin = new Thickness(30),
                    Background = Brushes.Yellow,
                    Children = new Controls
                    {
                        new TextBlock
                        {
                            Text = "TEXT BLOCK",
                            Width = 300,
                            Height = 40,
                            Background = Brushes.White,
                            Foreground = Brushes.Black
                        },

                        new Button
                        {
                            Content = "BUTTON",
                            Width = 150,
                            Height = 40,
                            Background = Brushes.LightGreen,
                            Foreground = Brushes.Black
                        }

                    }
                }
            };

            return window;
        }
Beispiel #2
0
        public static Window Create()
        {

            TabControl container;


            Window window = new Window
            {
                Title = "Avalonia Test Application",
                //Width = 900,
                //Height = 480,
                Content = (container = new TabControl
                {
                    Padding = new Thickness(5),
                    Items = new[]
                    {
                        ButtonsTab(),
                        TextTab(),
                        HtmlTab(),
                        ImagesTab(),
                        ListsTab(),
                        LayoutTab(),
                        AnimationsTab(),
                    },
                    Transition = new CrossFade(TimeSpan.FromSeconds(0.25)),
                    [Grid.RowProperty] = 1,
                    [Grid.ColumnSpanProperty] = 2,
                })

            };

            container.Classes.Add("container");
            
            window.Show();
            return window;
        }
Beispiel #3
0
        public void Run(Window window)
        {
            if (window != null)
            {
                window.Closed += (s, e) => this.Dispatcher.InvokeShutdown();
                window.Show();
            }

            if (this.MainWindow == null)
            {
                this.MainWindow = window;
            }

            Dispatcher.Run();
        }
Beispiel #4
-1
        public static void AttachDevTools(Window window)
        {
#if DEBUG
            DevTools.Attach(window);
#endif
        }