Skip to content

Commit

Permalink
Merge pull request #11 from DamianSuess/feature-Prism8197
Browse files Browse the repository at this point in the history
Merge feature-Prism8197 into Master
  • Loading branch information
OmidID authored Jul 14, 2022
2 parents 8930fea + d8a0a28 commit 2a443ea
Show file tree
Hide file tree
Showing 507 changed files with 10,616 additions and 19,949 deletions.
20 changes: 17 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ root = true

[*]
indent_style = space
end_of_line = CRLF
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = crlf

##########################################
# File Extension Settings
Expand All @@ -21,21 +19,32 @@ insert_final_newline = true
[*.sln]
indent_style = tab
indent_size = 2
trim_trailing_whitespace = true

[*.{csproj,proj,projitems,shproj}]
indent_size = 2
trim_trailing_whitespace = true

[*.md]
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
indent_size = 2

[*.{props,targets}]
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.targets]
indent_size = 2

[*.xaml]
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[*.plist]
indent_size = 2
Expand All @@ -44,9 +53,14 @@ indent_style = tab
[*.sh]
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.cs]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true

# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
Expand Down
53 changes: 47 additions & 6 deletions Prism.Avalonia.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29324.140
# Visual Studio Version 17
VisualStudioVersion = 17.3.32611.2
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Prism.Avalonia", "src\Prism.Avalonia\Prism.Avalonia.csproj", "{F4A9F2F0-979F-4964-8BC8-A39F4816803B}"
EndProject
Expand All @@ -22,7 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DummyModules", "DummyModule
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ModulesSample", "samples\ModulesSample\ModulesSample.csproj", "{DCC68F88-29C9-44EF-90E3-685666AFD6AD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DummyModule", "samples\DummyModule\DummyModule.csproj", "{2B315287-FDAE-4092-9A80-7DA07D934BF1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DummyModule1", "samples\DummyModule1\DummyModule1.csproj", "{2B315287-FDAE-4092-9A80-7DA07D934BF1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DummyModule2", "samples\DummyModule2\DummyModule2.csproj", "{CC39B117-CA19-4151-8B2E-419514AEAE90}"
EndProject
Expand All @@ -44,6 +44,24 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{A1A058C5
build\SampleApp.props = build\SampleApp.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Avalonia", "Avalonia", "{9FF880E7-B56A-4E8E-9226-90A928FDE3AB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Containers", "Containers", "{366415D3-E0ED-449C-99E2-A258F6A566F6}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Prism.DryIoc.Shared", "src\Containers\Prism.DryIoc.Shared\Prism.DryIoc.Shared.shproj", "{6E7EC81D-DA39-4C4F-A898-0148558C34F4}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Prism.Unity.Shared", "src\Containers\Prism.Unity.Shared\Prism.Unity.Shared.shproj", "{D66336A6-07E5-401A-A710-DAEDD6975D59}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicMvvmApp", "samples\SampleMvvmApp\BasicMvvmApp.csproj", "{7AF14280-214B-4A96-AFE8-CF063E2B6CA4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{966DDDE9-D31A-404B-9F24-5378DE8A12C8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Avalonia", "Avalonia", "{AD4FDFF7-8F44-41AD-809B-C96A5AF2BC57}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Prism.Container.Avalonia.Shared", "tests\Avalonia\Prism.Container.Avalonia.Shared\Prism.Container.Avalonia.Shared.shproj", "{340538B6-0781-470E-8BD1-7B7735FDC554}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Prism.Avalonia.Tests", "tests\Avalonia\Prism.Avalonia.Tests\Prism.Avalonia.Tests.csproj", "{DAFC499B-E379-4453-BDCE-2EC30E1290C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -86,13 +104,21 @@ Global
{87550619-24C8-47ED-917E-EB58D325FC9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87550619-24C8-47ED-917E-EB58D325FC9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87550619-24C8-47ED-917E-EB58D325FC9E}.Release|Any CPU.Build.0 = Release|Any CPU
{7AF14280-214B-4A96-AFE8-CF063E2B6CA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7AF14280-214B-4A96-AFE8-CF063E2B6CA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7AF14280-214B-4A96-AFE8-CF063E2B6CA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7AF14280-214B-4A96-AFE8-CF063E2B6CA4}.Release|Any CPU.Build.0 = Release|Any CPU
{DAFC499B-E379-4453-BDCE-2EC30E1290C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DAFC499B-E379-4453-BDCE-2EC30E1290C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DAFC499B-E379-4453-BDCE-2EC30E1290C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DAFC499B-E379-4453-BDCE-2EC30E1290C8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F4A9F2F0-979F-4964-8BC8-A39F4816803B} = {70B9D432-E8BD-4EB9-9CA8-E63E2C804F3F}
{A379E2C8-BD9A-42A1-8218-CED3C0D75E64} = {70B9D432-E8BD-4EB9-9CA8-E63E2C804F3F}
{F4A9F2F0-979F-4964-8BC8-A39F4816803B} = {9FF880E7-B56A-4E8E-9226-90A928FDE3AB}
{A379E2C8-BD9A-42A1-8218-CED3C0D75E64} = {9FF880E7-B56A-4E8E-9226-90A928FDE3AB}
{ABBB169C-A49A-46C7-A920-3F0780CBCA04} = {5F8D330E-F611-4E17-8217-F2D6CDB8E1F7}
{5D9978C6-2D59-4040-BCF5-56A49AB586E8} = {5F8D330E-F611-4E17-8217-F2D6CDB8E1F7}
{E03DB670-BFA9-4E7B-A69C-D1E6B8E1691F} = {47BC0E69-AF2D-4C4F-886E-31B61E05C57A}
Expand All @@ -101,9 +127,24 @@ Global
{CC39B117-CA19-4151-8B2E-419514AEAE90} = {E03DB670-BFA9-4E7B-A69C-D1E6B8E1691F}
{47BC0E69-AF2D-4C4F-886E-31B61E05C57A} = {5F8D330E-F611-4E17-8217-F2D6CDB8E1F7}
{B7112DF9-D7A1-48B8-8821-CF81D52F793E} = {47BC0E69-AF2D-4C4F-886E-31B61E05C57A}
{87550619-24C8-47ED-917E-EB58D325FC9E} = {70B9D432-E8BD-4EB9-9CA8-E63E2C804F3F}
{87550619-24C8-47ED-917E-EB58D325FC9E} = {9FF880E7-B56A-4E8E-9226-90A928FDE3AB}
{9FF880E7-B56A-4E8E-9226-90A928FDE3AB} = {70B9D432-E8BD-4EB9-9CA8-E63E2C804F3F}
{366415D3-E0ED-449C-99E2-A258F6A566F6} = {70B9D432-E8BD-4EB9-9CA8-E63E2C804F3F}
{6E7EC81D-DA39-4C4F-A898-0148558C34F4} = {366415D3-E0ED-449C-99E2-A258F6A566F6}
{D66336A6-07E5-401A-A710-DAEDD6975D59} = {366415D3-E0ED-449C-99E2-A258F6A566F6}
{7AF14280-214B-4A96-AFE8-CF063E2B6CA4} = {5F8D330E-F611-4E17-8217-F2D6CDB8E1F7}
{AD4FDFF7-8F44-41AD-809B-C96A5AF2BC57} = {966DDDE9-D31A-404B-9F24-5378DE8A12C8}
{340538B6-0781-470E-8BD1-7B7735FDC554} = {AD4FDFF7-8F44-41AD-809B-C96A5AF2BC57}
{DAFC499B-E379-4453-BDCE-2EC30E1290C8} = {AD4FDFF7-8F44-41AD-809B-C96A5AF2BC57}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D260344D-8648-441D-B85B-9D280005F098}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
tests\Avalonia\Prism.Container.Avalonia.Shared\Prism.Container.Avalonia.Shared.projitems*{340538b6-0781-470e-8bd1-7b7735fdc554}*SharedItemsImports = 13
src\Containers\Prism.DryIoc.Shared\Prism.DryIoc.Shared.projitems*{6e7ec81d-da39-4c4f-a898-0148558c34f4}*SharedItemsImports = 13
src\Containers\Prism.Unity.Shared\Prism.Unity.Shared.projitems*{87550619-24c8-47ed-917e-eb58d325fc9e}*SharedItemsImports = 5
src\Containers\Prism.DryIoc.Shared\Prism.DryIoc.Shared.projitems*{a379e2c8-bd9a-42a1-8218-ced3c0d75e64}*SharedItemsImports = 5
src\Containers\Prism.Unity.Shared\Prism.Unity.Shared.projitems*{d66336a6-07e5-401a-a710-daedd6975d59}*SharedItemsImports = 13
EndGlobalSection
EndGlobal
79 changes: 47 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
# Prism.Avalonia
Prism (https://github.com/PrismLibrary/Prism) framework support for Avalonia UI.

This library actually copies functionality of Prism for WPF implementation, which can be found here:
https://github.com/PrismLibrary/Prism/tree/master/Source/Wpf

Logic and approach for development of your applications remained the same as it was for Prism.Wpf library.
[Prism framework](https://github.com/PrismLibrary/Prism) support for Avalonia UI.

[![Prism.Avalonia NuGet Badge](https://buildstats.info/nuget/Prism.Avalonia?dWidth=70&includePreReleases=true)](https://www.nuget.org/packages/Prism.Avalonia/)

Prism.Avalonia's logic and development approach is similar to that of [Prism for WPF](https://github.com/PrismLibrary/Prism/tree/master/Source/Wpf) so you can get started right away with Prism for Avalonia!

## Upgrade to Prism 8.1 Progress

Check out [Upgrade-Prism-7.2-to-8.1.md](https://github.com/AvaloniaCommunity/Prism.Avalonia/blob/feature-Prism8197/Upgrade-Prism-7.2-to-8.1.md) for the latest progress.

## Install

### Install
Add package from nuget to your project:

```
Install-Package Prism.Avalonia -Version 7.2.0.1429
```powershell
Install-Package Prism.Avalonia -Version 8.1.0.97
```

DryIoc:
```
Install-Package Prism.DryIoc.Avalonia -Version 7.2.0.1429

```powershell
Install-Package Prism.DryIoc.Avalonia -Version 8.1.0.97
```

Unity:
```
Install-Package Prism.Unity.Avalonia -Version 7.2.0.1429
```

Autofac (Not updating for the moment):
```
Install-Package Prism.Autofac.Avalonia -Version 7.1.0.431
```powershell
Install-Package Prism.Unity.Avalonia -Version 8.1.0.97
```

### How to use
## How to use

** App.xaml.cs: **
### App.xaml.cs

```csharp
public class App : PrismApplication
{

public static bool IsSingleViewLifetime =>
Environment.GetCommandLineArgs()
.Any(a => a == "--fbdev" || a == "--drm");
Expand All @@ -51,13 +52,6 @@ public class App : PrismApplication
base.Initialize();
}

protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
// TODO: Register services here
moduleCatalog.Register<IMainService, MainService>();
}

protected override IAvaloniaObject CreateShell()
{
if (IsSingleViewLifetime)
Expand All @@ -68,22 +62,43 @@ public class App : PrismApplication

protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
{
// TODO: Register modules
// Register modules
moduleCatalog.AddModule<Module1.Module>();
moduleCatalog.AddModule<Module2.Module>();
moduleCatalog.AddModule<Module3.Module>();
}
}

/// <summary>Called after <seealso cref="Initialize"/>.</summary>
protected override void OnInitialized()
{
// Register initial Views to Region.
var regionManager = Container.Resolve<IRegionManager>();
regionManager.RegisterViewWithRegion(RegionNames.ContentRegion, typeof(DashboardView));
regionManager.RegisterViewWithRegion(RegionNames.SidebarRegion, typeof(SidebarView));
}

protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
// Register Services
containerRegistry.Register<IRestService, RestService>();

// Views - Generic
containerRegistry.Register<MainWindow>();

// Views - Region Navigation
containerRegistry.RegisterForNavigation<DashboardView, DashboardViewModel>();
containerRegistry.RegisterForNavigation<SettingsView, SettingsViewModel>();
containerRegistry.RegisterForNavigation<SidebarView, SidebarViewModel>();
}
}
```

** Program.cs: **
### Program.cs

```csharp
public static class Program
{

public static AppBuilder BuildAvaloniaApp() =>
public static AppBuilder BuildAvaloniaApp() =>
AppBuilder.Configure<App>()
.UsePlatformDetect()
.With(new X11PlatformOptions
Expand Down
Loading

0 comments on commit 2a443ea

Please sign in to comment.