diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/Browser.AvaloniaApplication.Browser.csproj b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/Browser.AvaloniaApplication.Browser.csproj deleted file mode 100644 index 974f91e..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/Browser.AvaloniaApplication.Browser.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - Exe - net8.0-browser - browser-wasm - wwwroot\main.js - ./_framework - - - - - - - - - - - - - - diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/Program.cs b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/Program.cs deleted file mode 100644 index dd9a43c..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Runtime.Versioning; -using System.Threading.Tasks; -using Avalonia; -using Avalonia.Browser; -using Avalonia.ReactiveUI; -using Browser.AvaloniaApplication; - -[assembly: SupportedOSPlatform("browser")] - -internal sealed partial class Program -{ - private static Task Main(string[] args) => - BuildAvaloniaApp().WithInterFont().UseReactiveUI().StartBrowserAppAsync("out"); - - public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure(); -} diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/Properties/launchSettings.json b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/Properties/launchSettings.json deleted file mode 100644 index b14f821..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/Properties/launchSettings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "profiles": { - "Browser.AvaloniaApplication.Browser": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:7001;http://localhost:7000", - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/debug?browser={browserInspectUri}" - } - } -} \ No newline at end of file diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/runtimeconfig.template.json b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/runtimeconfig.template.json deleted file mode 100644 index cc3f2ae..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/runtimeconfig.template.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "wasmHostProperties": { - "perHostConfig": [ - { - "name": "browser", - "html-path": "index.html", - "Host": "browser" - } - ] - } -} \ No newline at end of file diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/Logo.svg b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/Logo.svg deleted file mode 100644 index 7d28229..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/Logo.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/app.css b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/app.css deleted file mode 100644 index c34bee5..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/app.css +++ /dev/null @@ -1,74 +0,0 @@ -:root { - --sat: env(safe-area-inset-top); - --sar: env(safe-area-inset-right); - --sab: env(safe-area-inset-bottom); - --sal: env(safe-area-inset-left); -} - -/* HTML styles for the splash screen */ - -.highlight { - color: white; - font-size: 2.5rem; - display: block; -} - -.purple { - color: #8b44ac; -} - -.icon { - opacity: 0.05; - height: 35%; - width: 35%; - position: absolute; - background-repeat: no-repeat; - right: 0px; - bottom: 0px; - margin-right: 3%; - margin-bottom: 5%; - z-index: 5000; - background-position: right bottom; - pointer-events: none; -} - -#avalonia-splash a { - color: whitesmoke; - text-decoration: none; -} - -.center { - display: flex; - justify-content: center; - align-items: center; - height: 100vh; -} - -#avalonia-splash { - position: relative; - height: 100%; - width: 100%; - color: whitesmoke; - background: #1b2a4e; - font-family: 'Nunito', sans-serif; - background-position: center; - background-size: cover; - background-repeat: no-repeat; - justify-content: center; - align-items: center; -} - -.splash-close { - animation: fadeout 0.25s linear forwards; -} - -@keyframes fadeout { - 0% { - opacity: 100%; - } - - 100% { - opacity: 0; - visibility: collapse; - } -} diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/favicon.ico b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/favicon.ico deleted file mode 100644 index da8d49f..0000000 Binary files a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/favicon.ico and /dev/null differ diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/index.html b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/index.html deleted file mode 100644 index c5c3d36..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Browser.AvaloniaApplication.Browser - - - - - - - - - - -
-
-
-

- Powered by - Avalonia UI -

-
- Avalonia Logo -
-
- - - - \ No newline at end of file diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/main.js b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/main.js deleted file mode 100644 index fb71596..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Browser/wwwroot/main.js +++ /dev/null @@ -1,13 +0,0 @@ -import { dotnet } from './_framework/dotnet.js' - -const is_browser = typeof window != "undefined"; -if (!is_browser) throw new Error(`Expected to be running in a browser`); - -const dotnetRuntime = await dotnet - .withDiagnosticTracing(true) - .withApplicationArgumentsFromQuery() - .create(); - -const config = dotnetRuntime.getConfig(); - -await dotnetRuntime.runMain(config.mainAssemblyName, [window.location.search]); diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Desktop/Browser.AvaloniaApplication.Desktop.csproj b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Desktop/Browser.AvaloniaApplication.Desktop.csproj index 152e572..c6a8b47 100644 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Desktop/Browser.AvaloniaApplication.Desktop.csproj +++ b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication.Desktop/Browser.AvaloniaApplication.Desktop.csproj @@ -17,8 +17,4 @@ - - - - diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/App.axaml b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/App.axaml deleted file mode 100644 index a341f37..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/App.axaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/App.axaml.cs b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/App.axaml.cs deleted file mode 100644 index 6366d31..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/App.axaml.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; -using Browser.AvaloniaApplication.ViewModels; -using Browser.AvaloniaApplication.Views; - -namespace Browser.AvaloniaApplication; - -public partial class App : Application -{ - public override void Initialize() - { - AvaloniaXamlLoader.Load( this ); - } - - public override void OnFrameworkInitializationCompleted() - { - if ( ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop ) - { - desktop.MainWindow = new MainWindow { DataContext = new MainViewModel() }; - } - else if ( ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform ) - { - singleViewPlatform.MainView = new MainView { DataContext = new MainViewModel() }; - } - - base.OnFrameworkInitializationCompleted(); - } -} \ No newline at end of file diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/Assets/avalonia-logo.ico b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/Assets/avalonia-logo.ico deleted file mode 100644 index da8d49f..0000000 Binary files a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/Assets/avalonia-logo.ico and /dev/null differ diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/Browser.AvaloniaApplication.csproj b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/Browser.AvaloniaApplication.csproj deleted file mode 100644 index 3a98784..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/Browser.AvaloniaApplication.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - net8.0-windows10.0.19041 - enable - latest - true - - - - - - - - - - - - - - - - - - - diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/OtherTheme.cs b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/OtherTheme.cs deleted file mode 100644 index c0bf0c6..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/OtherTheme.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Avalonia.Media; -using HierarchyGrid.Definitions; - -namespace Browser.AvaloniaApplication; - -internal class OtherTheme : ITheme -{ - public ThemeColor BackgroundColor => new( 255 , 10 , 10 , 10 ); - - public ThemeColor ForegroundColor => new( 255 , 240 , 240 , 240 ); - - public ThemeColor BorderColor => ThemeColors.SlateGray; - - public ThemeColor SelectionBorderColor => ThemeColors.White; - - public float SelectionBorderThickness => 2f; - - public ThemeColor HeaderBackgroundColor => ThemeColors.LightGray; - - public ThemeColor HeaderForegroundColor => ThemeColors.Black; - - public ThemeColor HoverBackgroundColor => new( Colors.PaleGoldenrod.A, Colors.PaleGoldenrod.R, Colors.PaleGoldenrod.G, Colors.PaleGoldenrod.B ); - - public ThemeColor HoverForegroundColor => ThemeColors.Black; - - public ThemeColor HoverHeaderBackgroundColor => new( Colors.Goldenrod.A , Colors.Goldenrod.R , Colors.Goldenrod.G , Colors.Goldenrod.B ); - - public ThemeColor HoverHeaderForegroundColor => ThemeColors.White; - - public ThemeColor HighlightBackgroundColor => ThemeColors.LightBlue; - - public ThemeColor HighlightForegroundColor => ThemeColors.Black; - - public ThemeColor HighlightHeaderBackgroundColor => ThemeColors.LightBlue; - - public ThemeColor HighlightHeaderForegroundColor => ThemeColors.Black; - - public ThemeColor ReadOnlyBackgroundColor => ThemeColors.LightGray; - - public ThemeColor ReadOnlyForegroundColor => ThemeColors.DarkSlateGray; - - public ThemeColor ComputedBackgroundColor => ThemeColors.LightGray; - - public ThemeColor ComputedForegroundColor => ThemeColors.Blue; - - public ThemeColor RemarkBackgroundColor => ThemeColors.GreenYellow; - - public ThemeColor RemarkForegroundColor => ThemeColors.Black; - - public ThemeColor WarningBackgroundColor => ThemeColors.YellowGreen; - - public ThemeColor WarningForegroundColor => ThemeColors.Black; - - public ThemeColor ErrorBackgroundColor => ThemeColors.IndianRed; - - public ThemeColor ErrorForegroundColor => ThemeColors.White; - - public ThemeColor EmptyBackgroundColor => ThemeColors.LightGray; -} \ No newline at end of file diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/ViewLocator.cs b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/ViewLocator.cs deleted file mode 100644 index 93e5550..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/ViewLocator.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using Avalonia.Controls; -using Avalonia.Controls.Templates; -using Browser.AvaloniaApplication.ViewModels; - -namespace Browser.AvaloniaApplication; - -public class ViewLocator : IDataTemplate -{ - public Control? Build( object? data ) - { - if ( data is null ) - return null; - - var name = data.GetType().FullName!.Replace( "ViewModel" , "View" , StringComparison.Ordinal ); - var type = Type.GetType( name ); - - if ( type != null ) - { - return (Control) Activator.CreateInstance( type )!; - } - - return new TextBlock { Text = "Not Found: " + name }; - } - - public bool Match( object? data ) - { - return data is ViewModelBase; - } -} \ No newline at end of file diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/ViewModels/MainViewModel.cs b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/ViewModels/MainViewModel.cs deleted file mode 100644 index 3086a40..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/ViewModels/MainViewModel.cs +++ /dev/null @@ -1,130 +0,0 @@ -using HierarchyGrid.Definitions; -using ReactiveUI; -using ReactiveUI.Fody.Helpers; -using Splat; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reactive; -using System.Reactive.Linq; - -namespace Browser.AvaloniaApplication.ViewModels; - -public class MainViewModel : ViewModelBase -{ - public string Greeting => "test"; - - public HierarchyGridViewModel TestViewModel { get; } = - new HierarchyGridViewModel { SelectionMode = SelectionMode.Single }; - - public ReactiveCommand BuildTestDefinitions { get; } - - public MainViewModel() - { - TestViewModel.Theme = new OtherTheme(); - BuildTestDefinitions = ReactiveCommand.CreateRunInBackground( () => - new HierarchyDefinitions( BuildRows() , BuildColumns() ) ); - - /*BuildTestDefinitions - .Select( _=>"Grid built" ) - .ToPropertyEx( this , x => x.Greeting , initialValue: "Test message for web app" , - scheduler: RxApp.MainThreadScheduler );*/ - - - - BuildTestDefinitions - .WhereNotNull() - .Subscribe( defs => { TestViewModel.Set( defs ); } ); - } - - private IEnumerable BuildRows() - { - return Enumerable.Range( 0 , 20 ).Select( x => - { - var hpd = new ProducerDefinition { Content = x.ToString() , Producer = () => x , IsExpanded = true }; - if ( x == 0 ) - { - //hpd.ContextMenuBuilder = () => - //{ - // var mi = new MenuItem { Header = "Freeze" }; - // mi.Click += (s, a) => hpd.Freeze(!hpd.Frozen); - // return new[] { mi }; - //}; - hpd.Frozen = true; - } - else - AddChildRows( hpd , 3 ); - - return hpd; - } ); - } - - private void AddChildRows( ProducerDefinition parent , int childCount , bool addChild = true ) - { - for ( int i = 0 ; i < childCount ; i++ ) - { - var idx = i; - var node = parent.Add( new ProducerDefinition - { - Content = idx.ToString() , Producer = () => idx , - //Qualify = () => idx == 3 ? Qualification.Remark : Qualification.Normal - } ); - if ( addChild ) AddChildRows( node , 4 , false ); - } - } - - private IEnumerable BuildColumns() - { - return Enumerable.Range( 0 , 10 ).Select( a => - { - var hdef = new ConsumerDefinition - { - Content = string.Format( "Parent {0}" , a ) , - IsExpanded = a != 3 , - Consumer = o => o is int idx ? (object) ( idx * a ) : "Oops" , - Formatter = o => $"Parent: {o}" - }; - if ( a > 1 ) - foreach ( var child in Enumerable.Range( 0 , a ).Select( x => new ConsumerDefinition - { - Content = x.ToString() , - Consumer = o => o is int idx ? (object) ( idx + ( 2 * x ) ) : "Oops" , - Formatter = o => $"Res: {o}" , - Qualify = o => int.TryParse( o.ToString() , out var i ) - ? i switch - { - 4 => Qualification.Remark , - 6 => Qualification.Warning , - 9 => Qualification.Error , - 10 => Qualification.ReadOnly , - 17 => Qualification.Custom , - 18 => Qualification.Custom , - _ => Qualification.Normal - } - : Qualification.Normal , - Colorize = o => int.TryParse( o.ToString() , out var i ) - ? i switch - { - 17 => ( new ThemeColor( 150 , 100 , 120 , 0 ) , - new ThemeColor( 255 , 0 , 0 , 0 ) ) , - 18 => ( new ThemeColor( 150 , 0 , 100 , 120 ) , - new ThemeColor( 255 , 255 , 0 , 0 ) ) , - _ => ( new ThemeColor( 0 , 0 , 0 , 0 ) , new ThemeColor( 0 , 255 , 0 , 0 ) ) - } - : ( new ThemeColor( 0 , 0 , 0 , 0 ) , new ThemeColor( 0 , 0 , 0 , 0 ) ) , - Editor = ( p , c , s ) => - { - this.Log().Debug( $"{p} _ {c} _ {s}" ); - return !string.IsNullOrWhiteSpace( s ); - } - } ) ) - { - hdef.Add( child ); - } - else - hdef.Frozen = true; - - return hdef; - } ); - } -} \ No newline at end of file diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/ViewModels/ViewModelBase.cs b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/ViewModels/ViewModelBase.cs deleted file mode 100644 index 3ba5c8e..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/ViewModels/ViewModelBase.cs +++ /dev/null @@ -1,7 +0,0 @@ -using ReactiveUI; - -namespace Browser.AvaloniaApplication.ViewModels; - -public class ViewModelBase : ReactiveObject -{ -} \ No newline at end of file diff --git a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/Views/MainView.axaml b/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/Views/MainView.axaml deleted file mode 100644 index 0df6f79..0000000 --- a/src/Browser.AvaloniaApplication/Browser.AvaloniaApplication/Views/MainView.axaml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - -