// 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; }
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; }
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(); }
public static void AttachDevTools(Window window) { #if DEBUG DevTools.Attach(window); #endif }