Test Shell

This commit is contained in:
TheJoKlLa 2024-02-20 23:02:47 +01:00
parent f5acf76b7b
commit a4b95106d7
50 changed files with 1527 additions and 195 deletions

258
.editorconfig Normal file
View File

@ -0,0 +1,258 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
tab_width = 4
# New line preferences
end_of_line = crlf
insert_final_newline = false
#### .NET Coding Conventions ####
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
# this. and Me. preferences
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members
# Expression-level preferences
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true
dotnet_style_explicit_tuple_names = true
dotnet_style_namespace_match_folder = true
dotnet_style_null_propagation = true
dotnet_style_object_initializer = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match
dotnet_style_prefer_compound_assignment = true
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_style_prefer_simplified_boolean_expressions = true
dotnet_style_prefer_simplified_interpolation = true
# Field preferences
dotnet_style_readonly_field = true
# Parameter preferences
dotnet_code_quality_unused_parameters = all
# Suppression preferences
dotnet_remove_unnecessary_suppression_exclusions = none
# New line preferences
dotnet_style_allow_multiple_blank_lines_experimental = true
dotnet_style_allow_statement_immediately_after_block_experimental = true
#### C# Coding Conventions ####
# var preferences
csharp_style_var_elsewhere = false
csharp_style_var_for_built_in_types = false
csharp_style_var_when_type_is_apparent = false
# Expression-bodied members
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_extended_property_pattern = true
csharp_style_prefer_not_pattern = true
csharp_style_prefer_pattern_matching = true
csharp_style_prefer_switch_expression = true
# Null-checking preferences
csharp_style_conditional_delegate_call = true
# Modifier preferences
csharp_prefer_static_local_function = true
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
csharp_style_prefer_readonly_struct = true
csharp_style_prefer_readonly_struct_member = true
# Code-block preferences
csharp_prefer_braces = true:suggestion
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = block_scoped:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_primary_constructors = false:suggestion
csharp_style_prefer_top_level_statements = false:silent
# Expression-level preferences
csharp_prefer_simple_default_expression = true
csharp_style_deconstructed_variable_declaration = true
csharp_style_implicit_object_creation_when_type_is_apparent = true
csharp_style_inlined_variable_declaration = true
csharp_style_prefer_index_operator = true
csharp_style_prefer_local_over_anonymous_function = true
csharp_style_prefer_null_check_over_type_check = true
csharp_style_prefer_range_operator = true
csharp_style_prefer_tuple_swap = true
csharp_style_prefer_utf8_string_literals = true
csharp_style_throw_expression = true
csharp_style_unused_value_assignment_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable
# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:silent
# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
csharp_style_allow_embedded_statements_on_same_line_experimental = true
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.private_method_should_be_begins_with__.severity = suggestion
dotnet_naming_rule.private_method_should_be_begins_with__.symbols = private_method
dotnet_naming_rule.private_method_should_be_begins_with__.style = begins_with__
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.private_method.applicable_kinds = method
dotnet_naming_symbols.private_method.applicable_accessibilities = private
dotnet_naming_symbols.private_method.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_naming_style.begins_with__.required_prefix = _
dotnet_naming_style.begins_with__.required_suffix =
dotnet_naming_style.begins_with__.word_separator =
dotnet_naming_style.begins_with__.capitalization = pascal_case
[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent

View File

60
Borepin.sln Normal file
View File

@ -0,0 +1,60 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34607.119
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin", "Borepin\Borepin\Borepin.csproj", "{B0BF56B3-3BBC-4FF9-AFA3-AA4454029531}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin.Android", "Borepin\Borepin.Android\Borepin.Android.csproj", "{AF4E3CCD-47EE-4766-BBB7-54DFEA6F6007}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin.Desktop", "Borepin\Borepin.Desktop\Borepin.Desktop.csproj", "{BE820710-82CF-4DBF-A0F2-39E6A53AE37A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin.iOS", "Borepin\Borepin.iOS\Borepin.iOS.csproj", "{84506727-4AF0-4AF3-8EDC-FE49A9B63A47}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin.Browser", "Borepin\Borepin.Browser\Borepin.Browser.csproj", "{1E07BDF6-DDC7-462E-BD29-77E150717455}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3F3932E7-C15A-440B-AB4A-A008CB40BD7D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0BF56B3-3BBC-4FF9-AFA3-AA4454029531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0BF56B3-3BBC-4FF9-AFA3-AA4454029531}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0BF56B3-3BBC-4FF9-AFA3-AA4454029531}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0BF56B3-3BBC-4FF9-AFA3-AA4454029531}.Release|Any CPU.Build.0 = Release|Any CPU
{AF4E3CCD-47EE-4766-BBB7-54DFEA6F6007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF4E3CCD-47EE-4766-BBB7-54DFEA6F6007}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF4E3CCD-47EE-4766-BBB7-54DFEA6F6007}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{AF4E3CCD-47EE-4766-BBB7-54DFEA6F6007}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF4E3CCD-47EE-4766-BBB7-54DFEA6F6007}.Release|Any CPU.Build.0 = Release|Any CPU
{AF4E3CCD-47EE-4766-BBB7-54DFEA6F6007}.Release|Any CPU.Deploy.0 = Release|Any CPU
{BE820710-82CF-4DBF-A0F2-39E6A53AE37A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE820710-82CF-4DBF-A0F2-39E6A53AE37A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE820710-82CF-4DBF-A0F2-39E6A53AE37A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE820710-82CF-4DBF-A0F2-39E6A53AE37A}.Release|Any CPU.Build.0 = Release|Any CPU
{84506727-4AF0-4AF3-8EDC-FE49A9B63A47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84506727-4AF0-4AF3-8EDC-FE49A9B63A47}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84506727-4AF0-4AF3-8EDC-FE49A9B63A47}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{84506727-4AF0-4AF3-8EDC-FE49A9B63A47}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84506727-4AF0-4AF3-8EDC-FE49A9B63A47}.Release|Any CPU.Build.0 = Release|Any CPU
{84506727-4AF0-4AF3-8EDC-FE49A9B63A47}.Release|Any CPU.Deploy.0 = Release|Any CPU
{1E07BDF6-DDC7-462E-BD29-77E150717455}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E07BDF6-DDC7-462E-BD29-77E150717455}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E07BDF6-DDC7-462E-BD29-77E150717455}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E07BDF6-DDC7-462E-BD29-77E150717455}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {596AB223-4EAA-4207-8BB3-651526C8CC60}
EndGlobalSection
EndGlobal

View File

@ -4,21 +4,24 @@ using Android.Content.PM;
using Avalonia;
using Avalonia.Android;
using Avalonia.ReactiveUI;
using AvaloniaInside.Shell;
namespace Borepin.Android;
[Activity(
namespace Borepin.Android
{
[Activity(
Label = "Borepin.Android",
Theme = "@style/MyTheme.NoActionBar",
Icon = "@drawable/icon",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity<App>
{
public class MainActivity : AvaloniaMainActivity<App>
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
.WithInterFont()
.UseReactiveUI();
.UseReactiveUI()
.UseShell();
}
}
}

View File

@ -4,6 +4,7 @@ using System.Threading.Tasks;
using Avalonia;
using Avalonia.Browser;
using Avalonia.ReactiveUI;
using AvaloniaInside.Shell;
using Borepin;
@ -11,10 +12,14 @@ using Borepin;
internal partial class Program
{
#pragma warning disable IDE0060 // Remove unused parameter
private static async Task Main(string[] args) => await BuildAvaloniaApp()
.WithInterFont()
.UseReactiveUI()
.UseShell()
.StartBrowserAppAsync("out");
#pragma warning restore IDE0060 // Remove unused parameter
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>();

View File

@ -2,11 +2,12 @@
using Avalonia;
using Avalonia.ReactiveUI;
using AvaloniaInside.Shell;
namespace Borepin.Desktop;
class Program
namespace Borepin.Desktop
{
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.
@ -20,5 +21,7 @@ class Program
.UsePlatformDetect()
.WithInterFont()
.LogToTrace()
.UseReactiveUI();
.UseReactiveUI()
.UseShell();
}
}

View File

@ -1,21 +1,23 @@
using Avalonia;
using Avalonia.iOS;
using Avalonia.ReactiveUI;
using Foundation;
using AvaloniaInside.Shell;
namespace Borepin.iOS;
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : AvaloniaAppDelegate<App>
namespace Borepin.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : AvaloniaAppDelegate<App>
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
.WithInterFont()
.UseReactiveUI();
.UseReactiveUI()
.UseShell();
}
}
}

View File

@ -1,9 +1,9 @@
using UIKit;
namespace Borepin.iOS;
public class Application
namespace Borepin.iOS
{
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
@ -11,4 +11,5 @@ public class Application
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
}

View File

@ -1,53 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34607.119
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin", "Borepin\Borepin.csproj", "{8471501A-C23A-44C0-9271-E9B42F4C72D2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin.Android", "Borepin.Android\Borepin.Android.csproj", "{AEE63A7F-3C2D-45ED-AD3A-77D974CF99EE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin.Desktop", "Borepin.Desktop\Borepin.Desktop.csproj", "{294083BF-101F-4264-9934-1CD3E36BB8DB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin.iOS", "Borepin.iOS\Borepin.iOS.csproj", "{ED0A4E2D-9395-40DA-8446-8F6F6F1BDAB7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Borepin.Browser", "Borepin.Browser\Borepin.Browser.csproj", "{24CD9192-40BF-4568-9791-08EC86491AC2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8471501A-C23A-44C0-9271-E9B42F4C72D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8471501A-C23A-44C0-9271-E9B42F4C72D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8471501A-C23A-44C0-9271-E9B42F4C72D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8471501A-C23A-44C0-9271-E9B42F4C72D2}.Release|Any CPU.Build.0 = Release|Any CPU
{AEE63A7F-3C2D-45ED-AD3A-77D974CF99EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEE63A7F-3C2D-45ED-AD3A-77D974CF99EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEE63A7F-3C2D-45ED-AD3A-77D974CF99EE}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{AEE63A7F-3C2D-45ED-AD3A-77D974CF99EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AEE63A7F-3C2D-45ED-AD3A-77D974CF99EE}.Release|Any CPU.Build.0 = Release|Any CPU
{AEE63A7F-3C2D-45ED-AD3A-77D974CF99EE}.Release|Any CPU.Deploy.0 = Release|Any CPU
{294083BF-101F-4264-9934-1CD3E36BB8DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{294083BF-101F-4264-9934-1CD3E36BB8DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{294083BF-101F-4264-9934-1CD3E36BB8DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{294083BF-101F-4264-9934-1CD3E36BB8DB}.Release|Any CPU.Build.0 = Release|Any CPU
{ED0A4E2D-9395-40DA-8446-8F6F6F1BDAB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED0A4E2D-9395-40DA-8446-8F6F6F1BDAB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED0A4E2D-9395-40DA-8446-8F6F6F1BDAB7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{ED0A4E2D-9395-40DA-8446-8F6F6F1BDAB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED0A4E2D-9395-40DA-8446-8F6F6F1BDAB7}.Release|Any CPU.Build.0 = Release|Any CPU
{ED0A4E2D-9395-40DA-8446-8F6F6F1BDAB7}.Release|Any CPU.Deploy.0 = Release|Any CPU
{24CD9192-40BF-4568-9791-08EC86491AC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24CD9192-40BF-4568-9791-08EC86491AC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24CD9192-40BF-4568-9791-08EC86491AC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24CD9192-40BF-4568-9791-08EC86491AC2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1804B56B-E6D9-4AED-8A8E-5FFB0502584A}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,247 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
tab_width = 4
# New line preferences
end_of_line = crlf
insert_final_newline = false
#### .NET Coding Conventions ####
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
# this. and Me. preferences
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members
# Expression-level preferences
dotnet_style_coalesce_expression = true
dotnet_style_collection_initializer = true
dotnet_style_explicit_tuple_names = true
dotnet_style_namespace_match_folder = true
dotnet_style_null_propagation = true
dotnet_style_object_initializer = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_collection_expression = when_types_loosely_match
dotnet_style_prefer_compound_assignment = true
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
dotnet_style_prefer_inferred_anonymous_type_member_names = true
dotnet_style_prefer_inferred_tuple_names = true
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_style_prefer_simplified_boolean_expressions = true
dotnet_style_prefer_simplified_interpolation = true
# Field preferences
dotnet_style_readonly_field = true
# Parameter preferences
dotnet_code_quality_unused_parameters = all
# Suppression preferences
dotnet_remove_unnecessary_suppression_exclusions = none
# New line preferences
dotnet_style_allow_multiple_blank_lines_experimental = true
dotnet_style_allow_statement_immediately_after_block_experimental = true
#### C# Coding Conventions ####
# var preferences
csharp_style_var_elsewhere = false
csharp_style_var_for_built_in_types = false
csharp_style_var_when_type_is_apparent = false
# Expression-bodied members
csharp_style_expression_bodied_accessors = true
csharp_style_expression_bodied_constructors = false
csharp_style_expression_bodied_indexers = true
csharp_style_expression_bodied_lambdas = true
csharp_style_expression_bodied_local_functions = false
csharp_style_expression_bodied_methods = false
csharp_style_expression_bodied_operators = false
csharp_style_expression_bodied_properties = true
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_extended_property_pattern = true
csharp_style_prefer_not_pattern = true
csharp_style_prefer_pattern_matching = true
csharp_style_prefer_switch_expression = true
# Null-checking preferences
csharp_style_conditional_delegate_call = true
# Modifier preferences
csharp_prefer_static_local_function = true
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
csharp_style_prefer_readonly_struct = true
csharp_style_prefer_readonly_struct_member = true
# Code-block preferences
csharp_prefer_braces = true:suggestion
csharp_prefer_simple_using_statement = true
csharp_style_namespace_declarations = block_scoped:suggestion
csharp_style_prefer_method_group_conversion = true
csharp_style_prefer_primary_constructors = true
csharp_style_prefer_top_level_statements = false
# Expression-level preferences
csharp_prefer_simple_default_expression = true
csharp_style_deconstructed_variable_declaration = true
csharp_style_implicit_object_creation_when_type_is_apparent = true
csharp_style_inlined_variable_declaration = true
csharp_style_prefer_index_operator = true
csharp_style_prefer_local_over_anonymous_function = true
csharp_style_prefer_null_check_over_type_check = true
csharp_style_prefer_range_operator = true
csharp_style_prefer_tuple_swap = true
csharp_style_prefer_utf8_string_literals = true
csharp_style_throw_expression = true
csharp_style_unused_value_assignment_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable
# 'using' directive preferences
csharp_using_directive_placement = outside_namespace
# New line preferences
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
csharp_style_allow_embedded_statements_on_same_line_experimental = true
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
dotnet_naming_rule.private_method_should_be_begins_with__.severity = suggestion
dotnet_naming_rule.private_method_should_be_begins_with__.symbols = private_method
dotnet_naming_rule.private_method_should_be_begins_with__.style = begins_with__
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.private_method.applicable_kinds = method
dotnet_naming_symbols.private_method.applicable_accessibilities = private
dotnet_naming_symbols.private_method.required_modifiers =
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_naming_style.begins_with__.required_prefix = _
dotnet_naming_style.begins_with__.required_suffix =
dotnet_naming_style.begins_with__.word_separator =
dotnet_naming_style.begins_with__.capitalization = pascal_case
# IDE0290: Use primary constructor
dotnet_diagnostic.IDE0290.severity = none

View File

@ -1,10 +1,14 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Borepin.App"
RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
xmlns:local="using:Borepin"
x:Class="Borepin.App">
<Application.DataTemplates>
<local:ViewLocator/>
</Application.DataTemplates>
<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://AvaloniaInside.Shell/Default.axaml"></StyleInclude>
<StyleInclude Source="Styles.axaml"></StyleInclude>
</Application.Styles>
</Application>

View File

@ -1,36 +1,52 @@
using Avalonia;
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Projektanker.Icons.Avalonia;
using Projektanker.Icons.Avalonia.FontAwesome;
using Borepin.ViewModels;
using Borepin.Views;
using ReactiveUI;
using Splat;
using Borepin.Pages;
namespace Borepin;
public partial class App : Application
namespace Borepin
{
public partial class App : Application
{
public override void Initialize()
{
IconProvider.Current
.Register<FontAwesomeIconProvider>();
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
Locator.CurrentMutable.Register(() => new MainView(), typeof(IViewFor<MainViewModel>));
Locator.CurrentMutable.Register(() => new MachinesPage(), typeof(IViewFor<MachinesViewModel>));
Locator.CurrentMutable.Register(() => new ProfilePage(), typeof(IViewFor<ProfilViewModel>));
Locator.CurrentMutable.Register(() => new ServersPage(), typeof(IViewFor<ServersViewModel>));
Locator.CurrentMutable.Register(() => new SettingsPage(), typeof(IViewFor<SettingViewModel>));
Locator.CurrentMutable.Register(() => new UsersPage(), typeof(IViewFor<UsersViewModel>));
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow
{
DataContext = new MainViewModel()
DataContext = Locator.Current.GetService<MainViewModel>()
};
}
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
{
singleViewPlatform.MainView = new MainView
{
DataContext = new MainViewModel()
DataContext = Locator.Current.GetService<MainViewModel>()
};
}
base.OnFrameworkInitializationCompleted();
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

View File

@ -3,14 +3,8 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.9" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.9" />
@ -18,5 +12,20 @@
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.9" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.9" />
<PackageReference Include="AvaloniaInside.Shell" Version="1.1.2" />
<PackageReference Include="Material.Avalonia" Version="3.3.0" />
<PackageReference Include="Material.Icons.Avalonia" Version="2.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Projektanker.Icons.Avalonia" Version="9.0.1" />
<PackageReference Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.0.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Assets\" />
<Folder Include="Converters\" />
<Folder Include="Helpers\" />
<Folder Include="Models\" />
<Folder Include="Themes\" />
<Folder Include="Resources\" />
</ItemGroup>
</Project>

28
Borepin/Borepin/Helper.cs Normal file
View File

@ -0,0 +1,28 @@
using Avalonia.Controls;
using Avalonia.VisualTree;
using AvaloniaInside.Shell.Platform;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Borepin
{
public static class Helper
{
#pragma warning disable IDE0060 // Remove unused parameter
public static void SetCarouselToTabControl(Carousel carousel, bool v)
{
var tabControl = carousel.FindAncestorOfType<TabControl>();
if (tabControl == null)
{
carousel.AttachedToVisualTree += delegate { SetCarouselToTabControl(carousel, true); };
return;
}
carousel.ItemsSource = tabControl.Items;
}
}
#pragma warning restore IDE0060 // Remove unused parameter
}

View File

@ -0,0 +1,82 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:views="clr-namespace:Borepin.Views"
xmlns:pages="clr-namespace:Borepin.Pages"
xmlns:viewModels="clr-namespace:Borepin.ViewModels"
x:Class="Borepin.Views.MainView"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
>
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE,
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
<viewModels:MainViewModel />
</Design.DataContext>
<ShellView Name="ShellViewMain"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
DefaultSideMenuSize="250"
DefaultRoute="/welcome"
SmallScreenSideMenuMode="Overlay"
SmallScreenSideMenuBehave="Default"
MediumScreenSideMenuMode="Inline"
MediumScreenSideMenuBehave="Default"
LargeScreenSideMenuMode="Inline"
LargeScreenSideMenuBehave="Keep"
DefaultPageTransition="{Binding CurrentTransition}">
<Route Path="welcome" Page="views:WelcomeView"></Route>
<Host Path="main" Page="pages:MainPage" Type="ReplaceRoot">
<Route Path="machines" Page="pages:MachinesPage"/>
<Route Path="users" Page="pages:UsersPage"/>
<Route Path="servers" Page="pages:ServersPage"/>
<Route Path="settings" Page="pages:SettingsPage"/>
<Route Path="profil" Page="pages:ProfilePage"/>
</Host>
<SideMenuItem Path="/main/machines" Title="Machines">
<SideMenuItem.Icon>
</SideMenuItem.Icon>
</SideMenuItem>
<SideMenuItem Path="/main/users" Title="Users">
<SideMenuItem.Icon>
</SideMenuItem.Icon>
</SideMenuItem>
<SideMenuItem Path="/main/servers" Title="Servers">
<SideMenuItem.Icon>
</SideMenuItem.Icon>
</SideMenuItem>
<ShellView.SideMenuHeader>
<TextBlock Text="FabAccess"
VerticalAlignment="Center"
HorizontalAlignment="Center">
</TextBlock>
</ShellView.SideMenuHeader>
<ShellView.SideMenuFooter>
<Border Background="#11000000" Height="15">
<TextBlock Text="Borepin Verion: ???"
FontWeight="Light"
VerticalAlignment="Center"
HorizontalAlignment="Center">
</TextBlock>
</Border>
</ShellView.SideMenuFooter>
<ShellView.SideMenuContents>
</ShellView.SideMenuContents>
</ShellView>
</UserControl>

View File

@ -0,0 +1,22 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
namespace Borepin.Views
{
public partial class MainView : UserControl
{
public static MainView Current { get; private set; }
public MainView()
{
Current = this;
InitializeComponent();
}
protected override void OnLoaded(RoutedEventArgs e)
{
Current = this;
base.OnLoaded(e);
}
}
}

View File

@ -0,0 +1,25 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="clr-namespace:Borepin.Views"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Views.MainWindow"
Title="Borepin"
Width="450">
<Panel>
<!-- <ExperimentalAcrylicBorder IsHitTestVisible="False"> -->
<!-- <ExperimentalAcrylicBorder.Material> -->
<!-- <ExperimentalAcrylicMaterial -->
<!-- BackgroundSource="Digger" -->
<!-- TintColor="Black" -->
<!-- TintOpacity="1" -->
<!-- MaterialOpacity="0.65" /> -->
<!-- </ExperimentalAcrylicBorder.Material> -->
<!-- </ExperimentalAcrylicBorder> -->
<views:MainView />
</Panel>
</Window>

View File

@ -0,0 +1,12 @@
using Avalonia.Controls;
namespace Borepin.Views
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,15 @@
<Page xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Pages.MachinesPage"
NavigationBar.Header="Machines">
<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="10">
<TextBlock Text="Machines" />
<TextBlock Text="{Binding URI}" />
</StackPanel>
</Page>

View File

@ -0,0 +1,23 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using AvaloniaInside.Shell;
using System.Threading;
using System.Threading.Tasks;
namespace Borepin.Pages
{
public partial class MachinesPage : Page
{
public MachinesPage()
{
_InitializeComponent();
}
private void _InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public static string Icon => "fa-solid fa-house";
}
}

View File

@ -0,0 +1,42 @@
<TabControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="https://github.com/projektanker/icons.avalonia"
xmlns:converters="clr-namespace:Borepin.Converters"
xmlns:views="clr-namespace:Borepin.Views"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Pages.MainPage"
TabStripPlacement="Bottom"
Classes="Center MainTab"
ShellView.EnableSafeAreaForBottom="False">
<TabControl.ItemTemplate>
<DataTemplate>
<Grid RowDefinitions="*,*" Width="70">
<i:Icon Value="{Binding Instance.Icon}"
HorizontalAlignment="Center"
Height="24"
Margin="2"/>
<TextBlock Grid.Row="1"
DataContext="{Binding Instance}"
Text="{Binding Path=(NavigationBar.Header)}"
FontSize="14"
HorizontalAlignment="Center"></TextBlock>
</Grid>
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<ContentPresenter Content="{Binding Instance}"></ContentPresenter>
</DataTemplate>
</TabControl.ContentTemplate>
<TabControl.Styles>
<Style Selector="TabControl.MainTab /template/ Border > DockPanel > Border">
<Setter Property="Padding"
Value="{Binding BottomSafePadding, RelativeSource={RelativeSource AncestorType={x:Type ShellView}}}"></Setter>
</Style>
<Style Selector="TabControl.MainTab /template/ Border > DockPanel > ItemsPresenter">
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
</TabControl.Styles>
</TabControl>

View File

@ -0,0 +1,23 @@
using System;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
namespace Borepin.Pages
{
public partial class MainPage : TabControl, IStyleable
{
public Type StyleKey => typeof(TabControl);
public MainPage()
{
_InitializeComponent();
}
private void _InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}

View File

@ -0,0 +1,10 @@
<Page xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Pages.ProfilePage"
NavigationBar.Header="Profile">
Profile
</Page>

View File

@ -0,0 +1,22 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using AvaloniaInside.Shell;
namespace Borepin.Pages
{
public partial class ProfilePage : Page
{
public ProfilePage()
{
_InitializeComponent();
}
private void _InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public static string Icon => "fa-solid fa-user";
}
}

View File

@ -0,0 +1,15 @@
<Page xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Pages.ServersPage"
NavigationBar.Header="Servers">
<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="10">
<TextBlock Text="Servers" />
<TextBlock Text="{Binding URI}" />
</StackPanel>
</Page>

View File

@ -0,0 +1,23 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using AvaloniaInside.Shell;
using System.Threading;
using System.Threading.Tasks;
namespace Borepin.Pages
{
public partial class ServersPage : Page
{
public ServersPage()
{
_InitializeComponent();
}
private void _InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public static string Icon => "fa-solid fa-house";
}
}

View File

@ -0,0 +1,10 @@
<Page xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Pages.SettingsPage"
NavigationBar.Header="Settings">
Settings
</Page>

View File

@ -0,0 +1,26 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using AvaloniaInside.Shell;
using Borepin.ViewModels;
using Borepin.Views;
using System.Threading;
using System.Threading.Tasks;
namespace Borepin.Pages
{
public partial class SettingsPage : Page
{
public SettingsPage()
{
_InitializeComponent();
}
private void _InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public static string Icon => "fa-solid fa-user";
}
}

View File

@ -0,0 +1,15 @@
<Page xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Pages.UsersPage"
NavigationBar.Header="Users">
<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="10">
<TextBlock Text="Users" />
<TextBlock Text="{Binding URI}" />
</StackPanel>
</Page>

View File

@ -0,0 +1,23 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using AvaloniaInside.Shell;
using System.Threading;
using System.Threading.Tasks;
namespace Borepin.Pages
{
public partial class UsersPage : Page
{
public UsersPage()
{
_InitializeComponent();
}
private void _InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public static string Icon => "fa-solid fa-house";
}
}

View File

@ -0,0 +1,5 @@
<linker>
<!-- Can be removed if CompiledBinding and no reflection are used -->
<assembly fullname="Borepin" preserve="All" />
<assembly fullname="Avalonia.Themes.Fluent" preserve="All" />
</linker>

View File

@ -0,0 +1,127 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Borepin">
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key='Light'>
<SolidColorBrush x:Key='HomePageBackground'>White</SolidColorBrush>
<SolidColorBrush x:Key='SubTitleForeground'>Gray</SolidColorBrush>
<SolidColorBrush x:Key='SemiAttentionForeground'>Blue</SolidColorBrush>
<LinearGradientBrush x:Key='WidgetBackground' StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Offset="0" Color="#e4efff"/>
<GradientStop Offset="1" Color="#8ca9d1"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key='ProfileBackground' StartPoint="0%,0%" EndPoint="0%,100%">
<GradientStop Offset="0" Color="#e4efff"/>
<GradientStop Offset="1" Color="#8ca9d1"/>
</LinearGradientBrush>
</ResourceDictionary>
<ResourceDictionary x:Key='Dark'>
<SolidColorBrush x:Key='HomePageBackground'>#001E39</SolidColorBrush>
<SolidColorBrush x:Key='SubTitleForeground'>Silver</SolidColorBrush>
<SolidColorBrush x:Key='SemiAttentionForeground'>LightSkyBlue</SolidColorBrush>
<LinearGradientBrush x:Key='WidgetBackground' StartPoint="0%,0%" EndPoint="100%,100%">
<GradientStop Offset="0" Color="#00357d"/>
<GradientStop Offset="1" Color="#1f3149"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key='ProfileBackground' StartPoint="0%,0%" EndPoint="0%,100%">
<GradientStop Offset="0" Color="#192535"/>
<GradientStop Offset="1" Color="#132c4d"/>
</LinearGradientBrush>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Styles.Resources>
<Design.PreviewWith>
<Border Padding="20">
<!-- Add Controls for Previewer Here -->
</Border>
</Design.PreviewWith>
<Style Selector="NavigationBar">
<!--<Setter Property="Background" Value="#44000000"></Setter>-->
</Style>
<Style Selector="TextBlock.SubTitle">
<Setter Property="Foreground" Value="{DynamicResource SubTitleForeground}" />
<Setter Property="FontWeight" Value="Thin" />
</Style>
<Style Selector="TextBlock.SemiAttention">
<Setter Property="Foreground" Value="{DynamicResource SemiAttentionForeground}" />
<Setter Property="FontWeight" Value="DemiBold" />
</Style>
<!-- <Style Selector="Image.SemiAttention"> -->
<!-- <Setter Property="Foreground" Value="Red"></Setter> -->
<!-- <Setter Property="FontWeight" Value="DemiBold"></Setter> -->
<!-- </Style> -->
<Style Selector="TabControl">
<Setter Property="Template">
<ControlTemplate>
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Background="{TemplateBinding Background}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}">
<DockPanel>
<ItemsPresenter Name="PART_ItemsPresenter"
ItemsPanel="{TemplateBinding ItemsPanel}"
DockPanel.Dock="{TemplateBinding TabStripPlacement}" />
<Carousel Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
ItemsSource="{TemplateBinding ItemsSource}"
SelectedItem="{TemplateBinding SelectedContent}"
local:Helper.CarouselToTabControl="true"
ItemTemplate="{TemplateBinding SelectedContentTemplate}"
PageTransition="{x:Static PlatformSetup.TransitionForTab}" />
</DockPanel>
</Border>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="TabControl.MainTab /template/ Border > DockPanel > Border">
<Setter Property="Background" Value="#40000000" />
</Style>
<Style Selector="TabControl.HeadTab /template/ Border > DockPanel > Border">
<Setter Property="Background" Value="#40000000" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="Padding" Value="8" />
</Style>
<Style Selector="TabControl.Center">
<Setter Property="Template">
<ControlTemplate>
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Background="{TemplateBinding Background}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}">
<DockPanel>
<Border DockPanel.Dock="{TemplateBinding TabStripPlacement}">
<ItemsPresenter Name="PART_ItemsPresenter"
ItemsPanel="{TemplateBinding ItemsPanel}"
HorizontalAlignment="Center"/>
</Border>
<Carousel Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
ItemsSource="{TemplateBinding ItemsSource}"
SelectedItem="{TemplateBinding SelectedContent}"
local:Helper.CarouselToTabControl="true"
ItemTemplate="{TemplateBinding SelectedContentTemplate}"
PageTransition="{x:Static PlatformSetup.TransitionForTab}" />
</DockPanel>
</Border>
</ControlTemplate>
</Setter>
</Style>
</Styles>

View File

@ -0,0 +1,30 @@
using System;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
namespace Borepin
{
public class ViewLocator : IDataTemplate
{
public Control? Build(object? data)
{
if (data is null)
return null;
var name = data.GetType().FullName!.Replace("ViewModel", "View");
var type = Type.GetType(name);
if (type != null)
{
return (Control)Activator.CreateInstance(type)!;
}
return new TextBlock { Text = name };
}
public bool Match(object? data)
{
return data is ViewModelBase;
}
}
}

View File

@ -0,0 +1,9 @@
using ReactiveUI;
namespace Borepin
{
public class ViewModelBase : ReactiveObject
{
}
}

View File

@ -0,0 +1,27 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
using AvaloniaInside.Shell;
using ReactiveUI;
namespace Borepin.ViewModels
{
public class MachinesViewModel : ViewModelBase
{
private readonly INavigator _navigationService;
public string URI
{
get
{
return _navigationService.CurrentUri.ToString();
}
}
public MachinesViewModel(INavigator navigationService)
{
_navigationService = navigationService;
}
}
}

View File

@ -1,6 +1,23 @@
namespace Borepin.ViewModels;
using Avalonia.Animation;
using AvaloniaInside.Shell.Platform;
using AvaloniaInside.Shell.Platform.Windows;
using ReactiveUI;
using static Borepin.ViewModels.SettingViewModel;
public class MainViewModel : ViewModelBase
namespace Borepin.ViewModels
{
public string Greeting => "Welcome to FabAccess!";
public class MainViewModel : ViewModelBase
{
public string Greeting => "Welcome to Avalonia!";
private IPageTransition _currentTransition = PlatformSetup.TransitionForPage;
public IPageTransition CurrentTransition
{
get => _currentTransition;
set
{
this.RaiseAndSetIfChanged(ref _currentTransition, value);
}
}
}
}

View File

@ -0,0 +1,26 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
using AvaloniaInside.Shell;
using ReactiveUI;
namespace Borepin.ViewModels
{
public class ProfilViewModel : ViewModelBase
{
private readonly INavigator _navigationService;
public string URI
{
get
{
return _navigationService.CurrentUri.ToString();
}
}
public ProfilViewModel(INavigator navigationService)
{
_navigationService = navigationService;
}
}
}

View File

@ -0,0 +1,26 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
using AvaloniaInside.Shell;
using ReactiveUI;
namespace Borepin.ViewModels
{
public class ServersViewModel : ViewModelBase
{
private readonly INavigator _navigationService;
public string URI
{
get
{
return _navigationService.CurrentUri.ToString();
}
}
public ServersViewModel(INavigator navigationService)
{
_navigationService = navigationService;
}
}
}

View File

@ -0,0 +1,56 @@
using Avalonia.Animation;
using Avalonia.Collections;
using AvaloniaInside.Shell.Platform;
using AvaloniaInside.Shell.Platform.Android;
using AvaloniaInside.Shell.Platform.Ios;
using AvaloniaInside.Shell.Platform.Windows;
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Borepin.ViewModels
{
public class SettingViewModel : ViewModelBase
{
public class TransitionItem
{
public string Name { get; set; }
public IPageTransition Transition { get; set; }
}
public AvaloniaList<TransitionItem> Transitions { get; }
private TransitionItem _currentTransition;
public TransitionItem CurrentTransition
{
get => _currentTransition;
set
{
this.RaiseAndSetIfChanged(ref _currentTransition, value);
if (MainViewModel != null)
MainViewModel.CurrentTransition = value.Transition;
}
}
public MainViewModel? MainViewModel { get; internal set; }
public SettingViewModel()
{
Transitions = new AvaloniaList<TransitionItem>
{
new TransitionItem{ Name = "Android Default", Transition = AndroidDefaultPageSlide.Instance },
new TransitionItem{ Name = "Android Material", Transition = MaterialListPageSlide.Instance },
new TransitionItem{ Name = "iOS", Transition = DefaultIosPageSlide.Instance },
new TransitionItem{ Name = "Windows EntranceNavigation", Transition = EntranceNavigationTransition.Instance },
new TransitionItem{ Name = "Windows DrillInNavigation", Transition = DrillInNavigationTransition.Instance },
new TransitionItem{ Name = "Windows ListSlideNavigation", Transition = ListSlideNavigationTransition.Instance },
};
CurrentTransition = Transitions.FirstOrDefault(f => f.Transition == PlatformSetup.TransitionForPage);
}
}
}

View File

@ -0,0 +1,26 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
using AvaloniaInside.Shell;
using ReactiveUI;
namespace Borepin.ViewModels
{
public class UsersViewModel : ViewModelBase
{
private readonly INavigator _navigationService;
public string URI
{
get
{
return _navigationService.CurrentUri.ToString();
}
}
public UsersViewModel(INavigator navigationService)
{
_navigationService = navigationService;
}
}
}

View File

@ -1,7 +0,0 @@
using ReactiveUI;
namespace Borepin.ViewModels;
public class ViewModelBase : ReactiveObject
{
}

View File

@ -0,0 +1,30 @@
using AvaloniaInside.Shell;
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Borepin.ViewModels
{
public class WelcomeViewModel : ViewModelBase
{
private readonly INavigator _navigationService;
public ICommand OpenCommand { get; set; }
public WelcomeViewModel(INavigator navigationService)
{
_navigationService = navigationService;
OpenCommand = ReactiveCommand.CreateFromTask(_OpenAsync);
}
private Task _OpenAsync(CancellationToken cancellationToken)
{
return _navigationService.NavigateAsync("/main", cancellationToken);
}
}
}

View File

@ -1,16 +0,0 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Borepin.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Views.MainView"
x:DataType="vm:MainViewModel">
<Design.DataContext>
<!-- This only sets the DataContext for the previewer in an IDE,
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
<vm:MainViewModel />
</Design.DataContext>
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</UserControl>

View File

@ -1,11 +0,0 @@
using Avalonia.Controls;
namespace Borepin.Views;
public partial class MainView : UserControl
{
public MainView()
{
InitializeComponent();
}
}

View File

@ -1,12 +0,0 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Borepin.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="clr-namespace:Borepin.Views"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Views.MainWindow"
Icon="/Assets/avalonia-logo.ico"
Title="Borepin">
<views:MainView />
</Window>

View File

@ -1,11 +0,0 @@
using Avalonia.Controls;
namespace Borepin.Views;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}

View File

@ -0,0 +1,14 @@
<Page xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Borepin.Views.WelcomeView"
NavigationBar.Visible="False">
<Grid>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Spacing="14">
<TextBlock Text="Welcome to AvaloniaInside" FontSize="18" HorizontalAlignment="Center"></TextBlock>
<Button Content="LOGIN!" HorizontalAlignment="Center" Margin="30" Command="{Binding OpenCommand}"></Button>
</StackPanel>
</Grid>
</Page>

View File

@ -0,0 +1,25 @@
using Avalonia.Controls;
using Avalonia.Media;
using AvaloniaInside.Shell;
using Borepin.ViewModels;
using Projektanker.Icons.Avalonia;
using Splat;
using System.Threading;
using System.Threading.Tasks;
namespace Borepin.Views
{
public partial class WelcomeView : Page
{
public WelcomeView()
{
InitializeComponent();
}
public override Task InitialiseAsync(CancellationToken cancellationToken)
{
DataContext = new ViewModels.WelcomeViewModel(Navigator);
return base.InitialiseAsync(cancellationToken);
}
}
}