diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/.idea/.idea.MIES_System/.idea/avalonia.xml b/.idea/.idea.MIES_System/.idea/avalonia.xml new file mode 100644 index 0000000..5da4ad8 --- /dev/null +++ b/.idea/.idea.MIES_System/.idea/avalonia.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.MIES_System/.idea/deploymentTargetSelector.xml b/.idea/.idea.MIES_System/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..a43d7b0 --- /dev/null +++ b/.idea/.idea.MIES_System/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.MIES_System/.idea/workspace.xml b/.idea/.idea.MIES_System/.idea/workspace.xml new file mode 100644 index 0000000..5f3cebb --- /dev/null +++ b/.idea/.idea.MIES_System/.idea/workspace.xml @@ -0,0 +1,151 @@ + + + + + + + + + MIES_System.Android/MIES_System.Android.csproj + MIES_System.Browser/MIES_System.Browser.csproj + MIES_System.Desktop/MIES_System.Desktop.csproj + MIES_System.iOS/MIES_System.iOS.csproj + + + + + + + + + + + + + + + + + + + + + + + + { + "associatedIndex": 7 +} + + + + { + "keyToString": { + ".NET Project.MIES_System.Desktop.executor": "Debug", + "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.git.unshallow": "true", + "git-widget-placeholder": "master", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "settings.editor.selected.configurable": "preferences.pluginManager", + "vue.rearranger.settings.migration": "true" + } +} + + + + + + + + + + 1763264222612 + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..56cd882 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,22 @@ + + + + true + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MIES_System.Android/Icon.png b/MIES_System.Android/Icon.png new file mode 100644 index 0000000..3c39845 Binary files /dev/null and b/MIES_System.Android/Icon.png differ diff --git a/MIES_System.Android/MIES_System.Android.csproj b/MIES_System.Android/MIES_System.Android.csproj new file mode 100644 index 0000000..e426d23 --- /dev/null +++ b/MIES_System.Android/MIES_System.Android.csproj @@ -0,0 +1,28 @@ + + + Exe + net9.0-android + 21 + enable + com.CompanyName.MIES_System + 1 + 1.0 + apk + false + + + + + Resources\drawable\Icon.png + + + + + + + + + + + + diff --git a/MIES_System.Android/MainActivity.cs b/MIES_System.Android/MainActivity.cs new file mode 100644 index 0000000..10f34fd --- /dev/null +++ b/MIES_System.Android/MainActivity.cs @@ -0,0 +1,21 @@ +using Android.App; +using Android.Content.PM; +using Avalonia; +using Avalonia.Android; + +namespace MIES_System.Android; + +[Activity( + Label = "MIES_System.Android", + Theme = "@style/MyTheme.NoActionBar", + Icon = "@drawable/icon", + MainLauncher = true, + ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] +public class MainActivity : AvaloniaMainActivity +{ + protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) + { + return base.CustomizeAppBuilder(builder) + .WithInterFont(); + } +} \ No newline at end of file diff --git a/MIES_System.Android/Properties/AndroidManifest.xml b/MIES_System.Android/Properties/AndroidManifest.xml new file mode 100644 index 0000000..2b774d7 --- /dev/null +++ b/MIES_System.Android/Properties/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/MIES_System.Android/Resources/AboutResources.txt b/MIES_System.Android/Resources/AboutResources.txt new file mode 100644 index 0000000..c2bca97 --- /dev/null +++ b/MIES_System.Android/Resources/AboutResources.txt @@ -0,0 +1,44 @@ +Images, layout descriptions, binary blobs and string dictionaries can be included +in your application as resource files. Various Android APIs are designed to +operate on the resource IDs instead of dealing with images, strings or binary blobs +directly. + +For example, a sample Android app that contains a user interface layout (main.axml), +an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) +would keep its resources in the "Resources" directory of the application: + +Resources/ + drawable/ + icon.png + + layout/ + main.axml + + values/ + strings.xml + +In order to get the build system to recognize Android resources, set the build action to +"AndroidResource". The native Android APIs do not operate directly with filenames, but +instead operate on resource IDs. When you compile an Android application that uses resources, +the build system will package the resources for distribution and generate a class called "R" +(this is an Android convention) that contains the tokens for each one of the resources +included. For example, for the above Resources layout, this is what the R class would expose: + +public class R { + public class drawable { + public const int icon = 0x123; + } + + public class layout { + public const int main = 0x456; + } + + public class strings { + public const int first_string = 0xabc; + public const int second_string = 0xbcd; + } +} + +You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main +to reference the layout/main.axml file, or R.strings.first_string to reference the first +string in the dictionary file values/strings.xml. \ No newline at end of file diff --git a/MIES_System.Android/Resources/drawable-night-v31/avalonia_anim.xml b/MIES_System.Android/Resources/drawable-night-v31/avalonia_anim.xml new file mode 100644 index 0000000..dde4b5a --- /dev/null +++ b/MIES_System.Android/Resources/drawable-night-v31/avalonia_anim.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MIES_System.Android/Resources/drawable-v31/avalonia_anim.xml b/MIES_System.Android/Resources/drawable-v31/avalonia_anim.xml new file mode 100644 index 0000000..94f27d9 --- /dev/null +++ b/MIES_System.Android/Resources/drawable-v31/avalonia_anim.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MIES_System.Android/Resources/drawable/splash_screen.xml b/MIES_System.Android/Resources/drawable/splash_screen.xml new file mode 100644 index 0000000..2e920b4 --- /dev/null +++ b/MIES_System.Android/Resources/drawable/splash_screen.xml @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/MIES_System.Android/Resources/values-night/colors.xml b/MIES_System.Android/Resources/values-night/colors.xml new file mode 100644 index 0000000..3d47b6f --- /dev/null +++ b/MIES_System.Android/Resources/values-night/colors.xml @@ -0,0 +1,4 @@ + + + #212121 + diff --git a/MIES_System.Android/Resources/values-v31/styles.xml b/MIES_System.Android/Resources/values-v31/styles.xml new file mode 100644 index 0000000..d5ecec4 --- /dev/null +++ b/MIES_System.Android/Resources/values-v31/styles.xml @@ -0,0 +1,21 @@ + + + + + + + + diff --git a/MIES_System.Android/Resources/values/colors.xml b/MIES_System.Android/Resources/values/colors.xml new file mode 100644 index 0000000..59279d5 --- /dev/null +++ b/MIES_System.Android/Resources/values/colors.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + diff --git a/MIES_System.Android/Resources/values/styles.xml b/MIES_System.Android/Resources/values/styles.xml new file mode 100644 index 0000000..6e534de --- /dev/null +++ b/MIES_System.Android/Resources/values/styles.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/MIES_System.Desktop/MIES_System.Desktop.csproj b/MIES_System.Desktop/MIES_System.Desktop.csproj new file mode 100644 index 0000000..bb82230 --- /dev/null +++ b/MIES_System.Desktop/MIES_System.Desktop.csproj @@ -0,0 +1,27 @@ + + + WinExe + + net9.0 + enable + true + + + + app.manifest + + + + + + + None + All + + + + + + + diff --git a/MIES_System.Desktop/Program.cs b/MIES_System.Desktop/Program.cs new file mode 100644 index 0000000..efdbd97 --- /dev/null +++ b/MIES_System.Desktop/Program.cs @@ -0,0 +1,21 @@ +using System; +using Avalonia; + +namespace MIES_System.Desktop; + +sealed 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. + [STAThread] + 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() + .WithInterFont() + .LogToTrace(); +} \ No newline at end of file diff --git a/MIES_System.Desktop/app.manifest b/MIES_System.Desktop/app.manifest new file mode 100644 index 0000000..5ceba54 --- /dev/null +++ b/MIES_System.Desktop/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/MIES_System.sln b/MIES_System.sln new file mode 100644 index 0000000..ac69c0a --- /dev/null +++ b/MIES_System.sln @@ -0,0 +1,42 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32811.315 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MIES_System", "MIES_System\MIES_System.csproj", "{EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MIES_System.Desktop", "MIES_System.Desktop\MIES_System.Desktop.csproj", "{ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MIES_System.Android", "MIES_System.Android\MIES_System.Android.csproj", "{7AD1DAC8-7FBE-49D5-8614-7321233DB82E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3DA99C4E-89E3-4049-9C22-0A7EC60D83D8}" + ProjectSection(SolutionItems) = preProject + Directory.Packages.props = Directory.Packages.props + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}.Release|Any CPU.Build.0 = Release|Any CPU + {ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Release|Any CPU.Build.0 = Release|Any CPU + {7AD1DAC8-7FBE-49D5-8614-7321233DB82E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AD1DAC8-7FBE-49D5-8614-7321233DB82E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AD1DAC8-7FBE-49D5-8614-7321233DB82E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AD1DAC8-7FBE-49D5-8614-7321233DB82E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {83CB65B8-011F-4ED7-BCD3-A6CFA935EF7E} + EndGlobalSection +EndGlobal diff --git a/MIES_System.sln.DotSettings.user b/MIES_System.sln.DotSettings.user new file mode 100644 index 0000000..abb9dd7 --- /dev/null +++ b/MIES_System.sln.DotSettings.user @@ -0,0 +1,5 @@ + + ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded \ No newline at end of file diff --git a/MIES_System/App.axaml b/MIES_System/App.axaml new file mode 100644 index 0000000..ab7b7a1 --- /dev/null +++ b/MIES_System/App.axaml @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/MIES_System/App.axaml.cs b/MIES_System/App.axaml.cs new file mode 100644 index 0000000..9bf48a1 --- /dev/null +++ b/MIES_System/App.axaml.cs @@ -0,0 +1,58 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Data.Core; +using Avalonia.Data.Core.Plugins; +using System.Linq; +using Avalonia.Markup.Xaml; +using MIES_System.Services; +using MIES_System.ViewModels; +using MIES_System.Views; + +namespace MIES_System; + +public partial class App : Application +{ + public static NavigationService Navigation { get; } = new NavigationService(); + + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + // Avoid duplicate validations from both Avalonia and the CommunityToolkit. + // More info: https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins + DisableAvaloniaDataAnnotationValidation(); + desktop.MainWindow = new MainWindow + { + DataContext = new LoginViewModel() + }; + } + else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) + { + singleViewPlatform.MainView = new LoginView() + { + DataContext = new LoginViewModel() + }; + } + + base.OnFrameworkInitializationCompleted(); + } + + private void DisableAvaloniaDataAnnotationValidation() + { + // Get an array of plugins to remove + var dataValidationPluginsToRemove = + BindingPlugins.DataValidators.OfType().ToArray(); + + // remove each entry found + foreach (var plugin in dataValidationPluginsToRemove) + { + BindingPlugins.DataValidators.Remove(plugin); + } + } + +} \ No newline at end of file diff --git a/MIES_System/Assets/avalonia-logo.ico b/MIES_System/Assets/avalonia-logo.ico new file mode 100644 index 0000000..f7da8bb Binary files /dev/null and b/MIES_System/Assets/avalonia-logo.ico differ diff --git a/MIES_System/MIES_System.csproj b/MIES_System/MIES_System.csproj new file mode 100644 index 0000000..cd01291 --- /dev/null +++ b/MIES_System/MIES_System.csproj @@ -0,0 +1,31 @@ + + + net9.0 + enable + latest + true + + + + + + + + + + + + + None + All + + + + + + + MainWindow.axaml + Code + + + diff --git a/MIES_System/MainWindow.axaml b/MIES_System/MainWindow.axaml new file mode 100644 index 0000000..9a2e329 --- /dev/null +++ b/MIES_System/MainWindow.axaml @@ -0,0 +1,14 @@ + + + + + diff --git a/MIES_System/MainWindow.axaml.cs b/MIES_System/MainWindow.axaml.cs new file mode 100644 index 0000000..1bb30ad --- /dev/null +++ b/MIES_System/MainWindow.axaml.cs @@ -0,0 +1,29 @@ +using Avalonia.Controls; +using MIES_System.ViewModels; +using MIES_System.Views; + +namespace MIES_System; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + App.Navigation.Configure(MainContent); + LoginViewModel lgviewmodel = new LoginViewModel(); + var lg = new LoginView() + { + DataContext = lgviewmodel + }; + lgviewmodel.LoginSuccess+= LgviewmodelOnLoginSuccess; + App.Navigation.Navigate(lg); + } + + private void LgviewmodelOnLoginSuccess() + { + App.Navigation.Navigate(new HomeView + { + DataContext = new HomeViewModel() + }); + } +} \ No newline at end of file diff --git a/MIES_System/ViewLocator.cs b/MIES_System/ViewLocator.cs new file mode 100644 index 0000000..f6a6076 --- /dev/null +++ b/MIES_System/ViewLocator.cs @@ -0,0 +1,30 @@ +using System; +using Avalonia.Controls; +using Avalonia.Controls.Templates; +using MIES_System.ViewModels; + +namespace MIES_System; + +public class ViewLocator : IDataTemplate +{ + public Control? Build(object? param) + { + if (param is null) + return null; + + var name = param.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/MIES_System/ViewModels/ViewModelBase.cs b/MIES_System/ViewModels/ViewModelBase.cs new file mode 100644 index 0000000..16c5938 --- /dev/null +++ b/MIES_System/ViewModels/ViewModelBase.cs @@ -0,0 +1,8 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +namespace MIES_System.ViewModels; + +public abstract class ViewModelBase : ObservableObject +{ + +} \ No newline at end of file