├── .editorconfig
├── .gitattributes
├── .github
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── renovate.json
└── workflows
│ ├── ci-build.yml
│ ├── lock.yml
│ └── release.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── images
└── logo.png
├── src
├── Benchmarks
│ ├── CurrentBenchmark.cs
│ ├── CurrentMutableBenchmark.cs
│ ├── DependencyResolver.cs
│ ├── Directory.Packages.props
│ ├── LocatorBenchmark.cs
│ ├── Program.cs
│ ├── Splat.Benchmarks.csproj
│ ├── Splat.Benchmarks.sln
│ └── ViewModel.cs
├── Directory.Packages.props
├── Directory.build.props
├── Directory.build.targets
├── ReactiveUI.DI.Tests
│ ├── AutoFacReactiveUIDependencyTests.cs
│ ├── DryIocReactiveUIDependencyTests.cs
│ ├── Mocks
│ │ ├── ActivatingView.cs
│ │ ├── ActivatingViewFetcher.cs
│ │ └── ActivatingViewModel.cs
│ ├── NinjectReactiveUIDependencyTests.cs
│ ├── ReactiveUI.DI.Tests.csproj
│ ├── SimpleInjectorReactiveUIDependencyTests.cs
│ └── ViewWithViewContractThatShouldNotLoad.cs
├── Splat.AppCenter
│ ├── AppCenterFeatureUsageTrackingSession.cs
│ ├── AppCenterViewTracking.cs
│ └── Splat.AppCenter.csproj
├── Splat.ApplicationInsights
│ ├── ApplicationInsightsFeatureUsageTrackingSession.cs
│ ├── ApplicationInsightsViewTracking.cs
│ └── Splat.ApplicationInsights.csproj
├── Splat.Autofac.Tests
│ ├── DependencyResolverTests.cs
│ ├── Splat.Autofac.Tests.csproj
│ └── xunit.runner.json
├── Splat.Autofac
│ ├── AutofacDependencyResolver.cs
│ ├── README.md
│ ├── Splat.Autofac.csproj
│ └── SplatAutofacExtensions.cs
├── Splat.Avalonia.Autofac
│ ├── AvaloniaMixins.cs
│ └── Splat.Avalonia.Autofac.csproj
├── Splat.Avalonia.DryIoc
│ ├── AvaloniaMixins.cs
│ └── Splat.Avalonia.DryIoc.csproj
├── Splat.Avalonia.DryIoc1.Tests
│ ├── AvaloniaUIThreadTestsDryIoc.cs
│ └── Splat.Avalonia.DryIoc1.Tests.csproj
├── Splat.Avalonia.DryIoc2.Tests
│ └── Splat.Avalonia.DryIoc2.Tests.csproj
├── Splat.Avalonia.Microsoft.Extensions.DependencyInjection
│ ├── AvaloniaMixins.cs
│ └── Splat.Avalonia.Microsoft.Extensions.DependencyInjection.csproj
├── Splat.Avalonia.Microsoft1.Tests
│ ├── AvaloniaUIThreadTestsMicrosoft.cs
│ └── Splat.Avalonia.Microsoft1.Tests.csproj
├── Splat.Avalonia.Microsoft2.Tests
│ └── Splat.Avalonia.Microsoft2.Tests.csproj
├── Splat.Avalonia.Ninject
│ ├── AvaloniaMixins.cs
│ └── Splat.Avalonia.Ninject.csproj
├── Splat.Avalonia.Tests
│ ├── AvaloniaUIThreadTestsMain.cs
│ ├── Mocks
│ │ ├── App.axaml
│ │ ├── App.axaml.cs
│ │ ├── MainWindow.axaml
│ │ ├── MainWindow.axaml.cs
│ │ ├── ViewModels
│ │ │ ├── BarViewModel.cs
│ │ │ ├── FooViewModel.cs
│ │ │ ├── MainWindowViewModel.cs
│ │ │ └── RoutedViewHostPageViewModel.cs
│ │ └── Views
│ │ │ ├── BarView.axaml
│ │ │ ├── BarView.axaml.cs
│ │ │ ├── FooView.axaml
│ │ │ └── FooView.axaml.cs
│ └── Splat.Avalonia.Tests.csproj
├── Splat.Common.Test
│ ├── DummyObjectClass1.cs
│ ├── DummyObjectClass2.cs
│ ├── DummyObjectClass3.cs
│ ├── IDummyInterface.cs
│ ├── IScreen.cs
│ ├── IViewFor.cs
│ ├── IViewModelOne.cs
│ ├── MockScreen.cs
│ ├── Splat.Common.Test.csproj
│ ├── ViewModelOne.cs
│ ├── ViewModelTwo.cs
│ ├── ViewOne.cs
│ ├── ViewThatShouldNotLoad.cs
│ └── ViewTwo.cs
├── Splat.Drawing.Tests
│ ├── API
│ │ ├── ApiApprovalTests.SplatUIProject.DotNet8_0.verified.txt
│ │ ├── ApiApprovalTests.SplatUIProject.DotNet9_0.verified.txt
│ │ └── ApiApprovalTests.cs
│ ├── BitmapLoaderTests.cs
│ ├── Colors
│ │ ├── CoverageColorTests.cs
│ │ ├── KnownColorTests.cs
│ │ └── SplatColorTests.cs
│ ├── PlatformBitmapLoaderTests.cs
│ └── Splat.Drawing.Tests.csproj
├── Splat.Drawing
│ ├── Bitmaps
│ │ ├── BitmapLoader.cs
│ │ ├── BitmapLoaderException.cs
│ │ ├── CompressedBitmapFormat.cs
│ │ ├── IBitmap.cs
│ │ └── IBitmapLoader.cs
│ ├── Colors
│ │ ├── KnownColor.cs
│ │ ├── KnownColors.cs
│ │ ├── SplatColor.KnownColors.cs
│ │ └── SplatColor.cs
│ ├── DefaultPlatformModeDetector.cs
│ ├── IPlatformModeDetector.cs
│ ├── PlatformModeDetector.cs
│ ├── Platforms
│ │ ├── Android
│ │ │ ├── Bitmaps
│ │ │ │ ├── AndroidBitmap.cs
│ │ │ │ ├── BitmapMixins.cs
│ │ │ │ ├── DrawableBitmap.cs
│ │ │ │ └── PlatformBitmapLoader.cs
│ │ │ ├── Colors
│ │ │ │ ├── ColorExtensions.cs
│ │ │ │ └── SplatColorExtensions.cs
│ │ │ └── Maths
│ │ │ │ ├── PointExtensions.cs
│ │ │ │ └── RectExtensions.cs
│ │ ├── BindingFlags.cs
│ │ ├── Cocoa
│ │ │ ├── Bitmaps
│ │ │ │ ├── BitmapMixins.cs
│ │ │ │ ├── CocoaBitmap.cs
│ │ │ │ └── PlatformBitmapLoader.cs
│ │ │ └── Colors
│ │ │ │ └── SplatColorExtensions.cs
│ │ ├── ReflectionStubs.cs
│ │ ├── ServiceLocationDrawingInitialization.cs
│ │ ├── Tizen
│ │ │ └── Bitmaps
│ │ │ │ ├── BitmapMixins.cs
│ │ │ │ ├── PlatformBitmapLoader.cs
│ │ │ │ └── TizenBitmap.cs
│ │ ├── TypeForwardedSystemDrawing.cs
│ │ ├── net4
│ │ │ ├── Bitmaps
│ │ │ │ ├── BitmapMixins.cs
│ │ │ │ ├── BitmapSourceBitmap.cs
│ │ │ │ └── PlatformBitmapLoader.cs
│ │ │ ├── Colors
│ │ │ │ ├── ColorExtensions.cs
│ │ │ │ └── SplatColorExtensions.cs
│ │ │ └── Maths
│ │ │ │ ├── PointExtensions.cs
│ │ │ │ ├── RectExtensions.cs
│ │ │ │ └── SizeExtensions.cs
│ │ ├── net6
│ │ │ ├── Bitmaps
│ │ │ │ ├── BitmapMixins.cs
│ │ │ │ ├── BitmapSourceBitmap.cs
│ │ │ │ └── PlatformBitmapLoader.cs
│ │ │ ├── Colors
│ │ │ │ ├── ColorExtensions.cs
│ │ │ │ └── SplatColorExtensions.cs
│ │ │ └── Maths
│ │ │ │ ├── PointExtensions.cs
│ │ │ │ ├── RectExtensions.cs
│ │ │ │ └── SizeExtensions.cs
│ │ └── netcoreapp3
│ │ │ ├── Bitmaps
│ │ │ ├── BitmapMixins.cs
│ │ │ ├── BitmapSourceBitmap.cs
│ │ │ └── PlatformBitmapLoader.cs
│ │ │ ├── Colors
│ │ │ ├── ColorExtensions.cs
│ │ │ └── SplatColorExtensions.cs
│ │ │ └── Maths
│ │ │ ├── PointExtensions.cs
│ │ │ ├── RectExtensions.cs
│ │ │ └── SizeExtensions.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ └── Resource.designer.cs
│ └── Splat.Drawing.csproj
├── Splat.DryIoc.Tests
│ ├── DependencyResolverTests.cs
│ └── Splat.DryIoc.Tests.csproj
├── Splat.DryIoc
│ ├── DryIocDependencyResolver.cs
│ ├── README.md
│ ├── Splat.DryIoc.csproj
│ └── SplatDryIocExtensions.cs
├── Splat.Exceptionless
│ ├── ExceptionlessFeatureUsageTrackingSession.cs
│ ├── ExceptionlessSplatLogger.cs
│ ├── ExceptionlessViewTracking.cs
│ ├── MutableDependencyResolverExtensions.cs
│ └── Splat.Exceptionless.csproj
├── Splat.Log4Net
│ ├── Log4NetLogger.cs
│ ├── LogResolver.cs
│ ├── MutableDependencyResolverExtensions.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Splat.Log4Net.csproj
├── Splat.Microsoft.Extensions.DependencyInjection.Tests
│ ├── ContainerWrapper.cs
│ ├── DependencyResolverTests.cs
│ ├── MicrosoftDependencyResolverTests.cs
│ └── Splat.Microsoft.Extensions.DependencyInjection.Tests.csproj
├── Splat.Microsoft.Extensions.DependencyInjection
│ ├── MicrosoftDependencyResolver.cs
│ ├── README.md
│ ├── Splat.Microsoft.Extensions.DependencyInjection.csproj
│ └── SplatMicrosoftExtensions.cs
├── Splat.Microsoft.Extensions.Logging
│ ├── MicrosoftExtensionsLogProvider.cs
│ ├── MicrosoftExtensionsLoggingExtensions.cs
│ ├── MicrosoftExtensionsLoggingLogger.cs
│ ├── MsLoggingHelpers.cs
│ └── Splat.Microsoft.Extensions.Logging.csproj
├── Splat.NLog
│ ├── LogResolver.cs
│ ├── MutableDependencyResolverExtensions.cs
│ ├── NLogLogger.cs
│ └── Splat.NLog.csproj
├── Splat.Ninject.Tests
│ ├── DependencyResolverTests.cs
│ ├── NInjectDependencyResolverTests.cs
│ └── Splat.Ninject.Tests.csproj
├── Splat.Ninject
│ ├── NinjectDependencyResolver.cs
│ ├── README.md
│ ├── Splat.Ninject.csproj
│ └── SplatNinjectExtensions.cs
├── Splat.Prism.Forms
│ ├── PrismApplication.cs
│ └── Splat.Prism.Forms.csproj
├── Splat.Prism.Tests
│ ├── DependencyResolverTests.cs
│ └── Splat.Prism.Tests.csproj
├── Splat.Prism
│ ├── Splat.Prism.csproj
│ └── SplatContainerExtension.cs
├── Splat.Raygun
│ ├── RaygunFeatureUsageTrackingSession.cs
│ └── Splat.Raygun.csproj
├── Splat.Serilog
│ ├── MutableDependencyResolverExtensions.cs
│ ├── Registration.cs
│ ├── SerilogFullLogger.cs
│ ├── SerilogHelper.cs
│ └── Splat.Serilog.csproj
├── Splat.SimpleInjector.Tests
│ ├── DependencyResolverTests.cs
│ ├── Splat.SimpleInjector.Tests.csproj
│ └── xunit.runner.json
├── Splat.SimpleInjector
│ ├── README.md
│ ├── SimpleInjectorDependencyResolver.cs
│ ├── SimpleInjectorInitializer.cs
│ ├── Splat.SimpleInjector.csproj
│ ├── SplatSimpleInjectorExtensions.cs
│ └── TransientSimpleInjectorRegistration.cs
├── Splat.TestRunner.Android
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── MainActivity.cs
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── AboutResources.txt
│ │ ├── layout
│ │ │ ├── activity_main.xml
│ │ │ └── content_main.xml
│ │ ├── menu
│ │ │ └── menu_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_foreground.png
│ │ │ └── ic_launcher_round.png
│ │ └── values
│ │ │ ├── Strings.xml
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ └── styles.xml
│ └── Splat.TestRunner.Android.csproj
├── Splat.TestRunner.Uwp
│ ├── Assets
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ ├── StoreLogo.png
│ │ └── Wide310x150Logo.scale-200.png
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ ├── Splat.TestRunner.Uwp.GeneratedMSBuildEditorConfig.editorconfig
│ ├── Splat.TestRunner.Uwp.csproj
│ ├── UnitTestApp.xaml
│ └── UnitTestApp.xaml.cs
├── Splat.Tests
│ ├── API
│ │ ├── ApiApprovalTests.SplatProject.DotNet6_0.verified.txt
│ │ ├── ApiApprovalTests.SplatProject.DotNet7_0.verified.txt
│ │ ├── ApiApprovalTests.SplatProject.DotNet8_0.verified.txt
│ │ ├── ApiApprovalTests.SplatProject.DotNet9_0.verified.txt
│ │ └── ApiApprovalTests.cs
│ ├── ApiExtensions.cs
│ ├── ApplicationPerformanceMonitoring
│ │ ├── AppCenterFeatureUsageTrackingSessionTests.cs
│ │ ├── AppCenterViewTrackingTests.cs
│ │ ├── ApplicationInsightsFeatureUsageTrackingSessionTests.cs
│ │ ├── ApplicationInsightsViewTrackingTests.cs
│ │ ├── BaseFeatureUsageTrackingTests.cs
│ │ ├── BaseViewTrackingTests.cs
│ │ ├── EnableFeatureUsageTrackingExtensionsTests.cs
│ │ ├── ExceptionlessFeatureUsageTrackingSessionTests.cs
│ │ └── RaygunFeatureUsageTrackingSessionTests.cs
│ ├── LocatorSerialRegisterTests.cs
│ ├── LocatorTests.cs
│ ├── Logging
│ │ ├── ActionLoggerTests.cs
│ │ ├── BaseTests
│ │ │ ├── AllocateFreeErrorLoggerTestBase.cs
│ │ │ ├── AllocationFreeLoggerBaseTestBase.cs
│ │ │ ├── FullLoggerTestBase.cs
│ │ │ ├── LoggerBase.cs
│ │ │ └── WrappingFullLoggerTestBase.cs
│ │ ├── FullLoggers
│ │ │ ├── NLogLoggerTests.cs
│ │ │ └── SerilogLoggerTests.cs
│ │ ├── Helpers
│ │ │ └── FormatHelper.cs
│ │ ├── StaticLoggerTests.cs
│ │ ├── WrappingFullLoggers
│ │ │ ├── ConsoleLoggerTests.cs
│ │ │ ├── ExceptionlessLoggerTests.cs
│ │ │ ├── Log4NetLoggerTests.cs
│ │ │ └── MicrosoftExtensionsLoggingLoggerTests.cs
│ │ └── WrappingPrefixLoggerTests.cs
│ ├── MemoizingMRUCacheTests.cs
│ ├── Mocks
│ │ ├── IMockLogTarget.cs
│ │ └── TextLogger.cs
│ ├── ModeDetection
│ │ └── ModeTests.cs
│ ├── ServiceLocation
│ │ ├── BaseDependencyResolverTests.cs
│ │ └── ModernDependencyResolverTests.cs
│ ├── Splat.Tests.csproj
│ ├── TargetFrameworkExtensionsTests.cs
│ ├── XUnitHelpers.cs
│ ├── splatlogo.bmp
│ ├── splatlogo.jpg
│ ├── splatlogo.png
│ └── xunit.runner.json
├── Splat.sln
├── Splat
│ ├── ApplicationPerformanceMonitoring
│ │ ├── DefaultFeatureUsageTrackingManager.cs
│ │ ├── DefaultFeatureUsageTrackingSession.cs
│ │ ├── EnableFeatureUsageTrackingExtensions.cs
│ │ ├── FuncFeatureUsageTrackingManager.cs
│ │ ├── IEnableFeatureUsageTracking.cs
│ │ ├── IFeatureUsageTrackingManager.cs
│ │ ├── IFeatureUsageTrackingSession.cs
│ │ ├── IFeatureUsageTrackingSession{TReferenceType}.cs
│ │ └── IViewTracking.cs
│ ├── AssemblyFinder.cs
│ ├── Disposables
│ │ ├── ActionDisposable.cs
│ │ ├── BooleanDisposable.cs
│ │ └── CompositeDisposable.cs
│ ├── ExceptionMixins.cs
│ ├── Logging
│ │ ├── ActionLogger.cs
│ │ ├── AllocationFreeLoggerBase.cs
│ │ ├── ConsoleLogger.cs
│ │ ├── DebugLogger.cs
│ │ ├── DefaultLogManager.cs
│ │ ├── FullLoggerExtensions.cs
│ │ ├── FuncLogManager.cs
│ │ ├── IAllocationFreeErrorLogger.cs
│ │ ├── IAllocationFreeLogger.cs
│ │ ├── IEnableLogger.cs
│ │ ├── IFullLogger.cs
│ │ ├── ILogManager.cs
│ │ ├── ILogger.cs
│ │ ├── IStaticFullLogger.cs
│ │ ├── LogHost.cs
│ │ ├── LogLevel.cs
│ │ ├── LogManagerMixin.cs
│ │ ├── LoggingException.cs
│ │ ├── NullLogger.cs
│ │ ├── StaticFullLogger.cs
│ │ ├── WrappingFullLogger.cs
│ │ ├── WrappingLogLevelLogger.cs
│ │ └── WrappingPrefixLogger.cs
│ ├── Maths
│ │ ├── PointMathExtensions.cs
│ │ ├── RectEdge.cs
│ │ ├── RectangleMathExtensions.cs
│ │ └── SizeMathExtensions.cs
│ ├── MemoizingMRUCache.cs
│ ├── ModeDetection
│ │ ├── DefaultModeDetector.cs
│ │ ├── IModeDetector.cs
│ │ ├── Mode.cs
│ │ └── ModeDetector.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── ServiceLocation
│ │ ├── DependencyResolverMixins.cs
│ │ ├── FuncDependencyResolver.cs
│ │ ├── IDependencyResolver.cs
│ │ ├── IMutableDependencyResolver.cs
│ │ ├── IReadonlyDependencyResolver.cs
│ │ ├── InternalLocator.cs
│ │ ├── Locator.cs
│ │ ├── ModernDependencyResolver.cs
│ │ ├── NullServiceType.cs
│ │ ├── ResolverMixins.cs
│ │ └── ServiceLocationInitialization.cs
│ ├── Splat.csproj
│ └── TargetFrameworkExtensions.cs
└── stylecop.json
└── version.json
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Catch all for anything we forgot. Add rules if you get CRLF to LF warnings.
2 | * text=auto
3 |
4 | # Text files that should be normalized to LF in odb.
5 | *.cs text diff=csharp
6 | *.xaml text
7 | *.config text
8 | *.c text
9 | *.h text
10 | *.cpp text
11 | *.hpp text
12 |
13 | *.sln text
14 | *.csproj text
15 | *.vcxproj text
16 |
17 | *.md text
18 | *.tt text
19 | *.sh text
20 | *.ps1 text
21 | *.cmd text
22 | *.bat text
23 | *.markdown text
24 | *.msbuild text
25 |
26 |
27 | # Binary files that should not be normalized or diffed
28 | *.png binary
29 | *.jpg binary
30 | *.gif binary
31 | *.ico binary
32 | *.rc binary
33 |
34 | *.pfx binary
35 | *.snk binary
36 | *.dll binary
37 | *.exe binary
38 | *.lib binary
39 | *.exp binary
40 | *.pdb binary
41 | *.sdf binary
42 | *.7z binary
43 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # A CODEOWNERS file uses a pattern that follows the same rules used in gitignore files.
2 | # The pattern is followed by one or more GitHub usernames or team names using the
3 | # standard @username or @org/team-name format. You can also refer to a user by an
4 | # email address that has been added to their GitHub account, for example user@example.com
5 |
6 | .github/* @reactiveui/maintainers
7 |
8 | * @reactiveui/splat-team
9 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: "[BUG] Summary of item"
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | Please note although we can't commit to any timeline, priority will be given to those who are [Contributors](https://github.com/reactiveui/splat#contribute ) to the project.
11 |
12 | If this is a question please ask on [StackOverflow](https://stackoverflow.com/questions/tagged/splat).
13 |
14 | **Describe the bug**
15 | A clear and concise description of what the bug is.
16 |
17 | **Steps To Reproduce**
18 | Provide the steps to reproduce the behavior:
19 | 1. Go to '...'
20 | 2. Click on '....'
21 | 3. Scroll down to '....'
22 | 4. See error
23 |
24 | **Expected behavior**
25 | A clear and concise description of what you expected to happen.
26 |
27 | **Screenshots**
28 | If applicable, add screenshots to help explain your problem.
29 |
30 | **Environment(please complete the following information):**
31 | - OS: [e.g. iOS]
32 | - Version [e.g. 22]
33 | - Device: [e.g. iPhone6]
34 |
35 | **Additional context**
36 | Add any other context about the problem here.
37 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: Feature
6 | assignees: ''
7 |
8 | ---
9 |
10 | Please note although we can't commit to any timeline, priority will be given to those who are [Contributors](https://github.com/reactiveui/splat#contribute ) to the project.
11 |
12 | If this is a question please ask on [StackOverflow](https://stackoverflow.com/questions/tagged/splat).
13 |
14 | **Is your feature request related to a problem? Please describe.**
15 | A clear and concise description of what the problem is.
16 |
17 | **Describe the solution you'd like**
18 | A clear and concise description of what you want to happen.
19 |
20 | **Describe alternatives you've considered**
21 | A clear and concise description of any alternative solutions or features you've considered.
22 |
23 | **Describe suggestions on how to achieve the feature**
24 | A clear description to how to achieve the feature.
25 |
26 | **Additional context**
27 | Add any other context or screenshots about the feature request here.
28 |
--------------------------------------------------------------------------------
/.github/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": ["local>reactiveui/.github:renovate"]
4 | }
5 |
--------------------------------------------------------------------------------
/.github/workflows/ci-build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | pull_request:
7 | branches: [ main ]
8 |
9 | env:
10 | productNamespacePrefix: "Splat"
11 |
12 | jobs:
13 | build:
14 | uses: reactiveui/actions-common/.github/workflows/workflow-common-setup-and-build.yml@main
15 | with:
16 | configuration: Release
17 | productNamespacePrefix: "Splat"
18 |
--------------------------------------------------------------------------------
/.github/workflows/lock.yml:
--------------------------------------------------------------------------------
1 | name: 'Lock Threads'
2 |
3 | on:
4 | schedule:
5 | - cron: '0 0 * * *'
6 | workflow_dispatch:
7 |
8 | permissions:
9 | issues: write
10 | pull-requests: write
11 |
12 | concurrency:
13 | group: lock
14 |
15 | jobs:
16 | action:
17 | runs-on: ubuntu-latest
18 | steps:
19 | - uses: dessant/lock-threads@v5
20 | with:
21 | github-token: ${{ github.token }}
22 | issue-inactive-days: '14'
23 | pr-inactive-days: '14'
24 | issue-comment: >
25 | This issue has been automatically locked since there
26 | has not been any recent activity after it was closed.
27 | Please open a new issue for related bugs.
28 | pr-comment: >
29 | This pull request has been automatically locked since there
30 | has not been any recent activity after it was closed.
31 | Please open a new issue for related bugs.
32 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 |
7 | jobs:
8 | release:
9 | uses: reactiveui/actions-common/.github/workflows/workflow-common-release.yml@main
10 | with:
11 | productNamespacePrefix: "Splat"
12 | secrets:
13 | SIGN_ACCOUNT_NAME: ${{ secrets.SIGN_ACCOUNT_NAME }}
14 | SIGN_PROFILE_NAME: ${{ secrets.SIGN_PROFILE_NAME }}
15 | AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
16 | AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
17 | AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
18 | NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
19 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Code of Conduct
2 |
3 | If you’re being harassed, noticed someone else being harassed, or have any other concerns, please contact us immediately. Your reports will be taken seriously and will not be dismissed or argued with. All members, committers and volunteers in this community are required to act according to the [Code of Conduct](https://reactiveui.net/code-of-conduct/).
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) ReactiveUI 2018 - 2025
4 |
5 | All rights reserved.
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
24 |
--------------------------------------------------------------------------------
/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/reactiveui/splat/f449faa86406086ebd3e588f723c8f03f31fff75/images/logo.png
--------------------------------------------------------------------------------
/src/Benchmarks/Directory.Packages.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | true
5 |
6 |
7 |
8 |
9 |
10 |
11 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Benchmarks/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
2 | // Licensed to the .NET Foundation under one or more agreements.
3 | // The .NET Foundation licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System;
7 | using BenchmarkDotNet.Running;
8 |
9 | namespace Splat.Benchmarks
10 | {
11 | ///
12 | /// Class which hosts the main entry point into the application.
13 | ///
14 | public static class Program
15 | {
16 | ///
17 | /// The main entry point into the benchmarking application.
18 | ///
19 | /// Arguments from the command line.
20 | public static void Main(string[] args)
21 | {
22 | var results = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
23 | foreach (var result in results)
24 | {
25 | Console.WriteLine(result);
26 | }
27 |
28 | Console.ReadLine();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Benchmarks/Splat.Benchmarks.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | net6.0
5 | AnyCPU
6 | pdbonly
7 | true
8 | Exe
9 | ;1591;1701;1702;1705;CA1822
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Benchmarks/ViewModel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
2 | // Licensed to the .NET Foundation under one or more agreements.
3 | // The .NET Foundation licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | namespace Splat.Benchmarks
7 | {
8 | ///
9 | /// A plain object for registration.
10 | ///
11 | public class ViewModel
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Directory.build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(AssemblyName) ($(TargetFramework))
4 | false
5 |
6 |
7 |
8 | $(DefineConstants);NET_45;XAML
9 |
10 |
11 | $(DefineConstants);TIZEN
12 |
13 |
14 | $(DefineConstants);MONO;UIKIT;COCOA;IOS
15 |
16 |
17 | $(DefineConstants);MONO;COCOA
18 |
19 |
20 | $(DefineConstants);MONO;UIKIT;COCOA;TVOS
21 |
22 |
23 | $(DefineConstants);MONO;UIKIT;COCOA;MACCATALYST
24 |
25 |
26 | $(DefineConstants);MONO;ANDROID
27 |
28 |
29 | $(DefineConstants);IS_SHARED_NET
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/ReactiveUI.DI.Tests/DryIocReactiveUIDependencyTests.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
2 | // Licensed to the .NET Foundation under one or more agreements.
3 | // The .NET Foundation licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using DryIoc;
7 |
8 | using FluentAssertions;
9 |
10 | using Splat.DryIoc;
11 |
12 | namespace ReactiveUI.DI.Tests;
13 |
14 | ///
15 | /// DryIoc ReactiveUI Dependency Tests.
16 | ///
17 | public class DryIocReactiveUIDependencyTests
18 | {
19 | ///
20 | /// DyyIoC dependency resolver should register reactive UI creates command binding.
21 | ///
22 | [Fact]
23 | public void DryIocDependencyResolverShouldRegisterReactiveUI()
24 | {
25 | // Invoke RxApp which initializes the ReactiveUI platform.
26 | var container = new Container();
27 |
28 | var locator = new DryIocDependencyResolver(container);
29 | locator.RegisterViewsForViewModels(typeof(ViewWithViewContractThatShouldNotLoad).Assembly);
30 | locator.InitializeReactiveUI();
31 |
32 | var converters = container.Resolve>().ToList();
33 |
34 | converters.Should().NotBeNull();
35 | converters.Should().Contain(x => x.GetType() == typeof(CreatesCommandBindingViaEvent));
36 | converters.Should().Contain(x => x.GetType() == typeof(CreatesCommandBindingViaCommandParameter));
37 |
38 | var convertersb = container.Resolve>().ToList();
39 |
40 | convertersb.Should().NotBeNull();
41 | convertersb.Should().Contain(x => x.GetType() == typeof(StringConverter));
42 | convertersb.Should().Contain(x => x.GetType() == typeof(EqualityTypeConverter));
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/ReactiveUI.DI.Tests/Mocks/ActivatingViewModel.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
2 | // Licensed to the .NET Foundation under one or more agreements.
3 | // The .NET Foundation licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Reactive.Disposables;
7 |
8 | namespace ReactiveUI.DI.Tests.Mocks;
9 |
10 | ///
11 | /// ActivatingViewModel.
12 | ///
13 | ///
14 | public class ActivatingViewModel : ReactiveObject, IActivatableViewModel
15 | {
16 | ///
17 | /// Initializes a new instance of the class.
18 | ///
19 | public ActivatingViewModel()
20 | {
21 | Activator = new();
22 |
23 | this.WhenActivated(d =>
24 | {
25 | IsActiveCount++;
26 | d(Disposable.Create(() => IsActiveCount--));
27 | });
28 | }
29 |
30 | ///
31 | /// Gets the Activator which will be used by the View when Activation/Deactivation occurs.
32 | ///
33 | public ViewModelActivator Activator { get; }
34 |
35 | ///
36 | /// Gets or sets the active count.
37 | ///
38 | public int IsActiveCount { get; protected set; }
39 | }
40 |
--------------------------------------------------------------------------------
/src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net472;net8.0;net9.0
4 | $(NoWarn);1591;CA1707;SA1633;CA2000;CA1515
5 | false
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/ReactiveUI.DI.Tests/ViewWithViewContractThatShouldNotLoad.cs:
--------------------------------------------------------------------------------
1 | using Splat.Common.Test;
2 |
3 | namespace ReactiveUI.DI.Tests;
4 |
5 | ///
6 | /// This is a test view relating to issue #889.
7 | /// It's intended to ensure that view registration by different DI\IoC implementations
8 | /// does not create an instance at the point of registration.
9 | ///
10 | [ViewContract("somecontract")]
11 | public sealed class ViewWithViewContractThatShouldNotLoad : IViewFor
12 | {
13 | ///
14 | /// Initializes a new instance of the class.
15 | ///
16 | public ViewWithViewContractThatShouldNotLoad() => throw new InvalidOperationException("This view should not be created.");
17 |
18 | ///
19 | object? IViewFor.ViewModel
20 | {
21 | get => ViewModel;
22 | set => ViewModel = (ViewModelOne?)value;
23 | }
24 |
25 | ///
26 | public ViewModelOne? ViewModel { get; set; }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Splat.AppCenter/AppCenterViewTracking.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using Splat.ApplicationPerformanceMonitoring;
7 |
8 | namespace Splat;
9 |
10 | ///
11 | /// View Tracking integration for AppCenter.
12 | ///
13 | public sealed class AppCenterViewTracking : IViewTracking
14 | {
15 | ///
16 | /// Track a view navigation using just a name.
17 | ///
18 | /// Name of the view.
19 | public void OnViewNavigation(string name) =>
20 | Microsoft.AppCenter.Analytics.Analytics.TrackEvent("PageView", GetProperties(name));
21 |
22 | private static Dictionary GetProperties(string name) =>
23 | new() { { "Name", name }, };
24 | }
25 |
--------------------------------------------------------------------------------
/src/Splat.AppCenter/Splat.AppCenter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0;$(SplatWindowsTargetFrameworks)
4 |
5 | Splat.AppCenter
6 | Splat
7 | .NET Foundation and Contributors
8 | Visual Studio AppCenter integrations for Splat
9 | Splat.AppCenter
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Splat.ApplicationInsights/ApplicationInsightsViewTracking.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using Microsoft.ApplicationInsights;
7 | using Microsoft.ApplicationInsights.DataContracts;
8 | using Splat.ApplicationPerformanceMonitoring;
9 |
10 | namespace Splat;
11 |
12 | ///
13 | /// View Tracking integration for Application Insights.
14 | ///
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | /// The Application Insights telemetry client instance to use.
19 | public sealed class ApplicationInsightsViewTracking(TelemetryClient telemetryClient) : IViewTracking
20 | {
21 | private readonly TelemetryClient _telemetryClient = telemetryClient;
22 |
23 | ///
24 | /// Track a view navigation using just a name.
25 | ///
26 | /// Name of the view.
27 | public void OnViewNavigation(string name) => _telemetryClient.TrackPageView(name);
28 |
29 | ///
30 | /// Track a View Navigation with Extended Data.
31 | ///
32 | /// Telemetry data.
33 | public void OnViewNavigation(PageViewTelemetry telemetry)
34 | {
35 | _ = GetPageViewTelemetry();
36 | _telemetryClient.TrackPageView(telemetry);
37 | }
38 |
39 | internal static PageViewTelemetry GetPageViewTelemetry() => new();
40 | }
41 |
--------------------------------------------------------------------------------
/src/Splat.ApplicationInsights/Splat.ApplicationInsights.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(SplatTargetFrameworks)
4 | $(TargetFrameworks);net462
5 | Splat.ApplicationInsights
6 | Splat
7 | .NET Foundation and Contributors
8 | ApplicationInsights integrations for Splat
9 | Splat.ApplicationInsights
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Splat.Autofac.Tests/Splat.Autofac.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0-windows10.0.17763.0;net9.0-windows10.0.17763.0
5 |
6 | false
7 | $(NoWarn);1591;CA1707;SA1633;CA2000;CA1851
8 | enable
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Always
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Splat.Autofac.Tests/xunit.runner.json:
--------------------------------------------------------------------------------
1 | {
2 | "shadowCopy": false
3 | }
4 |
--------------------------------------------------------------------------------
/src/Splat.Autofac/Splat.Autofac.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(SplatTargetFrameworks)
4 | $(TargetFrameworks);net462
5 | Autofac adapter for Splat
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Splat.Autofac/SplatAutofacExtensions.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using Autofac;
7 |
8 | namespace Splat.Autofac;
9 |
10 | ///
11 | /// Extension methods for the Autofac adapter.
12 | ///
13 | public static class SplatAutofacExtensions
14 | {
15 | ///
16 | /// Initializes an instance of that overrides the default .
17 | ///
18 | /// Autofac container builder.
19 | /// The Autofac dependency resolver.
20 | public static AutofacDependencyResolver UseAutofacDependencyResolver(this ContainerBuilder builder)
21 | {
22 | var autofacResolver = new AutofacDependencyResolver(builder);
23 | Locator.SetLocator(autofacResolver);
24 | return autofacResolver;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Autofac/Splat.Avalonia.Autofac.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(SplatTargetFrameworks)
4 | enable
5 | enable
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.DryIoc/Splat.Avalonia.DryIoc.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(SplatTargetFrameworks)
4 | enable
5 | enable
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.DryIoc1.Tests/AvaloniaUIThreadTestsDryIoc.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Avalonia;
6 | using Avalonia.ReactiveUI;
7 | using Avalonia.ReactiveUI.Splat;
8 | using DryIoc;
9 | using ReactiveUIDemo;
10 | using Splat;
11 | using Splat.DryIoc;
12 |
13 | namespace ReactiveUI.Avalonia.DryIoc1.Tests
14 | {
15 | public class AvaloniaUIThreadTestsDryIoc
16 | {
17 | #if DRYIOC1
18 | [Fact]
19 | public void Test1()
20 | {
21 | DryIocDependencyResolver? container = default;
22 | DryIocDependencyResolver? resolver = default;
23 | AppBuilder.Configure()
24 | .UsePlatformDetect()
25 | .UseReactiveUIWithDIContainer(() => new(), con => container = con, res => resolver = res)
26 | .LogToTrace()
27 | .SetupWithoutStarting();
28 | Assert.IsType(RxApp.MainThreadScheduler);
29 | Assert.NotNull(container);
30 | Assert.NotNull(resolver);
31 | Assert.IsType(Locator.Current);
32 | }
33 | #endif
34 | #if DRYIOC2
35 | [Fact]
36 | public void Test2()
37 | {
38 | Container? container = default;
39 | AppBuilder.Configure()
40 | .UsePlatformDetect()
41 | .UseReactiveUIWithDryIoc(con => container = con)
42 | .LogToTrace()
43 | .SetupWithoutStarting();
44 | Assert.IsType(RxApp.MainThreadScheduler);
45 | Assert.NotNull(container);
46 | Assert.IsType(Locator.Current);
47 | }
48 | #endif
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Microsoft.Extensions.DependencyInjection/Splat.Avalonia.Microsoft.Extensions.DependencyInjection.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(SplatTargetFrameworks)
4 | enable
5 | enable
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Ninject/Splat.Avalonia.Ninject.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(SplatTargetFrameworks)
4 | enable
5 | enable
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/AvaloniaUIThreadTestsMain.cs:
--------------------------------------------------------------------------------
1 | namespace ReactiveUI.Avalonia.Tests
2 | {
3 | public class AvaloniaUIThreadTestsMain
4 | {
5 | ////[Fact]
6 | ////public void Test1()
7 | ////{
8 | ////AppBuilder.Configure()
9 | //// .UsePlatformDetect()
10 | //// .UseReactiveUI()
11 | //// .LogToTrace()
12 | //// .SetupWithoutStarting();
13 | ////Assert.IsType(RxApp.MainThreadScheduler);
14 | ////}
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/App.axaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/App.axaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia;
2 | using Avalonia.Controls.ApplicationLifetimes;
3 | using Avalonia.Markup.Xaml;
4 | using ReactiveUI;
5 | using ReactiveUIDemo.ViewModels;
6 | using ReactiveUIDemo.Views;
7 | using Splat;
8 |
9 | namespace ReactiveUIDemo
10 | {
11 | public class App : Application
12 | {
13 | public override void Initialize()
14 | {
15 | AvaloniaXamlLoader.Load(this);
16 | Locator.CurrentMutable.Register(() => new FooView(), typeof(IViewFor));
17 | Locator.CurrentMutable.Register(() => new BarView(), typeof(IViewFor));
18 | }
19 |
20 | public override void OnFrameworkInitializationCompleted()
21 | {
22 | if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
23 | {
24 | desktop.MainWindow = new MainWindow();
25 | }
26 |
27 | base.OnFrameworkInitializationCompleted();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/MainWindow.axaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/MainWindow.axaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 | using ReactiveUIDemo.ViewModels;
4 |
5 | namespace ReactiveUIDemo
6 | {
7 | public partial class MainWindow : Window
8 | {
9 | public MainWindow()
10 | {
11 | InitializeComponent();
12 | DataContext = new MainWindowViewModel();
13 | }
14 |
15 | private void InitializeComponent() => AvaloniaXamlLoader.Load(this);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/ViewModels/BarViewModel.cs:
--------------------------------------------------------------------------------
1 | using ReactiveUI;
2 |
3 | namespace ReactiveUIDemo.ViewModels
4 | {
5 | internal sealed class BarViewModel(IScreen screen) : ReactiveObject, IRoutableViewModel
6 | {
7 | public string UrlPathSegment => "Bar";
8 |
9 | public IScreen HostScreen { get; } = screen;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/ViewModels/FooViewModel.cs:
--------------------------------------------------------------------------------
1 | using ReactiveUI;
2 |
3 | namespace ReactiveUIDemo.ViewModels
4 | {
5 | internal sealed class FooViewModel(IScreen screen) : ReactiveObject, IRoutableViewModel
6 | {
7 | public string UrlPathSegment => "Foo";
8 |
9 | public IScreen HostScreen { get; } = screen;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/ViewModels/MainWindowViewModel.cs:
--------------------------------------------------------------------------------
1 | using ReactiveUI;
2 |
3 | namespace ReactiveUIDemo.ViewModels
4 | {
5 | internal sealed class MainWindowViewModel : ReactiveObject
6 | {
7 | public RoutedViewHostPageViewModel RoutedViewHost { get; } = new();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/ViewModels/RoutedViewHostPageViewModel.cs:
--------------------------------------------------------------------------------
1 | using ReactiveUI;
2 |
3 | namespace ReactiveUIDemo.ViewModels
4 | {
5 | internal sealed class RoutedViewHostPageViewModel : ReactiveObject, IScreen
6 | {
7 | public RoutedViewHostPageViewModel()
8 | {
9 | Foo = new(this);
10 | Bar = new(this);
11 | Router.Navigate.Execute(Foo);
12 | }
13 |
14 | public RoutingState Router { get; } = new();
15 |
16 | public FooViewModel Foo { get; }
17 |
18 | public BarViewModel Bar { get; }
19 |
20 | public void ShowFoo() => Router.Navigate.Execute(Foo);
21 |
22 | public void ShowBar() => Router.Navigate.Execute(Bar);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/Views/BarView.axaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
13 | Bar!
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/Views/BarView.axaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 | using ReactiveUI;
4 | using ReactiveUIDemo.ViewModels;
5 |
6 | namespace ReactiveUIDemo.Views
7 | {
8 | internal sealed partial class BarView : UserControl, IViewFor
9 | {
10 | public BarView() => InitializeComponent();
11 |
12 | public BarViewModel? ViewModel { get; set; }
13 |
14 | object? IViewFor.ViewModel
15 | {
16 | get => ViewModel;
17 | set => ViewModel = (BarViewModel?)value;
18 | }
19 |
20 | private void InitializeComponent() => AvaloniaXamlLoader.Load(this);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/Views/FooView.axaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
13 | Foo!
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Mocks/Views/FooView.axaml.cs:
--------------------------------------------------------------------------------
1 | using Avalonia.Controls;
2 | using Avalonia.Markup.Xaml;
3 | using ReactiveUI;
4 | using ReactiveUIDemo.ViewModels;
5 |
6 | namespace ReactiveUIDemo.Views
7 | {
8 | internal sealed partial class FooView : UserControl, IViewFor
9 | {
10 | public FooView() => InitializeComponent();
11 |
12 | public FooViewModel? ViewModel { get; set; }
13 |
14 | object? IViewFor.ViewModel
15 | {
16 | get => ViewModel;
17 | set => ViewModel = (FooViewModel?)value;
18 | }
19 |
20 | private void InitializeComponent() => AvaloniaXamlLoader.Load(this);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0;net9.0
4 | enable
5 | enable
6 | $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000;CA1515
7 | false
8 | true
9 | $(DefineConstants);MAIN
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/DummyObjectClass1.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | namespace Splat.Tests.Mocks;
9 |
10 | ///
11 | /// A dummy class used during Locator testing.
12 | ///
13 | [ExcludeFromCodeCoverage]
14 | public class DummyObjectClass1 : IDummyInterface
15 | {
16 | }
17 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/DummyObjectClass2.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | namespace Splat.Tests.Mocks;
9 |
10 | ///
11 | /// A dummy class used during Locator testing.
12 | ///
13 | [ExcludeFromCodeCoverage]
14 | public class DummyObjectClass2 : IDummyInterface
15 | {
16 | }
17 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/DummyObjectClass3.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | namespace Splat.Tests.Mocks;
9 |
10 | ///
11 | /// A dummy class used during Locator testing.
12 | ///
13 | [ExcludeFromCodeCoverage]
14 | public class DummyObjectClass3 : IDummyInterface
15 | {
16 | }
17 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/IDummyInterface.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | namespace Splat.Tests.Mocks;
7 |
8 | ///
9 | /// A dummy interface used during Locator testing.
10 | ///
11 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1040:Avoid empty interfaces", Justification = "By Design")]
12 | public interface IDummyInterface
13 | {
14 | }
15 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/IScreen.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | namespace Splat.Common.Test;
7 |
8 | ///
9 | /// Represents a screen.
10 | ///
11 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1040:Avoid empty interfaces", Justification = "By Design")]
12 | public interface IScreen
13 | {
14 | }
15 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/IViewFor.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | namespace Splat.Common.Test;
7 |
8 | #pragma warning disable SA1402 // File may only contain a single type
9 |
10 | ///
11 | /// Represents a view bound to a view model.
12 | ///
13 | /// The view model type.
14 | ///
15 | public interface IViewFor : IViewFor
16 | where T : class
17 | {
18 | ///
19 | /// Gets or sets the view model.
20 | ///
21 | new T? ViewModel { get; set; }
22 | }
23 |
24 | ///
25 | /// Represents a view bound to a view model.
26 | ///
27 | ///
28 | public interface IViewFor
29 | {
30 | ///
31 | /// Gets or sets the view model.
32 | ///
33 | object? ViewModel { get; set; }
34 | }
35 |
36 | #pragma warning restore SA1402 // File may only contain a single type
37 |
38 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/IViewModelOne.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | namespace Splat.Common.Test;
7 |
8 | ///
9 | /// Interface for ViewModelOne.
10 | ///
11 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1040:Avoid empty interfaces", Justification = "By Design")]
12 | public interface IViewModelOne
13 | {
14 | }
15 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/MockScreen.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | namespace Splat.Common.Test;
9 |
10 | ///
11 | /// An implementation.
12 | ///
13 | ///
14 | [ExcludeFromCodeCoverage]
15 | public class MockScreen : IScreen
16 | {
17 | }
18 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/Splat.Common.Test.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0;net8.0;net9.0
5 | $(NoWarn);CA2000
6 | enable
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/ViewModelOne.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | namespace Splat.Common.Test;
9 |
10 | ///
11 | /// View Model One.
12 | ///
13 | [ExcludeFromCodeCoverage]
14 | public class ViewModelOne : IViewModelOne
15 | {
16 | ///
17 | /// Initializes a new instance of the class.
18 | ///
19 | public ViewModelOne()
20 | {
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/ViewModelTwo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | namespace Splat.Common.Test;
9 |
10 | ///
11 | /// View Model Two.
12 | ///
13 | [ExcludeFromCodeCoverage]
14 | public class ViewModelTwo
15 | {
16 | }
17 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/ViewOne.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | namespace Splat.Common.Test;
9 |
10 | ///
11 | /// View One.
12 | ///
13 | ///
14 | [ExcludeFromCodeCoverage]
15 | public class ViewOne : IViewFor
16 | {
17 | ///
18 | object? IViewFor.ViewModel
19 | {
20 | get => ViewModel;
21 | set => ViewModel = (ViewModelOne?)value;
22 | }
23 |
24 | ///
25 | public ViewModelOne? ViewModel { get; set; }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/ViewThatShouldNotLoad.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | namespace Splat.Common.Test;
7 |
8 | ///
9 | /// This is a test view relating to issue #889.
10 | /// It's intended to ensure that view registration by different DI\IoC implementations
11 | /// does not create an instance at the point of registration.
12 | ///
13 | public sealed class ViewThatShouldNotLoad : IViewFor
14 | {
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | public ViewThatShouldNotLoad() => throw new InvalidOperationException("This view should not be created.");
19 |
20 | ///
21 | object? IViewFor.ViewModel
22 | {
23 | get => ViewModel;
24 | set => ViewModel = (ViewModelOne?)value;
25 | }
26 |
27 | ///
28 | public ViewModelOne? ViewModel { get; set; }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Splat.Common.Test/ViewTwo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2025 ReactiveUI. All rights reserved.
2 | // Licensed to ReactiveUI under one or more agreements.
3 | // ReactiveUI licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | namespace Splat.Common.Test;
9 |
10 | ///
11 | /// View Two.
12 | ///
13 | ///
14 | [ExcludeFromCodeCoverage]
15 | public class ViewTwo : IViewFor
16 | {
17 | ///
18 | object? IViewFor.ViewModel
19 | {
20 | get => ViewModel;
21 | set => ViewModel = (ViewModelTwo?)value;
22 | }
23 |
24 | ///
25 | public ViewModelTwo? ViewModel { get; set; }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Splat.Drawing.Tests/API/ApiApprovalTests.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
2 | // Licensed to the .NET Foundation under one or more agreements.
3 | // The .NET Foundation licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | #pragma warning disable SA1615 // Element return value should be documented
9 |
10 | namespace Splat.Tests;
11 |
12 | ///
13 | /// Tests to make sure that the API matches the approved ones.
14 | ///
15 | [ExcludeFromCodeCoverage]
16 | public class ApiApprovalTests
17 | {
18 | ///
19 | /// Tests to make sure the splat project is approved.
20 | ///
21 | [Fact]
22 | public Task SplatUIProject() => typeof(IPlatformModeDetector).Assembly.CheckApproval(["Splat"]);
23 | }
24 |
--------------------------------------------------------------------------------
/src/Splat.Drawing.Tests/Colors/KnownColorTests.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
2 | // Licensed to the .NET Foundation under one or more agreements.
3 | // The .NET Foundation licenses this file to you under the MIT license.
4 | // See the LICENSE file in the project root for full license information.
5 |
6 | namespace Splat.Tests.Colors;
7 |
8 | ///
9 | /// Unit Tests for Known Color logic.
10 | ///
11 | public class KnownColorTests
12 | {
13 | ///
14 | /// Gets the test data for FromKnownColor.
15 | ///
16 | public static IEnumerable