diff --git a/samples/IntegrationTestApp/App.axaml b/samples/IntegrationTestApp/App.axaml deleted file mode 100644 index a833e096dfe..00000000000 --- a/samples/IntegrationTestApp/App.axaml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/IntegrationTestApp/App.axaml.cs b/samples/IntegrationTestApp/App.axaml.cs deleted file mode 100644 index 022931366d3..00000000000 --- a/samples/IntegrationTestApp/App.axaml.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; - -namespace IntegrationTestApp -{ - public class App : Application - { - public override void Initialize() - { - AvaloniaXamlLoader.Load(this); - } - - public override void OnFrameworkInitializationCompleted() - { - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - desktop.MainWindow = new MainWindow(); - } - - base.OnFrameworkInitializationCompleted(); - } - } -} diff --git a/samples/IntegrationTestApp/IntegrationTestApp.csproj b/samples/IntegrationTestApp/IntegrationTestApp.csproj deleted file mode 100644 index 42843993572..00000000000 --- a/samples/IntegrationTestApp/IntegrationTestApp.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - WinExe - net6.0 - enable - - - - IntegrationTestApp - net.avaloniaui.avalonia.integrationtestapp - true - 1.0.0 - - - - - - - - - - - - - - - - diff --git a/samples/IntegrationTestApp/MacOSIntegration.cs b/samples/IntegrationTestApp/MacOSIntegration.cs deleted file mode 100644 index f700a5b4e26..00000000000 --- a/samples/IntegrationTestApp/MacOSIntegration.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Avalonia.Controls; - -namespace IntegrationTestApp -{ - public static class MacOSIntegration - { - [DllImport("/usr/lib/libobjc.dylib", EntryPoint = "sel_registerName")] - private static extern IntPtr GetHandle(string name); - - [DllImport("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")] - private static extern long Int64_objc_msgSend(IntPtr receiver, IntPtr selector); - - private static readonly IntPtr s_orderedIndexSelector; - - static MacOSIntegration() - { - s_orderedIndexSelector = GetHandle("orderedIndex");; - } - - public static long GetOrderedIndex(Window window) - { - return Int64_objc_msgSend(window.PlatformImpl!.Handle.Handle, s_orderedIndexSelector); - } - } -} diff --git a/samples/IntegrationTestApp/MainWindow.axaml b/samples/IntegrationTestApp/MainWindow.axaml deleted file mode 100644 index 80317369530..00000000000 --- a/samples/IntegrationTestApp/MainWindow.axaml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - WindowState: - - - - - - - TextBlockWithName - - TextBlockWithNameAndAutomationId - - Label for TextBox - - Foo - - - - - - - - - - - - - - - - Unchecked - Checked - ThreeState - - - - - - - Item 0 - Item 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - None - - - - - - - - - - - NonOwned - Owned - Modal - - - Manual - CenterScreen - CenterOwner - - - Normal - Minimized - Maximized - FullScreen - - - - - - - - - - - diff --git a/samples/IntegrationTestApp/MainWindow.axaml.cs b/samples/IntegrationTestApp/MainWindow.axaml.cs deleted file mode 100644 index 2b160fce963..00000000000 --- a/samples/IntegrationTestApp/MainWindow.axaml.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Avalonia; -using Avalonia.Automation; -using Avalonia.Controls; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Interactivity; -using Avalonia.Markup.Xaml; -using Avalonia.VisualTree; -using Microsoft.CodeAnalysis; - -namespace IntegrationTestApp -{ - public class MainWindow : Window - { - public MainWindow() - { - InitializeComponent(); - InitializeViewMenu(); - this.AttachDevTools(); - AddHandler(Button.ClickEvent, OnButtonClick); - ListBoxItems = Enumerable.Range(0, 100).Select(x => "Item " + x).ToList(); - DataContext = this; - } - - public List ListBoxItems { get; } - - private void InitializeComponent() - { - AvaloniaXamlLoader.Load(this); - } - - private void InitializeViewMenu() - { - var mainTabs = this.FindControl("MainTabs"); - var viewMenu = (NativeMenuItem)NativeMenu.GetMenu(this).Items[1]; - - foreach (TabItem tabItem in mainTabs.Items) - { - var menuItem = new NativeMenuItem - { - Header = (string)tabItem.Header!, - IsChecked = tabItem.IsSelected, - ToggleType = NativeMenuItemToggleType.Radio, - }; - - menuItem.Click += (s, e) => tabItem.IsSelected = true; - viewMenu.Menu.Items.Add(menuItem); - } - } - - private void ShowWindow() - { - var sizeTextBox = this.GetControl("ShowWindowSize"); - var modeComboBox = this.GetControl("ShowWindowMode"); - var locationComboBox = this.GetControl("ShowWindowLocation"); - var stateComboBox = this.GetControl("ShowWindowState"); - var size = !string.IsNullOrWhiteSpace(sizeTextBox.Text) ? Size.Parse(sizeTextBox.Text) : (Size?)null; - var owner = (Window)this.GetVisualRoot()!; - - var window = new ShowWindowTest - { - WindowStartupLocation = (WindowStartupLocation)locationComboBox.SelectedIndex, - }; - - if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime lifetime) - { - // Make sure the windows have unique names and AutomationIds. - var existing = lifetime.Windows.OfType().Count(); - if (existing > 0) - { - AutomationProperties.SetAutomationId(window, window.Name + (existing + 1)); - window.Title += $" {existing + 1}"; - } - } - - if (size.HasValue) - { - window.Width = size.Value.Width; - window.Height = size.Value.Height; - } - - sizeTextBox.Text = string.Empty; - window.WindowState = (WindowState)stateComboBox.SelectedIndex; - - switch (modeComboBox.SelectedIndex) - { - case 0: - window.Show(); - break; - case 1: - window.Show(owner); - break; - case 2: - window.ShowDialog(owner); - break; - } - } - - private void SendToBack() - { - var lifetime = (ClassicDesktopStyleApplicationLifetime)Application.Current!.ApplicationLifetime!; - - foreach (var window in lifetime.Windows) - { - window.Activate(); - } - } - - private void RestoreAll() - { - var lifetime = (ClassicDesktopStyleApplicationLifetime)Application.Current!.ApplicationLifetime!; - - foreach (var window in lifetime.Windows) - { - window.Show(); - if (window.WindowState == WindowState.Minimized) - window.WindowState = WindowState.Normal; - } - } - - private void MenuClicked(object? sender, RoutedEventArgs e) - { - var clickedMenuItemTextBlock = this.FindControl("ClickedMenuItem"); - clickedMenuItemTextBlock.Text = ((MenuItem)sender!).Header.ToString(); - } - - private void OnButtonClick(object? sender, RoutedEventArgs e) - { - var source = e.Source as Button; - - if (source?.Name == "ComboBoxSelectionClear") - this.FindControl("BasicComboBox").SelectedIndex = -1; - if (source?.Name == "ComboBoxSelectFirst") - this.FindControl("BasicComboBox").SelectedIndex = 0; - if (source?.Name == "ListBoxSelectionClear") - this.FindControl("BasicListBox").SelectedIndex = -1; - if (source?.Name == "MenuClickedMenuItemReset") - this.FindControl("ClickedMenuItem").Text = "None"; - if (source?.Name == "ShowWindow") - ShowWindow(); - if (source?.Name == "SendToBack") - SendToBack(); - if (source?.Name == "EnterFullscreen") - WindowState = WindowState.FullScreen; - if (source?.Name == "ExitFullscreen") - WindowState = WindowState.Normal; - if (source?.Name == "RestoreAll") - RestoreAll(); - } - } -} diff --git a/samples/IntegrationTestApp/Program.cs b/samples/IntegrationTestApp/Program.cs deleted file mode 100644 index c09b249cfae..00000000000 --- a/samples/IntegrationTestApp/Program.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Avalonia; -using Avalonia.Controls; -using Avalonia.Controls.ApplicationLifetimes; - -namespace IntegrationTestApp -{ - class Program - { - // Initialization code. Don't use any Avalonia, third-party APIs or any - // SynchronizationContext-reliant code before AppMain is called: things aren't initialized - // yet and stuff might break. - public static void Main(string[] args) => BuildAvaloniaApp() - .StartWithClassicDesktopLifetime(args); - - // Avalonia configuration, don't remove; also used by visual designer. - public static AppBuilder BuildAvaloniaApp() - => AppBuilder.Configure() - .UsePlatformDetect() - .LogToTrace(); - } -} diff --git a/samples/IntegrationTestApp/ShowWindowTest.axaml b/samples/IntegrationTestApp/ShowWindowTest.axaml deleted file mode 100644 index ae46c92431b..00000000000 --- a/samples/IntegrationTestApp/ShowWindowTest.axaml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - Normal - Minimized - Maximized - FullScreen - - - - - - - - diff --git a/samples/IntegrationTestApp/ShowWindowTest.axaml.cs b/samples/IntegrationTestApp/ShowWindowTest.axaml.cs deleted file mode 100644 index 43875dd9909..00000000000 --- a/samples/IntegrationTestApp/ShowWindowTest.axaml.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Avalonia; -using Avalonia.Controls; -using Avalonia.Markup.Xaml; -using Avalonia.Threading; - -namespace IntegrationTestApp -{ - public class ShowWindowTest : Window - { - private readonly DispatcherTimer? _timer; - private readonly TextBox? _orderTextBox; - - public ShowWindowTest() - { - InitializeComponent(); - DataContext = this; - PositionChanged += (s, e) => this.GetControl("Position").Text = $"{Position}"; - - if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - _orderTextBox = this.GetControl("Order"); - _timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(250) }; - _timer.Tick += TimerOnTick; - _timer.Start(); - } - } - - private void InitializeComponent() - { - AvaloniaXamlLoader.Load(this); - } - - protected override void OnOpened(EventArgs e) - { - base.OnOpened(e); - var scaling = PlatformImpl!.DesktopScaling; - this.GetControl("Position").Text = $"{Position}"; - this.GetControl("ScreenRect").Text = $"{Screens.ScreenFromVisual(this)?.WorkingArea}"; - this.GetControl("Scaling").Text = $"{scaling}"; - - if (Owner is not null) - { - var ownerRect = this.GetControl("OwnerRect"); - var owner = (Window)Owner; - ownerRect.Text = $"{owner.Position}, {PixelSize.FromSize(owner.FrameSize!.Value, scaling)}"; - } - } - - protected override void OnClosed(EventArgs e) - { - base.OnClosed(e); - _timer?.Stop(); - } - - private void TimerOnTick(object? sender, EventArgs e) - { - _orderTextBox!.Text = MacOSIntegration.GetOrderedIndex(this).ToString(); - } - } -} diff --git a/samples/IntegrationTestApp/bundle.sh b/samples/IntegrationTestApp/bundle.sh deleted file mode 100644 index 505991582e8..00000000000 --- a/samples/IntegrationTestApp/bundle.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -cd $(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) -dotnet restore -r osx-arm64 -dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-arm64 -p:_AvaloniaUseExternalMSBuild=false \ No newline at end of file diff --git a/samples/IntegrationTestApp/nuget.config b/samples/IntegrationTestApp/nuget.config deleted file mode 100644 index 6c273ab3d9b..00000000000 --- a/samples/IntegrationTestApp/nuget.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - -