diff --git a/src/Prism.Avalonia/Mvvm/ViewModelLocator.cs b/src/Prism.Avalonia/Mvvm/ViewModelLocator.cs index 5bb9ec4..4a88726 100644 --- a/src/Prism.Avalonia/Mvvm/ViewModelLocator.cs +++ b/src/Prism.Avalonia/Mvvm/ViewModelLocator.cs @@ -4,9 +4,6 @@ using Avalonia; using Avalonia.Controls; -#if NETFX_CORE -using Windows.UI.Xaml; -#endif namespace Prism.Mvvm { /// diff --git a/src/Prism.Avalonia/PrismInitializationExtensions.cs b/src/Prism.Avalonia/PrismInitializationExtensions.cs index cb2d9b7..fb19696 100644 --- a/src/Prism.Avalonia/PrismInitializationExtensions.cs +++ b/src/Prism.Avalonia/PrismInitializationExtensions.cs @@ -41,8 +41,7 @@ internal static void RegisterRequiredTypes(this IContainerRegistry containerRegi internal static void RegisterDefaultRegionBehaviors(this IRegionBehaviorFactory regionBehaviors) { - //// WPF: regionBehaviors.AddIfMissing(BindRegionContextToDependencyObjectBehavior.BehaviorKey); - //// Avalonia Equivilant: BindRegionContextToAvaloniaObjectBehavior + //// Avalonia to WPF Equivilant: BindRegionContextToAvaloniaObjectBehavior == BindRegionContextToDependencyObjectBehavior regionBehaviors.AddIfMissing(BindRegionContextToAvaloniaObjectBehavior.BehaviorKey); regionBehaviors.AddIfMissing(RegionActiveAwareBehavior.BehaviorKey); regionBehaviors.AddIfMissing(SyncRegionContextWithHostBehavior.BehaviorKey); diff --git a/tests/Avalonia/Prism.Avalonia.Tests/Interactivity/InvokeCommandActionFixture.cs b/tests/Avalonia/Prism.Avalonia.Tests/Interactivity/InvokeCommandActionFixture.cs index a2428ac..1eef597 100644 --- a/tests/Avalonia/Prism.Avalonia.Tests/Interactivity/InvokeCommandActionFixture.cs +++ b/tests/Avalonia/Prism.Avalonia.Tests/Interactivity/InvokeCommandActionFixture.cs @@ -4,7 +4,7 @@ using Prism.Avalonia.Tests.Mocks; using Xunit; -namespace Prism.Avalonia.Tests.Logging +namespace Prism.Avalonia.Tests.Interactivity { // Override Prism.Interactivity.InvokeCommandAction until it can be implemented. //// Reference: diff --git a/tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockDependencyObject.cs b/tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockDependencyObject.cs index 45d386b..f55ae46 100644 --- a/tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockDependencyObject.cs +++ b/tests/Avalonia/Prism.Avalonia.Tests/Mocks/MockDependencyObject.cs @@ -2,6 +2,7 @@ namespace Prism.Avalonia.Tests.Mocks { + /// MockAvaloniaObject. public class MockDependencyObject : AvaloniaObject { } diff --git a/tests/Avalonia/Prism.Avalonia.Tests/Mvvm/ViewModelLocatorFixture.cs b/tests/Avalonia/Prism.Avalonia.Tests/Mvvm/ViewModelLocatorFixture.cs index 8609add..9d23578 100644 --- a/tests/Avalonia/Prism.Avalonia.Tests/Mvvm/ViewModelLocatorFixture.cs +++ b/tests/Avalonia/Prism.Avalonia.Tests/Mvvm/ViewModelLocatorFixture.cs @@ -12,6 +12,7 @@ public class ViewModelLocatorFixture [StaFact] public void ShouldLocateViewModelWithDefaultSettings() { + // Warning: flaky test. This runs by itself but not as a whole. ResetViewModelLocationProvider(); Mock view = new Mock(); diff --git a/tests/Avalonia/Prism.Avalonia.Tests/PrismApplicationBaseFixture.cs b/tests/Avalonia/Prism.Avalonia.Tests/PrismApplicationBaseFixture.cs index f12af17..c14e073 100644 --- a/tests/Avalonia/Prism.Avalonia.Tests/PrismApplicationBaseFixture.cs +++ b/tests/Avalonia/Prism.Avalonia.Tests/PrismApplicationBaseFixture.cs @@ -203,7 +203,8 @@ public void RequiredTypesAreRegistered() { application.MockContainer.Verify(x => x.RegisterInstance(typeof(IModuleCatalog), It.IsAny()), Times.Once); - application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IDialogService), typeof(DialogService)), Times.Once); + // TODO: IDialogService is not implemented + //// application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IDialogService), typeof(DialogService)), Times.Once); application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleInitializer), typeof(ModuleInitializer)), Times.Once); application.MockContainer.Verify(x => x.RegisterSingleton(typeof(IModuleManager), typeof(ModuleManager)), Times.Once); application.MockContainer.Verify(x => x.RegisterSingleton(typeof(RegionAdapterMappings), typeof(RegionAdapterMappings)), Times.Once); @@ -216,7 +217,8 @@ public void RequiredTypesAreRegistered() application.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournalEntry), typeof(RegionNavigationJournalEntry)), Times.Once); application.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationJournal), typeof(RegionNavigationJournal)), Times.Once); application.MockContainer.Verify(x => x.Register(typeof(IRegionNavigationService), typeof(RegionNavigationService)), Times.Once); - application.MockContainer.Verify(x => x.Register(typeof(IDialogWindow), typeof(DialogWindow)), Times.Once); + // TODO: IDialogService is not implemented + //// application.MockContainer.Verify(x => x.Register(typeof(IDialogWindow), typeof(DialogWindow)), Times.Once); } } diff --git a/tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionManagerFixture.cs b/tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionManagerFixture.cs index 458c4c8..5ca8cb1 100644 --- a/tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionManagerFixture.cs +++ b/tests/Avalonia/Prism.Avalonia.Tests/Regions/RegionManagerFixture.cs @@ -156,6 +156,7 @@ public void ShouldSetObservableRegionContextWhenRegionContextChanges() var region = new MockPresentationRegion(); var view = new MockDependencyObject(); + // NOTE: AvaloniaObject performs `Dispatcher.UIThread.VerifyAccess()`, if it's FALSE the InheritanceParent returns NULL. var observableObject = RegionContext.GetObservableContext(view); bool propertyChangedCalled = false;