├── samples
├── ViewDiscovery
│ ├── Views
│ │ ├── ViewA.xaml
│ │ ├── MainWindow.xaml
│ │ ├── ViewA.xaml.cs
│ │ └── MainWindow.xaml.cs
│ ├── App.xaml
│ ├── Bootstrapper.cs
│ ├── ViewDiscovery.csproj
│ └── App.xaml.cs
├── ModulesSample.Infrastructure
│ ├── Events
│ │ └── DummyEvent.cs
│ ├── Modularity
│ │ ├── ModuleInitializationStatus.cs
│ │ ├── KnownModuleNames.cs
│ │ └── IModuleTracker.cs
│ └── ModulesSample.Infrastructure.csproj
├── DummyModule
│ ├── View
│ │ ├── DummyModuleView.xaml
│ │ └── DummyModuleView.xaml.cs
│ ├── DummyModule.csproj
│ └── DummyModule.cs
├── ModulesSample
│ ├── App.xaml
│ ├── MainWindow.xaml
│ ├── Module System Logic
│ │ ├── DiscoveryMethod.cs
│ │ ├── ModuleTracker.cs
│ │ └── ModuleTrackingState.cs
│ ├── ModulesSample.csproj
│ ├── App.xaml.cs
│ ├── MainWindow.xaml.cs
│ └── CallbackLogger.cs
├── BootstrapperShellSample
│ ├── App.xaml
│ ├── Views
│ │ ├── MainWindow.xaml
│ │ └── MainWindow.xaml.cs
│ ├── Bootstrapper.cs
│ ├── BootstrapperShellSample.csproj
│ └── App.xaml.cs
└── DummyModule2
│ ├── View
│ ├── DummyModuleView2.xaml
│ └── DummyModuleView2.xaml.cs
│ ├── DummyModule2.csproj
│ └── DumyModule2.cs
├── tests
├── Prism.Avalonia.Tests
│ ├── Mocks
│ │ ├── Views
│ │ │ ├── Mock.cs
│ │ │ └── MockView.cs
│ │ ├── MockDependencyObject.cs
│ │ ├── MockClickableObject.cs
│ │ ├── MockSortableViews.cs
│ │ ├── MockRegionBehaviorCollection.cs
│ │ ├── MockFrameworkElement.cs
│ │ ├── MockLogger.cs
│ │ ├── MockDelegateReference.cs
│ │ ├── MockHostAwareRegionBehavior.cs
│ │ ├── MockRegionBehavior.cs
│ │ ├── MockConfigurationStore.Desktop.cs
│ │ ├── ViewModels
│ │ │ └── MockViewModel.cs
│ │ ├── MockRegionAdapter.cs
│ │ ├── MockCommand.cs
│ │ ├── MockContainerAdapter.cs
│ │ ├── MockViewsCollection.cs
│ │ ├── MockRegionManagerAccessor.cs
│ │ ├── MockServiceLocator.cs
│ │ ├── MockModuleTypeLoader.cs
│ │ └── MockAsyncModuleTypeLoader.cs
│ ├── Modularity
│ │ ├── ModuleInfoGroupFixture.cs
│ │ ├── ModuleAttributeFixture.Desktop.cs
│ │ └── ModuleCatalogXaml
│ │ │ └── SimpleModuleCatalog.xaml
│ ├── Regions
│ │ ├── SingleActiveRegionFixture.cs
│ │ ├── AllActiveRegionFixture.cs
│ │ ├── RegionBehaviorCollectionFixture.cs
│ │ ├── RegionBehaviorFixture.cs
│ │ ├── NavigationContextFixture.cs
│ │ └── RegionBehaviorFactoryFixture.cs
│ ├── ExceptionAssert.cs
│ ├── CollectionChangedTracker.cs
│ ├── Prism.Avalonia.Tests.csproj
│ └── Logging
│ │ └── TextLoggerFixture.cs
├── Prism.IocContainer.Avalonia.Tests.Support
│ ├── Mocks
│ │ ├── MockService.cs
│ │ ├── Views
│ │ │ └── MockView.cs
│ │ ├── MockModuleLoader.cs
│ │ ├── DependantB.cs
│ │ ├── DependantA.cs
│ │ ├── MockLoggerAdapter.cs
│ │ └── ViewModels
│ │ │ └── MockViewModel.cs
│ ├── Prism.IocContainer.Avalonia.Tests.Support.csproj
│ └── BootstrapperFixtureBase.cs
├── Prism.DryIoc.Avalonia.Tests
│ ├── Prism.DryIoc.Avalonia.Tests.csproj
│ ├── DryIocBootstrapperNullLoggerFixture.cs
│ ├── DryIocBootstrapperNullContainerFixture.cs
│ ├── DryIocBootstrapperNullModuleCatalogFixture.cs
│ ├── DryIocBootstrapperRegisterForNavigationFixture.cs
│ └── DryIocBootstrapperNullModuleManagerFixture.cs
└── Prism.Autofac.Avalonia.Tests
│ ├── Prism.Autofac.Avalonia.Tests.csproj
│ ├── Mocks
│ └── MockServiceLocator.cs
│ ├── AutofacBootstrapperNullLoggerFixture.cs
│ ├── AutofacBootstrapperNullModuleCatalogFixture.cs
│ ├── AutofacBootstrapperNullModuleManagerFixture.cs
│ └── AutofacBootstrapperNullContainerFixture.cs
├── src
├── Prism.Avalonia
│ ├── Modularity
│ │ ├── ModuleInfo.Desktop.cs
│ │ ├── IModule.cs
│ │ ├── IModuleInitializer.cs
│ │ ├── IConfigurationStore.Desktop.cs
│ │ ├── IAssemblyResolver.Desktop.cs
│ │ ├── IModuleCatalogItem.cs
│ │ ├── InitializationMode.cs
│ │ ├── ConfigurationStore.Desktop.cs
│ │ ├── DuplicateModuleException.Desktop.cs
│ │ ├── CyclicDependencyFoundException.Desktop.cs
│ │ ├── ModuleInitializeException.Desktop.cs
│ │ ├── ModuleTypeLoadingException.Desktop.cs
│ │ ├── ModuleTypeLoaderNotFoundException.Desktop.cs
│ │ ├── ModuleNotFoundException.Desktop.cs
│ │ ├── ModulesConfigurationSection.Desktop.cs
│ │ ├── ModuleAttribute.Desktop.cs
│ │ ├── ModuleDependencyAttribute.Desktop.cs
│ │ ├── ModuleManager.Desktop.cs
│ │ ├── IModuleManager.cs
│ │ ├── ModuleState.cs
│ │ ├── ModuleDependencyConfigurationElement.Desktop.cs
│ │ ├── IModuleTypeLoader.cs
│ │ ├── ModularityException.Desktop.cs
│ │ ├── LoadModuleCompletedEventArgs.cs
│ │ ├── CyclicDependencyFoundException.cs
│ │ ├── ModuleDownloadProgressChangedEventArgs.cs
│ │ ├── IModuleCatalog.cs
│ │ ├── ModuleTypeLoaderNotFoundException.cs
│ │ └── DuplicateModuleException.cs
│ ├── Regions
│ │ ├── SyncActiveStateAttribute.cs
│ │ ├── IRegionBehavior.cs
│ │ ├── IJournalAware.cs
│ │ ├── IRegionNavigationJournalEntry.cs
│ │ ├── IRegionMemberLifetime.cs
│ │ ├── IRegionAdapter.cs
│ │ ├── IViewsCollection.cs
│ │ ├── Behaviors
│ │ │ ├── IHostAwareRegionBehavior.cs
│ │ │ ├── RegionCreationException.Desktop.cs
│ │ │ └── RegionCreationException.cs
│ │ ├── UpdateRegionsException.Desktop.cs
│ │ ├── ViewSortHintAttribute.cs
│ │ ├── SingleActiveRegion.cs
│ │ ├── IConfirmNavigationRequest.cs
│ │ ├── ViewRegistrationException.Desktop.cs
│ │ ├── RegionMemberLifetimeAttribute.cs
│ │ ├── IRegionNavigationContentLoader.cs
│ │ ├── ViewRegisteredEventArgs.cs
│ │ ├── IRegionNavigationService.cs
│ │ ├── AllActiveRegion.cs
│ │ ├── INavigationAware.cs
│ │ ├── RegionNavigationJournalEntry.cs
│ │ ├── IRegionBehaviorCollection.cs
│ │ ├── IRegionManagerAccessor.cs
│ │ ├── RegionNavigationEventArgs.cs
│ │ ├── UpdateRegionsException.cs
│ │ ├── ViewRegistrationException.cs
│ │ ├── NavigationResult.cs
│ │ ├── RegionBehavior.cs
│ │ ├── INavigateAsync.cs
│ │ ├── IRegionBehaviorFactory.cs
│ │ ├── DefaultRegionManagerAccessor.cs
│ │ ├── IRegionViewRegistry.cs
│ │ ├── RegionContext.cs
│ │ ├── RegionNavigationFailedEventArgs.cs
│ │ ├── IRegionNavigationJournal.cs
│ │ └── IRegionCollection.cs
│ ├── Logging
│ │ └── TraceLogger.cs
│ ├── Events
│ │ └── WeakDelegatesManager.cs
│ ├── Common
│ │ ├── MvvmHelpers.cs
│ │ ├── UriParsingHelper.cs
│ │ └── ObservableObject.cs
│ ├── Extensions
│ │ ├── CollectionExtensions.cs
│ │ └── ServiceLocatorExtensions.cs
│ ├── Prism.Avalonia.csproj
│ └── Mvvm
│ │ └── ViewModelLocator.cs
├── Prism.Autofac.Avalonia
│ ├── GlobalSuppressions.cs
│ ├── Prism.Autofac.Avalonia.csproj
│ ├── AutofacServiceLocatorAdapter.cs
│ ├── AutofacExtensions.cs
│ └── Regions
│ │ └── AutofacRegionNavigationContentLoader.cs
└── Prism.DryIoc.Avalonia
│ ├── GlobalSuppressions.cs
│ ├── Prism.DryIoc.Avalonia.csproj
│ ├── DryIocServiceLocatorAdapter.cs
│ └── DryIocExtensions.cs
├── LICENSE
└── README.md
/samples/ViewDiscovery/Views/ViewA.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/Views/Mock.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 |
3 | namespace Prism.Avalonia.Tests.Mocks.Views
4 | {
5 | public class Mock : Control
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/Views/MockView.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 |
3 | namespace Prism.Avalonia.Tests.Mocks.Views
4 | {
5 | public class MockView : Control
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/samples/ModulesSample.Infrastructure/Events/DummyEvent.cs:
--------------------------------------------------------------------------------
1 | using Prism.Events;
2 |
3 | namespace Prism.Avalonia.Infrastructure.Events
4 | {
5 | public class DummyEvent : PubSubEvent
6 | {
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Prism.Avalonia/Modularity/ModuleInfo.Desktop.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using System;
4 |
5 | namespace Prism.Modularity
6 | {
7 | [Serializable]
8 | public partial class ModuleInfo
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/MockDependencyObject.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using Avalonia;
4 |
5 | namespace Prism.Avalonia.Tests.Mocks
6 | {
7 | public class MockDependencyObject : Visual
8 | {
9 | }
10 | }
--------------------------------------------------------------------------------
/tests/Prism.IocContainer.Avalonia.Tests.Support/Mocks/MockService.cs:
--------------------------------------------------------------------------------
1 | namespace Prism.IocContainer.Avalonia.Tests.Support.Mocks
2 | {
3 | public class MockService : IService
4 | {
5 | }
6 |
7 | public interface IService { }
8 | }
--------------------------------------------------------------------------------
/tests/Prism.IocContainer.Avalonia.Tests.Support/Mocks/Views/MockView.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 |
3 | namespace Prism.IocContainer.Avalonia.Tests.Support.Mocks.Views
4 | {
5 | public class MockView : Control
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/samples/ModulesSample.Infrastructure/Modularity/ModuleInitializationStatus.cs:
--------------------------------------------------------------------------------
1 | namespace Prism.Avalonia.Infrastructure
2 | {
3 | public enum ModuleInitializationStatus
4 | {
5 | NotStarted,
6 | Constructed,
7 | Initialized
8 | }
9 | }
--------------------------------------------------------------------------------
/samples/ViewDiscovery/Views/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/MockClickableObject.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 |
3 | namespace Prism.Avalonia.Tests.Mocks
4 | {
5 | internal class MockClickableObject : Button
6 | {
7 | public void RaiseClick()
8 | {
9 | OnClick();
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/samples/ModulesSample.Infrastructure/ModulesSample.Infrastructure.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/samples/DummyModule/View/DummyModuleView.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/samples/ModulesSample/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/ViewDiscovery/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/BootstrapperShellSample/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/samples/DummyModule2/View/DummyModuleView2.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Prism.Avalonia/Modularity/IModule.cs:
--------------------------------------------------------------------------------
1 | namespace Prism.Modularity
2 | {
3 | ///
4 | /// Defines the contract for the modules deployed in the application.
5 | ///
6 | public interface IModule
7 | {
8 | ///
9 | /// Notifies the module that it has be initialized.
10 | ///
11 | void Initialize();
12 | }
13 | }
--------------------------------------------------------------------------------
/tests/Prism.IocContainer.Avalonia.Tests.Support/Mocks/MockModuleLoader.cs:
--------------------------------------------------------------------------------
1 | using Prism.Modularity;
2 |
3 | namespace Prism.IocContainer.Avalonia.Tests.Support.Mocks
4 | {
5 | public class MockModuleInitializer : IModuleInitializer
6 | {
7 | public bool LoadCalled;
8 |
9 | public void Initialize(ModuleInfo moduleInfo)
10 | {
11 | LoadCalled = true;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/samples/ModulesSample.Infrastructure/Modularity/KnownModuleNames.cs:
--------------------------------------------------------------------------------
1 | namespace Prism.Avalonia.Infrastructure
2 | {
3 | ///
4 | /// A set of known module names for communication with IModuleTracker
5 | ///
6 | public static class KnownModuleNames
7 | {
8 | public const string ModuleDummy = "DummyModule";
9 |
10 | public const string ModuleDummy2 = "DummyModule2";
11 | }
12 | }
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/MockSortableViews.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using Prism.Regions;
4 |
5 | namespace Prism.Avalonia.Tests.Mocks
6 | {
7 | [ViewSortHint("01")]
8 | internal class MockSortableView1
9 | {
10 | }
11 |
12 | [ViewSortHint("02")]
13 | internal class MockSortableView2
14 | {
15 | }
16 |
17 | [ViewSortHint("03")]
18 | internal class MockSortableView3
19 | {
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/samples/BootstrapperShellSample/Views/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/MockRegionBehaviorCollection.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using Prism.Regions;
4 |
5 | namespace Prism.Avalonia.Tests.Mocks
6 | {
7 | internal class MockRegionBehaviorCollection : Dictionary, IRegionBehaviorCollection
8 | {
9 | IEnumerator IEnumerable.GetEnumerator()
10 | {
11 | return GetEnumerator();
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/MockFrameworkElement.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls;
3 | using Avalonia.Interactivity;
4 |
5 | namespace Prism.Avalonia.Tests.Mocks
6 | {
7 | public class MockFrameworkElement : Control
8 | {
9 | public void RaiseLoaded()
10 | {
11 | RaiseLoaded();
12 | }
13 |
14 | public void RaiseUnloaded()
15 | {
16 | RaiseUnloaded();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/Prism.IocContainer.Avalonia.Tests.Support/Mocks/DependantB.cs:
--------------------------------------------------------------------------------
1 | namespace Prism.IocContainer.Avalonia.Tests.Support.Mocks
2 | {
3 | public class DependantB : IDependantB
4 | {
5 | public DependantB(IService service)
6 | {
7 | MyService = service;
8 | }
9 |
10 | public IService MyService { get; set; }
11 | }
12 |
13 | public interface IDependantB
14 | {
15 | IService MyService { get; }
16 | }
17 | }
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/MockLogger.cs:
--------------------------------------------------------------------------------
1 | using Prism.Logging;
2 |
3 | namespace Prism.Avalonia.Tests.Mocks
4 | {
5 | internal class MockLogger : ILoggerFacade
6 | {
7 | public string LastMessage;
8 | public Category LastMessageCategory;
9 | public void Log(string message, Category category, Priority priority)
10 | {
11 | LastMessage = message;
12 | LastMessageCategory = category;
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/MockDelegateReference.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Prism.Events;
3 |
4 | namespace Prism.Avalonia.Tests.Mocks
5 | {
6 | class MockDelegateReference : IDelegateReference
7 | {
8 | public Delegate Target { get; set; }
9 |
10 | public MockDelegateReference()
11 | {
12 |
13 | }
14 |
15 | public MockDelegateReference(Delegate target)
16 | {
17 | Target = target;
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/MockHostAwareRegionBehavior.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Prism.Regions;
3 | using Prism.Regions.Behaviors;
4 |
5 | namespace Prism.Avalonia.Tests.Mocks
6 | {
7 | public class MockHostAwareRegionBehavior : IHostAwareRegionBehavior
8 | {
9 | public IRegion Region { get; set; }
10 |
11 | public void Attach()
12 | {
13 |
14 | }
15 |
16 | public Visual HostControl { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Prism.Avalonia/Regions/SyncActiveStateAttribute.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace Prism.Regions
9 | {
10 | ///
11 | /// Defines that a view is synchronized with its parent view's Active state.
12 | ///
13 | [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
14 | public sealed class SyncActiveStateAttribute : Attribute
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tests/Prism.IocContainer.Avalonia.Tests.Support/Mocks/DependantA.cs:
--------------------------------------------------------------------------------
1 | namespace Prism.IocContainer.Avalonia.Tests.Support.Mocks
2 | {
3 | public class DependantA : IDependantA
4 | {
5 | public DependantA(IDependantB dependantB)
6 | {
7 | MyDependantB = dependantB;
8 | }
9 |
10 | public IDependantB MyDependantB { get; set; }
11 | }
12 |
13 | public interface IDependantA
14 | {
15 | IDependantB MyDependantB { get; }
16 | }
17 | }
--------------------------------------------------------------------------------
/tests/Prism.IocContainer.Avalonia.Tests.Support/Mocks/MockLoggerAdapter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Prism.Logging;
3 |
4 | namespace Prism.IocContainer.Avalonia.Tests.Support.Mocks
5 | {
6 | public class MockLoggerAdapter : ILoggerFacade
7 | {
8 | public IList Messages = new List();
9 |
10 | public void Log(string message, Category category, Priority priority)
11 | {
12 | Messages.Add(message);
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Prism.Avalonia/Modularity/IModuleInitializer.cs:
--------------------------------------------------------------------------------
1 | namespace Prism.Modularity
2 | {
3 | ///
4 | /// Declares a service which initializes the modules into the application.
5 | ///
6 | public interface IModuleInitializer
7 | {
8 | ///
9 | /// Initializes the specified module.
10 | ///
11 | /// The module to initialize
12 | void Initialize(ModuleInfo moduleInfo);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Prism.Avalonia/Modularity/IConfigurationStore.Desktop.cs:
--------------------------------------------------------------------------------
1 | namespace Prism.Modularity
2 | {
3 | ///
4 | /// Defines a store for the module metadata.
5 | ///
6 | public interface IConfigurationStore
7 | {
8 | ///
9 | /// Gets the module configuration data.
10 | ///
11 | /// A instance.
12 | ModulesConfigurationSection RetrieveModuleConfigurationSection();
13 | }
14 | }
--------------------------------------------------------------------------------
/tests/Prism.Avalonia.Tests/Mocks/MockRegionBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Prism.Regions;
3 |
4 | namespace Prism.Avalonia.Tests.Mocks
5 | {
6 | public class MockRegionBehavior : IRegionBehavior
7 | {
8 | public IRegion Region
9 | {
10 | get; set;
11 | }
12 |
13 | public Func