├── .editorconfig ├── .github ├── renovate.json └── workflows │ ├── ci-build.yml │ ├── lock.yml │ └── release.yml ├── .gitignore ├── LICENSE ├── README.md ├── images └── logo.png ├── src ├── Directory.Packages.props ├── Directory.build.props ├── ReactiveUI.SourceGenerator.Tests │ ├── DERIVEDLIST │ │ └── BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs │ ├── ModuleInitializer.cs │ ├── OAPH │ │ ├── OAPFromObservableGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservableMethods#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservableMethods#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservableMethodsWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservableMethodsWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservableProp#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservableProp#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromPartialProperty#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPFromObservableGeneratorTests.FromPartialProperty#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs │ │ ├── OAPGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs │ │ ├── OAPGeneratorTests.FromFieldNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner1.ObservableAsProperties.g.verified.cs │ │ ├── OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsProperties.g.verified.cs │ │ ├── OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2.ObservableAsProperties.g.verified.cs │ │ ├── OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM.ObservableAsProperties.g.verified.cs │ │ ├── OAPGeneratorTests.NamedFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPGeneratorTests.NamedFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs │ │ ├── OAPGeneratorTests.NonReadOnlyFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ ├── OAPGeneratorTests.NonReadOnlyFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs │ │ ├── OAPGeneratorTests.NonReadOnlyFromFieldProtected#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs │ │ └── OAPGeneratorTests.NonReadOnlyFromFieldProtected#TestNs.TestVM.ObservableAsProperties.g.verified.cs │ ├── REACTIVE │ │ ├── ReactiveGeneratorTests.FromReactivePartialProperties#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePartialProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#TestNs.TestVM.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactiveProperties#TestNs.TestVM.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesCalledValue#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesCalledValue#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesCalledValue#TestNs.TestVM.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithAccess#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithAccess#TestNs.TestVM.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#TestNs.TestVM.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs1.TestVM.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs2.TestVM.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithInit#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithInit#TestNs.TestVM.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass1.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.verified.cs │ │ ├── ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2.Properties.g.verified.cs │ │ └── ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3.Properties.g.verified.cs │ ├── REACTIVECMD │ │ ├── ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs │ │ ├── ReactiveCMDGeneratorTests.FromReactiveAsyncCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs │ │ ├── ReactiveCMDGeneratorTests.FromReactiveCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs │ │ ├── ReactiveCMDGeneratorTests.FromReactiveCommandWithNestedClasses#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs │ │ ├── ReactiveCMDGeneratorTests.FromReactiveCommandWithOutputScheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs │ │ └── ReactiveCMDGeneratorTests.FromReactiveCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs │ ├── ReactiveUI.SourceGenerators.Tests.csproj │ ├── TestBase.cs │ ├── TestHelper.cs │ └── UnitTests │ │ ├── BindableDerivedListGeneratorTests.cs │ │ ├── OAPFromObservableGeneratorTests.cs │ │ ├── OAPGeneratorTests.cs │ │ ├── ReactiveCMDGeneratorTests.cs │ │ └── ReactiveGeneratorTests.cs ├── ReactiveUI.SourceGenerators.Analyzers.CodeFixes │ ├── AnalyzerReleases.Shipped.md │ ├── AnalyzerReleases.Unshipped.md │ ├── Core │ │ ├── Extensions │ │ │ ├── FieldSyntaxExtensions.cs │ │ │ ├── ISymbolExtensions.cs │ │ │ └── ITypeSymbolExtensions.cs │ │ ├── Generated │ │ │ └── PolySharp.SourceGenerators │ │ │ │ └── PolySharp.SourceGenerators.PolyfillsGenerator │ │ │ │ ├── System.Diagnostics.CodeAnalysis.NotNullWhenAttribute.g.cs │ │ │ │ └── System.Diagnostics.CodeAnalysis.UnscopedRefAttribute.g.cs │ │ └── Helpers │ │ │ ├── EquatableArray{T}.cs │ │ │ ├── HashCode.cs │ │ │ └── ImmutableArrayBuilder{T}.cs │ ├── Diagnostics │ │ ├── CodeFixers │ │ │ ├── PropertyToReactiveFieldAnalyzer.cs │ │ │ └── PropertyToReactiveFieldCodeFixProvider.cs │ │ └── DiagnosticDescriptors.cs │ └── ReactiveUI.SourceGenerators.Analyzers.CodeFixes.csproj ├── ReactiveUI.SourceGenerators.Execute.Maui │ ├── IViewForTest.cs │ ├── ReactiveUI.SourceGenerators.Execute.Maui.csproj │ └── TestViewModel.cs ├── ReactiveUI.SourceGenerators.Execute.Nested1 │ ├── Class1.cs │ └── ReactiveUI.SourceGenerators.Execute.Nested1.csproj ├── ReactiveUI.SourceGenerators.Execute.Nested2 │ ├── Class1.cs │ └── ReactiveUI.SourceGenerators.Execute.Nested2.csproj ├── ReactiveUI.SourceGenerators.Execute.Nested3 │ ├── Class1.cs │ ├── Nested4 │ │ └── Class1.cs │ └── ReactiveUI.SourceGenerators.Execute.Nested3.csproj ├── ReactiveUI.SourceGenerators.Execute │ ├── InternalTestViewModel.cs │ ├── Person.cs │ ├── Program.cs │ ├── ReactiveUI.SourceGenerators.Execute.csproj │ ├── TestAttribute.cs │ ├── TestClassOAPH_VM.cs │ ├── TestViewModel.cs │ ├── TestViewModel2.cs │ ├── TestViewModel3.cs │ ├── TestViewModel{partTwo}.cs │ ├── TestViewWinForms.Designer.cs │ ├── TestViewWinForms.cs │ ├── TestViewWinForms.resx │ ├── TestViewWpf.cs │ ├── TestViewWpf2.cs │ ├── TestWinFormsRCHost.Designer.cs │ ├── TestWinFormsRCHost.cs │ ├── TestWinFormsRCHost.resx │ ├── TestWinFormsVMCHost.Designer.cs │ ├── TestWinFormsVMCHost.cs │ └── TestWinFormsVMCHost.resx ├── ReactiveUI.SourceGenerators.Roslyn │ ├── AnalyzerReleases.Shipped.md │ ├── AnalyzerReleases.Unshipped.md │ ├── AttributeDefinitions.cs │ ├── BindableDerivedList │ │ ├── BindableDerivedListGenerator.Execute.cs │ │ ├── BindableDerivedListGenerator.cs │ │ └── Models │ │ │ └── BindableDerivedListInfo.cs │ ├── Core │ │ ├── Extensions │ │ │ ├── AttributeDataExtensions.cs │ │ │ ├── CompilationExtensions.cs │ │ │ ├── ContextExtensions.cs │ │ │ ├── DiagnosticsExtensions.cs │ │ │ ├── FieldSyntaxExtensions.cs │ │ │ ├── INamedTypeSymbolExtensions.cs │ │ │ ├── ISymbolExtensions.cs │ │ │ ├── ITypeSymbolExtensions.cs │ │ │ ├── SymbolInfoExtensions.cs │ │ │ ├── SyntaxTokenExtensions.cs │ │ │ └── SyntaxValueProviderExtensions.cs │ │ ├── Helpers │ │ │ ├── AttributeInfo.cs │ │ │ ├── EquatableArray{T}.cs │ │ │ ├── HashCode.cs │ │ │ ├── ImmutableArrayBuilder{T}.cs │ │ │ ├── SymbolHelpers.cs │ │ │ ├── TypedConstantInfo.Factory.cs │ │ │ └── TypedConstantInfo.cs │ │ └── Models │ │ │ ├── DiagnosticInfo.cs │ │ │ ├── GenericGeneratorAttributeSyntaxContext.cs │ │ │ ├── PropertyAttributeData.cs │ │ │ ├── Result.cs │ │ │ └── TargetInfo.cs │ ├── Diagnostics │ │ ├── DiagnosticDescriptors.cs │ │ ├── SuppressionDescriptors.cs │ │ └── Suppressions │ │ │ ├── OAPHMethodDoesNotNeedToBeStaticDiagnosticSuppressor.cs │ │ │ ├── ObservableAsPropertyAttributeWithFieldNeverReadDiagnosticSuppressor.cs │ │ │ ├── ReactiveAttributeWithFieldTargetDiagnosticSuppressor.cs │ │ │ ├── ReactiveAttributeWithPropertyTargetDiagnosticSuppressor.cs │ │ │ ├── ReactiveCommandAttributeWithFieldOrPropertyTargetDiagnosticSuppressor.cs │ │ │ ├── ReactiveCommandMethodDoesNotNeedToBeStaticDiagnosticSuppressor.cs │ │ │ └── ReactiveFieldDoesNotNeedToBeReadOnlyDiagnosticSuppressor.cs │ ├── Generated │ │ └── PolySharp.SourceGenerators │ │ │ └── PolySharp.SourceGenerators.PolyfillsGenerator │ │ │ ├── System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute.g.cs │ │ │ ├── System.Diagnostics.CodeAnalysis.NotNullWhenAttribute.g.cs │ │ │ ├── System.Diagnostics.CodeAnalysis.UnscopedRefAttribute.g.cs │ │ │ ├── System.Index.g.cs │ │ │ ├── System.Range.g.cs │ │ │ └── System.Runtime.CompilerServices.IsExternalInit.g.cs │ ├── IViewFor │ │ ├── IViewForGenerator.Execute.cs │ │ ├── IViewForGenerator.cs │ │ └── Models │ │ │ ├── IViewForBaseType.cs │ │ │ └── IViewForInfo.cs │ ├── ObservableAsProperty │ │ ├── Models │ │ │ ├── ObservableFieldInfo.cs │ │ │ └── ObservableMethodInfo.cs │ │ ├── ObservableAsPropertyGenerator.cs │ │ ├── ObservableAsPropertyGenerator{FromField}.Execute.cs │ │ ├── ObservableAsPropertyGenerator{FromField}.cs │ │ ├── ObservableAsPropertyGenerator{FromObservable}.Execute.cs │ │ └── ObservableAsPropertyGenerator{FromObservable}.cs │ ├── Reactive │ │ ├── Models │ │ │ └── PropertyInfo.cs │ │ ├── ReactiveGenerator.Execute.cs │ │ └── ReactiveGenerator.cs │ ├── ReactiveCommand │ │ ├── Models │ │ │ ├── CanExecuteTypeInfo.cs │ │ │ └── CommandInfo.cs │ │ ├── ReactiveCommandGenerator.Execute.cs │ │ └── ReactiveCommandGenerator.cs │ ├── ReactiveUI.SourceGenerators.Roslyn.projitems │ ├── ReactiveUI.SourceGenerators.Roslyn.shproj │ ├── RoutedControlHost │ │ ├── Models │ │ │ └── RoutedControlHostInfo.cs │ │ ├── RoutedControlHostGenerator.Execute.cs │ │ └── RoutedControlHostGenerator.cs │ └── ViewModelControlHost │ │ ├── Models │ │ └── ViewModelControlHostInfo.cs │ │ ├── ViewModelControlHostGenerator.Execute.cs │ │ └── ViewModelControlHostGenerator.cs ├── ReactiveUI.SourceGenerators.Roslyn4120 │ └── ReactiveUI.SourceGenerators.Roslyn4120.csproj ├── ReactiveUI.SourceGenerators.Roslyn480 │ └── ReactiveUI.SourceGenerators.Roslyn480.csproj ├── ReactiveUI.SourceGenerators.sln ├── ReactiveUI.SourceGenerators │ ├── Properties │ │ └── launchSettings.json │ └── ReactiveUI.SourceGenerators.csproj ├── TestApps │ ├── TestAvaloniaApplication.Desktop │ │ ├── Program.cs │ │ ├── TestAvaloniaApplication.Desktop.csproj │ │ └── app.manifest │ ├── TestAvaloniaApplication │ │ ├── App.axaml │ │ ├── App.axaml.cs │ │ ├── Assets │ │ │ └── avalonia-logo.ico │ │ ├── TestAvaloniaApplication.csproj │ │ ├── ViewModels │ │ │ ├── MainViewModel.cs │ │ │ └── ViewModelBase.cs │ │ └── Views │ │ │ ├── MainView.axaml │ │ │ ├── MainView.axaml.cs │ │ │ ├── MainWindow.axaml │ │ │ └── MainWindow.axaml.cs │ ├── TestMauiApplication │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── AppShell.xaml │ │ ├── AppShell.xaml.cs │ │ ├── MainPage.xaml │ │ ├── MainPage.xaml.cs │ │ ├── MainViewModel.cs │ │ ├── MauiProgram.cs │ │ ├── Platforms │ │ │ ├── Android │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── MainActivity.cs │ │ │ │ ├── MainApplication.cs │ │ │ │ └── Resources │ │ │ │ │ └── values │ │ │ │ │ └── colors.xml │ │ │ ├── MacCatalyst │ │ │ │ ├── AppDelegate.cs │ │ │ │ ├── Entitlements.plist │ │ │ │ ├── Info.plist │ │ │ │ └── Program.cs │ │ │ ├── Tizen │ │ │ │ ├── Main.cs │ │ │ │ └── tizen-manifest.xml │ │ │ ├── Windows │ │ │ │ ├── App.xaml │ │ │ │ ├── App.xaml.cs │ │ │ │ ├── Package.appxmanifest │ │ │ │ └── app.manifest │ │ │ └── iOS │ │ │ │ ├── AppDelegate.cs │ │ │ │ ├── Info.plist │ │ │ │ ├── Program.cs │ │ │ │ └── Resources │ │ │ │ └── PrivacyInfo.xcprivacy │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Resources │ │ │ ├── AppIcon │ │ │ │ ├── appicon.svg │ │ │ │ └── appiconfg.svg │ │ │ ├── Fonts │ │ │ │ ├── OpenSans-Regular.ttf │ │ │ │ └── OpenSans-Semibold.ttf │ │ │ ├── Images │ │ │ │ └── dotnet_bot.png │ │ │ ├── Raw │ │ │ │ └── AboutAssets.txt │ │ │ ├── Splash │ │ │ │ └── splash.svg │ │ │ └── Styles │ │ │ │ ├── Colors.xaml │ │ │ │ └── Styles.xaml │ │ └── TestMauiApplication.csproj │ ├── TestWinFormsApplication │ │ ├── Form1.Designer.cs │ │ ├── Form1.cs │ │ ├── MainViewModel.cs │ │ ├── Program.cs │ │ └── TestWinFormsApplication.csproj │ └── TestWpfApplication │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── AssemblyInfo.cs │ │ ├── MainViewModel.cs │ │ ├── MainWindow.xaml │ │ ├── MainWindow.xaml.cs │ │ └── TestWpfApplication.csproj └── stylecop.json └── version.json /.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: "SourceGenerators" 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: "SourceGenerators" 18 | installWorkflows: true 19 | -------------------------------------------------------------------------------- /.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. -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | 7 | env: 8 | productNamespacePrefix: "SourceGenerators" 9 | 10 | jobs: 11 | release: 12 | uses: reactiveui/actions-common/.github/workflows/workflow-common-release.yml@main 13 | with: 14 | configuration: Release 15 | productNamespacePrefix: "SourceGenerators" 16 | installWorkflows: true 17 | secrets: 18 | SIGN_ACCOUNT_NAME: ${{ secrets.SIGN_ACCOUNT_NAME }} 19 | SIGN_PROFILE_NAME: ${{ secrets.SIGN_PROFILE_NAME }} 20 | AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} 21 | AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} 22 | AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} 23 | NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} 24 | -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactiveui/ReactiveUI.SourceGenerators/a09065e50e01261f6df3ab8137b115f3f084180a/images/logo.png -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)] 19 | internal sealed class BindableDerivedListAttribute : Attribute; 20 | #nullable restore 21 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/ModuleInitializer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.Runtime.CompilerServices; 7 | 8 | /// 9 | /// Initializes the source generator verifiers. 10 | /// 11 | public static class ModuleInitializer 12 | { 13 | /// 14 | /// Initializes the source generators. 15 | /// 16 | [ModuleInitializer] 17 | public static void Init() => VerifySourceGenerators.Initialize(); 18 | } 19 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsProperties.g.cs 2 | // 3 | #pragma warning disable 4 | #nullable enable 5 | namespace TestNs 6 | { 7 | /// 8 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 9 | /// 10 | public partial class TestVM 11 | { 12 | /// 13 | private readonly ReactiveUI.ObservableAsPropertyHelper _testPropertyHelper; 14 | 15 | /// 16 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 17 | [global::System.Runtime.Serialization.DataMemberAttribute()] 18 | [global::System.Text.Json.Serialization.JsonIncludeAttribute()] 19 | public double? TestProperty { get => _testProperty = (_testPropertyHelper == null ? _testProperty : _testPropertyHelper.Value); } 20 | } 21 | } 22 | #nullable restore 23 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethods#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | /// 16 | private int _test2Property; 17 | 18 | /// 19 | private ReactiveUI.ObservableAsPropertyHelper? _test2PropertyHelper; 20 | 21 | /// 22 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 23 | public int Test2Property { get => _test2Property = _test2PropertyHelper?.Value ?? _test2Property; } 24 | 25 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 26 | protected void InitializeOAPH() 27 | { 28 | _test2PropertyHelper = Test2()!.ToProperty(this, nameof(Test2Property)); 29 | } 30 | } 31 | } 32 | #nullable restore 33 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableMethodsWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | /// 16 | private int _test3Property; 17 | 18 | /// 19 | private ReactiveUI.ObservableAsPropertyHelper? _test3PropertyHelper; 20 | 21 | /// 22 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 23 | public int Test3Property { get => _test3Property = _test3PropertyHelper?.Value ?? _test3Property; } 24 | 25 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 26 | protected void InitializeOAPH() 27 | { 28 | _test3PropertyHelper = Test3()!.ToProperty(this, nameof(Test3Property)); 29 | } 30 | } 31 | } 32 | #nullable restore 33 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservableProp#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | /// 16 | private int _test1Property; 17 | 18 | /// 19 | private ReactiveUI.ObservableAsPropertyHelper? _test1PropertyHelper; 20 | 21 | /// 22 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 23 | public int Test1Property { get => _test1Property = _test1PropertyHelper?.Value ?? _test1Property; } 24 | 25 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 26 | protected void InitializeOAPH() 27 | { 28 | _test1PropertyHelper = Test1!.ToProperty(this, nameof(Test1Property)); 29 | } 30 | } 31 | } 32 | #nullable restore 33 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM+TestVMInner1.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | public partial class TestVM 11 | { 12 | /// 13 | /// Partial class for the TestVMInner1 which contains ReactiveUI Observable As Property initialization. 14 | /// 15 | public partial class TestVMInner1 16 | { 17 | /// 18 | private int _testIn1Property; 19 | 20 | /// 21 | private ReactiveUI.ObservableAsPropertyHelper? _testIn1PropertyHelper; 22 | 23 | /// 24 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 25 | public int TestIn1Property { get => _testIn1Property = _testIn1PropertyHelper?.Value ?? _testIn1Property; } 26 | 27 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 28 | protected void InitializeOAPH() 29 | { 30 | _testIn1PropertyHelper = TestIn1!.ToProperty(this, nameof(TestIn1Property)); 31 | } 32 | } 33 | } 34 | 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | public partial class TestVM 11 | { 12 | public partial class TestVMInner2 13 | { 14 | /// 15 | /// Partial class for the TestVMInner3 which contains ReactiveUI Observable As Property initialization. 16 | /// 17 | public partial class TestVMInner3 18 | { 19 | /// 20 | private int _testIn3Property; 21 | 22 | /// 23 | private ReactiveUI.ObservableAsPropertyHelper? _testIn3PropertyHelper; 24 | 25 | /// 26 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 27 | public int TestIn3Property { get => _testIn3Property = _testIn3PropertyHelper?.Value ?? _testIn3Property; } 28 | 29 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 30 | protected void InitializeOAPH() 31 | { 32 | _testIn3PropertyHelper = TestIn3!.ToProperty(this, nameof(TestIn3Property)); 33 | } 34 | } 35 | } 36 | } 37 | 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM+TestVMInner2.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | public partial class TestVM 11 | { 12 | /// 13 | /// Partial class for the TestVMInner2 which contains ReactiveUI Observable As Property initialization. 14 | /// 15 | public partial class TestVMInner2 16 | { 17 | /// 18 | private int _testIn2Property; 19 | 20 | /// 21 | private ReactiveUI.ObservableAsPropertyHelper? _testIn2PropertyHelper; 22 | 23 | /// 24 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 25 | public int TestIn2Property { get => _testIn2Property = _testIn2PropertyHelper?.Value ?? _testIn2Property; } 26 | 27 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 28 | protected void InitializeOAPH() 29 | { 30 | _testIn2PropertyHelper = TestIn2!.ToProperty(this, nameof(TestIn2Property)); 31 | } 32 | } 33 | } 34 | 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropNestedClasses#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | /// 16 | private int _test1Property; 17 | 18 | /// 19 | private ReactiveUI.ObservableAsPropertyHelper? _test1PropertyHelper; 20 | 21 | /// 22 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 23 | public int Test1Property { get => _test1Property = _test1PropertyHelper?.Value ?? _test1Property; } 24 | 25 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 26 | protected void InitializeOAPH() 27 | { 28 | _test1PropertyHelper = Test1!.ToProperty(this, nameof(Test1Property)); 29 | } 30 | } 31 | } 32 | #nullable restore 33 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttribute#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | /// 16 | private int _test5Property; 17 | 18 | /// 19 | private ReactiveUI.ObservableAsPropertyHelper? _test5PropertyHelper; 20 | 21 | /// 22 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 23 | [global::System.Runtime.Serialization.DataMemberAttribute()] 24 | [global::System.Text.Json.Serialization.JsonIncludeAttribute()] 25 | public int Test5Property { get => _test5Property = _test5PropertyHelper?.Value ?? _test5Property; } 26 | 27 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 28 | protected void InitializeOAPH() 29 | { 30 | _test5PropertyHelper = Test5!.ToProperty(this, nameof(Test5Property)); 31 | } 32 | } 33 | } 34 | #nullable restore 35 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeNullableRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | /// 16 | private object? _test7Property; 17 | 18 | /// 19 | private ReactiveUI.ObservableAsPropertyHelper? _test7PropertyHelper; 20 | 21 | /// 22 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 23 | [global::System.Runtime.Serialization.DataMemberAttribute()] 24 | [global::System.Text.Json.Serialization.JsonIncludeAttribute()] 25 | public object? Test7Property { get => _test7Property = (_test7PropertyHelper == null ? _test7Property : _test7PropertyHelper.Value); } 26 | 27 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 28 | protected void InitializeOAPH() 29 | { 30 | _test7PropertyHelper = Test7!.ToProperty(this, nameof(Test7Property)); 31 | } 32 | } 33 | } 34 | #nullable restore 35 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithAttributeRef#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | /// 16 | private object _test6Property; 17 | 18 | /// 19 | private ReactiveUI.ObservableAsPropertyHelper? _test6PropertyHelper; 20 | 21 | /// 22 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 23 | [global::System.Runtime.Serialization.DataMemberAttribute()] 24 | [global::System.Text.Json.Serialization.JsonIncludeAttribute()] 25 | public object Test6Property { get => _test6Property = _test6PropertyHelper?.Value ?? _test6Property; } 26 | 27 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 28 | protected void InitializeOAPH() 29 | { 30 | _test6PropertyHelper = Test6!.ToProperty(this, nameof(Test6Property)); 31 | } 32 | } 33 | } 34 | #nullable restore 35 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromObservablePropertiesWithName#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | /// 16 | private int _test4Property; 17 | 18 | /// 19 | private ReactiveUI.ObservableAsPropertyHelper? _test4PropertyHelper; 20 | 21 | /// 22 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 23 | public int Test4Property { get => _test4Property = _test4PropertyHelper?.Value ?? _test4Property; } 24 | 25 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 26 | protected void InitializeOAPH() 27 | { 28 | _test4PropertyHelper = Test4!.ToProperty(this, nameof(Test4Property)); 29 | } 30 | } 31 | } 32 | #nullable restore 33 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPFromObservableGeneratorTests.FromPartialProperty#TestNs.TestVM.ObservableAsPropertyFromObservable.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsPropertyFromObservable.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | /// 16 | private double? _testProperty; 17 | 18 | /// 19 | private readonly ReactiveUI.ObservableAsPropertyHelper _testPropertyHelper; 20 | 21 | /// 22 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 23 | [global::System.Runtime.Serialization.DataMemberAttribute()] 24 | public partial double? TestProperty { get => _testProperty = (_testPropertyHelper == null ? _testProperty : _testPropertyHelper.Value); } 25 | 26 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 27 | protected void InitializeOAPH() 28 | { 29 | 30 | } 31 | } 32 | } 33 | #nullable restore 34 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsProperties.g.cs 2 | // 3 | #pragma warning disable 4 | #nullable enable 5 | namespace TestNs 6 | { 7 | /// 8 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 9 | /// 10 | public partial class TestVM 11 | { 12 | /// 13 | private readonly ReactiveUI.ObservableAsPropertyHelper _test1Helper; 14 | 15 | /// 16 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 17 | public int Test1 { get => _test1 = _test1Helper?.Value ?? _test1; } 18 | } 19 | } 20 | #nullable restore 21 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner1.ObservableAsProperties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM+TestVMInner1.ObservableAsProperties.g.cs 2 | // 3 | #pragma warning disable 4 | #nullable enable 5 | namespace TestNs 6 | { 7 | public partial class TestVM 8 | { 9 | /// 10 | /// Partial class for the TestVMInner1 which contains ReactiveUI Observable As Property initialization. 11 | /// 12 | public partial class TestVMInner1 13 | { 14 | /// 15 | private readonly ReactiveUI.ObservableAsPropertyHelper _testIn1Helper; 16 | 17 | /// 18 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 19 | public int TestIn1 { get => _testIn1 = _testIn1Helper?.Value ?? _testIn1; } 20 | } 21 | } 22 | 23 | } 24 | #nullable restore 25 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsProperties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM+TestVMInner2+TestVMInner3.ObservableAsProperties.g.cs 2 | // 3 | #pragma warning disable 4 | #nullable enable 5 | namespace TestNs 6 | { 7 | public partial class TestVM 8 | { 9 | public partial class TestVMInner2 10 | { 11 | /// 12 | /// Partial class for the TestVMInner3 which contains ReactiveUI Observable As Property initialization. 13 | /// 14 | public partial class TestVMInner3 15 | { 16 | /// 17 | private readonly ReactiveUI.ObservableAsPropertyHelper _testIn3Helper; 18 | 19 | /// 20 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 21 | public int TestIn3 { get => _testIn3 = _testIn3Helper?.Value ?? _testIn3; } 22 | } 23 | } 24 | } 25 | 26 | } 27 | #nullable restore 28 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM+TestVMInner2.ObservableAsProperties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM+TestVMInner2.ObservableAsProperties.g.cs 2 | // 3 | #pragma warning disable 4 | #nullable enable 5 | namespace TestNs 6 | { 7 | public partial class TestVM 8 | { 9 | /// 10 | /// Partial class for the TestVMInner2 which contains ReactiveUI Observable As Property initialization. 11 | /// 12 | public partial class TestVMInner2 13 | { 14 | /// 15 | private readonly ReactiveUI.ObservableAsPropertyHelper _testIn2Helper; 16 | 17 | /// 18 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 19 | public int TestIn2 { get => _testIn2 = _testIn2Helper?.Value ?? _testIn2; } 20 | } 21 | } 22 | 23 | } 24 | #nullable restore 25 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.FromFieldNestedClass#TestNs.TestVM.ObservableAsProperties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsProperties.g.cs 2 | // 3 | #pragma warning disable 4 | #nullable enable 5 | namespace TestNs 6 | { 7 | /// 8 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 9 | /// 10 | public partial class TestVM 11 | { 12 | /// 13 | private readonly ReactiveUI.ObservableAsPropertyHelper _test2Helper; 14 | 15 | /// 16 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 17 | public int Test2 { get => _test2 = _test2Helper?.Value ?? _test2; } 18 | } 19 | } 20 | #nullable restore 21 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NamedFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsProperties.g.cs 2 | // 3 | #pragma warning disable 4 | #nullable enable 5 | namespace TestNs 6 | { 7 | /// 8 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 9 | /// 10 | public partial class TestVM 11 | { 12 | /// 13 | private readonly ReactiveUI.ObservableAsPropertyHelper _test4Helper; 14 | 15 | /// 16 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 17 | public int Test4 { get => _test4 = _test4Helper?.Value ?? _test4; } 18 | } 19 | } 20 | #nullable restore 21 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromField#TestNs.TestVM.ObservableAsProperties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsProperties.g.cs 2 | // 3 | #pragma warning disable 4 | #nullable enable 5 | namespace TestNs 6 | { 7 | /// 8 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 9 | /// 10 | public partial class TestVM 11 | { 12 | /// 13 | private readonly ReactiveUI.ObservableAsPropertyHelper _test3Helper; 14 | 15 | /// 16 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 17 | public int Test3 { get => _test3 = _test3Helper?.Value ?? _test3; } 18 | } 19 | } 20 | #nullable restore 21 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ObservableAsPropertyAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ObservableAsPropertyAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the name of the property. 23 | /// 24 | /// 25 | /// The name of the property. 26 | /// 27 | public string? PropertyName { get; init; } 28 | 29 | /// 30 | /// Gets the Readonly state of the OAPH property. 31 | /// 32 | /// 33 | /// The is read only of the OAPH property. 34 | /// 35 | public bool ReadOnly { get; init; } = true; 36 | 37 | /// 38 | /// Gets the AccessModifier of the OAPH property. 39 | /// 40 | /// 41 | /// The AccessModifier of the OAPH property, protected if true. 42 | /// 43 | public bool UseProtected { get; init; } = false; 44 | 45 | /// 46 | /// Gets the Initial value of the OAPH property. 47 | /// 48 | /// 49 | /// The initial value of the OAPH property. 50 | /// 51 | public string? InitialValue { get; init; } 52 | } 53 | #nullable restore 54 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/OAPH/OAPGeneratorTests.NonReadOnlyFromFieldProtected#TestNs.TestVM.ObservableAsProperties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.ObservableAsProperties.g.cs 2 | // 3 | #pragma warning disable 4 | #nullable enable 5 | namespace TestNs 6 | { 7 | /// 8 | /// Partial class for the TestVM which contains ReactiveUI Observable As Property initialization. 9 | /// 10 | public partial class TestVM 11 | { 12 | /// 13 | private readonly ReactiveUI.ObservableAsPropertyHelper _test5Helper; 14 | 15 | /// 16 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 17 | public int Test5 { get => _test5 = _test5Helper?.Value ?? _test5; } 18 | } 19 | } 20 | #nullable restore 21 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePartialProperties#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | // 8 | #pragma warning disable 9 | #nullable enable 10 | namespace ReactiveUI.SourceGenerators; 11 | 12 | /// 13 | /// AccessModifier. 14 | /// 15 | internal enum AccessModifier 16 | { 17 | Public, 18 | Protected, 19 | Internal, 20 | Private, 21 | InternalProtected, 22 | PrivateProtected, 23 | Init, 24 | } 25 | 26 | /// 27 | /// InheritanceModifier. 28 | /// 29 | internal enum InheritanceModifier 30 | { 31 | None, 32 | Virtual, 33 | Override, 34 | New, 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePartialProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the AccessModifier of the set property. 23 | /// 24 | /// 25 | /// The AccessModifier of the set property. 26 | /// 27 | public AccessModifier SetModifier { get; init; } 28 | 29 | /// 30 | /// Gets the InheritanceModifier of the property. 31 | /// 32 | public InheritanceModifier Inheritance { get; init; } 33 | 34 | /// 35 | /// Use Required attribute to indicate that the property is required. 36 | /// 37 | public bool UseRequired { get; init; } 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | // 8 | #pragma warning disable 9 | #nullable enable 10 | namespace ReactiveUI.SourceGenerators; 11 | 12 | /// 13 | /// AccessModifier. 14 | /// 15 | internal enum AccessModifier 16 | { 17 | Public, 18 | Protected, 19 | Internal, 20 | Private, 21 | InternalProtected, 22 | PrivateProtected, 23 | Init, 24 | } 25 | 26 | /// 27 | /// InheritanceModifier. 28 | /// 29 | internal enum InheritanceModifier 30 | { 31 | None, 32 | Virtual, 33 | Override, 34 | New, 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the AccessModifier of the set property. 23 | /// 24 | /// 25 | /// The AccessModifier of the set property. 26 | /// 27 | public AccessModifier SetModifier { get; init; } 28 | 29 | /// 30 | /// Gets the InheritanceModifier of the property. 31 | /// 32 | public InheritanceModifier Inheritance { get; init; } 33 | 34 | /// 35 | /// Use Required attribute to indicate that the property is required. 36 | /// 37 | public bool UseRequired { get; init; } 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperiesWithAttributes#TestNs.TestVM.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | 16 | /// 17 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | [global::System.Runtime.Serialization.DataMemberAttribute()] 19 | [global::System.Text.Json.Serialization.JsonIncludeAttribute()] 20 | public int Test3 21 | { 22 | get => _test3; 23 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_test3")] 24 | set => this.RaiseAndSetIfChanged(ref _test3, value); 25 | } 26 | } 27 | } 28 | #nullable restore 29 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | // 8 | #pragma warning disable 9 | #nullable enable 10 | namespace ReactiveUI.SourceGenerators; 11 | 12 | /// 13 | /// AccessModifier. 14 | /// 15 | internal enum AccessModifier 16 | { 17 | Public, 18 | Protected, 19 | Internal, 20 | Private, 21 | InternalProtected, 22 | PrivateProtected, 23 | Init, 24 | } 25 | 26 | /// 27 | /// InheritanceModifier. 28 | /// 29 | internal enum InheritanceModifier 30 | { 31 | None, 32 | Virtual, 33 | Override, 34 | New, 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the AccessModifier of the set property. 23 | /// 24 | /// 25 | /// The AccessModifier of the set property. 26 | /// 27 | public AccessModifier SetModifier { get; init; } 28 | 29 | /// 30 | /// Gets the InheritanceModifier of the property. 31 | /// 32 | public InheritanceModifier Inheritance { get; init; } 33 | 34 | /// 35 | /// Use Required attribute to indicate that the property is required. 36 | /// 37 | public bool UseRequired { get; init; } 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactiveProperties#TestNs.TestVM.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | 16 | /// 17 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | public int Test1 19 | { 20 | get => _test1; 21 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_test1")] 22 | set => this.RaiseAndSetIfChanged(ref _test1, value); 23 | } 24 | } 25 | } 26 | #nullable restore 27 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | // 8 | #pragma warning disable 9 | #nullable enable 10 | namespace ReactiveUI.SourceGenerators; 11 | 12 | /// 13 | /// AccessModifier. 14 | /// 15 | internal enum AccessModifier 16 | { 17 | Public, 18 | Protected, 19 | Internal, 20 | Private, 21 | InternalProtected, 22 | PrivateProtected, 23 | Init, 24 | } 25 | 26 | /// 27 | /// InheritanceModifier. 28 | /// 29 | internal enum InheritanceModifier 30 | { 31 | None, 32 | Virtual, 33 | Override, 34 | New, 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the AccessModifier of the set property. 23 | /// 24 | /// 25 | /// The AccessModifier of the set property. 26 | /// 27 | public AccessModifier SetModifier { get; init; } 28 | 29 | /// 30 | /// Gets the InheritanceModifier of the property. 31 | /// 32 | public InheritanceModifier Inheritance { get; init; } 33 | 34 | /// 35 | /// Use Required attribute to indicate that the property is required. 36 | /// 37 | public bool UseRequired { get; init; } 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesCalledValue#TestNs.TestVM.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | 16 | /// 17 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | public string Value 19 | { 20 | get => value; 21 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("this.value")] 22 | set => this.RaiseAndSetIfChanged(ref this.value, value); 23 | } 24 | } 25 | } 26 | #nullable restore 27 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | // 8 | #pragma warning disable 9 | #nullable enable 10 | namespace ReactiveUI.SourceGenerators; 11 | 12 | /// 13 | /// AccessModifier. 14 | /// 15 | internal enum AccessModifier 16 | { 17 | Public, 18 | Protected, 19 | Internal, 20 | Private, 21 | InternalProtected, 22 | PrivateProtected, 23 | Init, 24 | } 25 | 26 | /// 27 | /// InheritanceModifier. 28 | /// 29 | internal enum InheritanceModifier 30 | { 31 | None, 32 | Virtual, 33 | Override, 34 | New, 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the AccessModifier of the set property. 23 | /// 24 | /// 25 | /// The AccessModifier of the set property. 26 | /// 27 | public AccessModifier SetModifier { get; init; } 28 | 29 | /// 30 | /// Gets the InheritanceModifier of the property. 31 | /// 32 | public InheritanceModifier Inheritance { get; init; } 33 | 34 | /// 35 | /// Use Required attribute to indicate that the property is required. 36 | /// 37 | public bool UseRequired { get; init; } 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAccess#TestNs.TestVM.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | 16 | /// 17 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | public int Test2 19 | { 20 | get => _test2; 21 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_test2")] 22 | set => this.RaiseAndSetIfChanged(ref _test2, value); 23 | } 24 | } 25 | } 26 | #nullable restore 27 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | // 8 | #pragma warning disable 9 | #nullable enable 10 | namespace ReactiveUI.SourceGenerators; 11 | 12 | /// 13 | /// AccessModifier. 14 | /// 15 | internal enum AccessModifier 16 | { 17 | Public, 18 | Protected, 19 | Internal, 20 | Private, 21 | InternalProtected, 22 | PrivateProtected, 23 | Init, 24 | } 25 | 26 | /// 27 | /// InheritanceModifier. 28 | /// 29 | internal enum InheritanceModifier 30 | { 31 | None, 32 | Virtual, 33 | Override, 34 | New, 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the AccessModifier of the set property. 23 | /// 24 | /// 25 | /// The AccessModifier of the set property. 26 | /// 27 | public AccessModifier SetModifier { get; init; } 28 | 29 | /// 30 | /// Gets the InheritanceModifier of the property. 31 | /// 32 | public InheritanceModifier Inheritance { get; init; } 33 | 34 | /// 35 | /// Use Required attribute to indicate that the property is required. 36 | /// 37 | public bool UseRequired { get; init; } 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithAttributesAccessAndInheritance#TestNs.TestVM.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | 16 | /// 17 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | [global::System.Runtime.Serialization.DataMemberAttribute()] 19 | [global::System.Text.Json.Serialization.JsonIncludeAttribute()] 20 | public string? Name 21 | { 22 | get => _name; 23 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_name")] 24 | set => this.RaiseAndSetIfChanged(ref _name, value); 25 | } 26 | } 27 | } 28 | #nullable restore 29 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | // 8 | #pragma warning disable 9 | #nullable enable 10 | namespace ReactiveUI.SourceGenerators; 11 | 12 | /// 13 | /// AccessModifier. 14 | /// 15 | internal enum AccessModifier 16 | { 17 | Public, 18 | Protected, 19 | Internal, 20 | Private, 21 | InternalProtected, 22 | PrivateProtected, 23 | Init, 24 | } 25 | 26 | /// 27 | /// InheritanceModifier. 28 | /// 29 | internal enum InheritanceModifier 30 | { 31 | None, 32 | Virtual, 33 | Override, 34 | New, 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the AccessModifier of the set property. 23 | /// 24 | /// 25 | /// The AccessModifier of the set property. 26 | /// 27 | public AccessModifier SetModifier { get; init; } 28 | 29 | /// 30 | /// Gets the InheritanceModifier of the property. 31 | /// 32 | public InheritanceModifier Inheritance { get; init; } 33 | 34 | /// 35 | /// Use Required attribute to indicate that the property is required. 36 | /// 37 | public bool UseRequired { get; init; } 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs1.TestVM.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs1.TestVM.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs1 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | 16 | /// 17 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | [global::System.Runtime.Serialization.DataMemberAttribute()] 19 | [global::System.Text.Json.Serialization.JsonIncludeAttribute()] 20 | public string? Name 21 | { 22 | get => _name; 23 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_name")] 24 | set => this.RaiseAndSetIfChanged(ref _name, value); 25 | } 26 | } 27 | } 28 | #nullable restore 29 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithIdenticalClass#TestNs2.TestVM.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs2.TestVM.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs2 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | 16 | /// 17 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | [global::System.Runtime.Serialization.DataMemberAttribute()] 19 | [global::System.Text.Json.Serialization.JsonIncludeAttribute()] 20 | public string? Name 21 | { 22 | get => _name; 23 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_name")] 24 | set => this.RaiseAndSetIfChanged(ref _name, value); 25 | } 26 | } 27 | } 28 | #nullable restore 29 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | // 8 | #pragma warning disable 9 | #nullable enable 10 | namespace ReactiveUI.SourceGenerators; 11 | 12 | /// 13 | /// AccessModifier. 14 | /// 15 | internal enum AccessModifier 16 | { 17 | Public, 18 | Protected, 19 | Internal, 20 | Private, 21 | InternalProtected, 22 | PrivateProtected, 23 | Init, 24 | } 25 | 26 | /// 27 | /// InheritanceModifier. 28 | /// 29 | internal enum InheritanceModifier 30 | { 31 | None, 32 | Virtual, 33 | Override, 34 | New, 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the AccessModifier of the set property. 23 | /// 24 | /// 25 | /// The AccessModifier of the set property. 26 | /// 27 | public AccessModifier SetModifier { get; init; } 28 | 29 | /// 30 | /// Gets the InheritanceModifier of the property. 31 | /// 32 | public InheritanceModifier Inheritance { get; init; } 33 | 34 | /// 35 | /// Use Required attribute to indicate that the property is required. 36 | /// 37 | public bool UseRequired { get; init; } 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithInit#TestNs.TestVM.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs.TestVM.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs 9 | { 10 | /// 11 | /// Partial class for the TestVM which contains ReactiveUI Reactive property initialization. 12 | /// 13 | public partial class TestVM 14 | { 15 | 16 | /// 17 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | public string MustBeSet 19 | { 20 | get => _mustBeSet; 21 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_mustBeSet")] 22 | set => this.RaiseAndSetIfChanged(ref _mustBeSet, value); 23 | } 24 | } 25 | } 26 | #nullable restore 27 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#ReactiveUI.SourceGenerators.AccessModifier.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | // 8 | #pragma warning disable 9 | #nullable enable 10 | namespace ReactiveUI.SourceGenerators; 11 | 12 | /// 13 | /// AccessModifier. 14 | /// 15 | internal enum AccessModifier 16 | { 17 | Public, 18 | Protected, 19 | Internal, 20 | Private, 21 | InternalProtected, 22 | PrivateProtected, 23 | Init, 24 | } 25 | 26 | /// 27 | /// InheritanceModifier. 28 | /// 29 | internal enum InheritanceModifier 30 | { 31 | None, 32 | Virtual, 33 | Override, 34 | New, 35 | } 36 | #nullable restore 37 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#ReactiveUI.SourceGenerators.ReactiveAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReactiveAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the AccessModifier of the set property. 23 | /// 24 | /// 25 | /// The AccessModifier of the set property. 26 | /// 27 | public AccessModifier SetModifier { get; init; } 28 | 29 | /// 30 | /// Gets the InheritanceModifier of the property. 31 | /// 32 | public InheritanceModifier Inheritance { get; init; } 33 | 34 | /// 35 | /// Use Required attribute to indicate that the property is required. 36 | /// 37 | public bool UseRequired { get; init; } 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass1.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs1.TestViewModel3+TestInnerClass1.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs1 9 | { 10 | public partial class TestViewModel3 11 | { 12 | /// 13 | /// Partial class for the TestInnerClass1 which contains ReactiveUI Reactive property initialization. 14 | /// 15 | public partial class TestInnerClass1 16 | { 17 | 18 | /// 19 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 20 | public int TestInner1 21 | { 22 | get => _testInner1; 23 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner1")] 24 | set => this.RaiseAndSetIfChanged(ref _testInner1, value); 25 | } 26 | 27 | /// 28 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 29 | public int TestInner11 30 | { 31 | get => _testInner11; 32 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner11")] 33 | set => this.RaiseAndSetIfChanged(ref _testInner11, value); 34 | } 35 | } 36 | } 37 | 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs1 9 | { 10 | public partial class TestViewModel3 11 | { 12 | public partial class TestInnerClass2 13 | { 14 | /// 15 | /// Partial class for the TestInnerClass3 which contains ReactiveUI Reactive property initialization. 16 | /// 17 | public partial class TestInnerClass3 18 | { 19 | 20 | /// 21 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 22 | public int TestInner3 23 | { 24 | get => _testInner3; 25 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner3")] 26 | set => this.RaiseAndSetIfChanged(ref _testInner3, value); 27 | } 28 | 29 | /// 30 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 31 | public int TestInner33 32 | { 33 | get => _testInner33; 34 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner33")] 35 | set => this.RaiseAndSetIfChanged(ref _testInner33, value); 36 | } 37 | } 38 | } 39 | } 40 | 41 | } 42 | #nullable restore 43 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3+TestInnerClass2.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs1.TestViewModel3+TestInnerClass2.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs1 9 | { 10 | public partial class TestViewModel3 11 | { 12 | /// 13 | /// Partial class for the TestInnerClass2 which contains ReactiveUI Reactive property initialization. 14 | /// 15 | public partial class TestInnerClass2 16 | { 17 | 18 | /// 19 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 20 | public int TestInner2 21 | { 22 | get => _testInner2; 23 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner2")] 24 | set => this.RaiseAndSetIfChanged(ref _testInner2, value); 25 | } 26 | 27 | /// 28 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 29 | public int TestInner22 30 | { 31 | get => _testInner22; 32 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner22")] 33 | set => this.RaiseAndSetIfChanged(ref _testInner22, value); 34 | } 35 | } 36 | } 37 | 38 | } 39 | #nullable restore 40 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVE/ReactiveGeneratorTests.FromReactivePropertiesWithNestedClass#TestNs1.TestViewModel3.Properties.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: TestNs1.TestViewModel3.Properties.g.cs 2 | // 3 | using ReactiveUI; 4 | 5 | #pragma warning disable 6 | #nullable enable 7 | 8 | namespace TestNs1 9 | { 10 | /// 11 | /// Partial class for the TestViewModel3 which contains ReactiveUI Reactive property initialization. 12 | /// 13 | public partial class TestViewModel3 14 | { 15 | 16 | /// 17 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 18 | public float TestVM3Property 19 | { 20 | get => _testVM3Property; 21 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testVM3Property")] 22 | set => this.RaiseAndSetIfChanged(ref _testVM3Property, value); 23 | } 24 | 25 | /// 26 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 27 | public float TestVM3Property2 28 | { 29 | get => _testVM3Property2; 30 | [global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testVM3Property2")] 31 | set => this.RaiseAndSetIfChanged(ref _testVM3Property2, value); 32 | } 33 | } 34 | } 35 | #nullable restore 36 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReativeCommandAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveCommandAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the can execute method or property. 23 | /// 24 | /// 25 | /// The name of the CanExecute Observable of bool. 26 | /// 27 | public string? CanExecute { get; init; } 28 | 29 | /// 30 | /// Gets the output scheduler. 31 | /// 32 | /// 33 | /// The output scheduler. 34 | /// 35 | public string? OutputScheduler { get; init; } 36 | } 37 | #nullable restore 38 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveAsyncCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReativeCommandAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveCommandAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the can execute method or property. 23 | /// 24 | /// 25 | /// The name of the CanExecute Observable of bool. 26 | /// 27 | public string? CanExecute { get; init; } 28 | 29 | /// 30 | /// Gets the output scheduler. 31 | /// 32 | /// 33 | /// The output scheduler. 34 | /// 35 | public string? OutputScheduler { get; init; } 36 | } 37 | #nullable restore 38 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommand#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReativeCommandAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveCommandAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the can execute method or property. 23 | /// 24 | /// 25 | /// The name of the CanExecute Observable of bool. 26 | /// 27 | public string? CanExecute { get; init; } 28 | 29 | /// 30 | /// Gets the output scheduler. 31 | /// 32 | /// 33 | /// The output scheduler. 34 | /// 35 | public string? OutputScheduler { get; init; } 36 | } 37 | #nullable restore 38 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithNestedClasses#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReativeCommandAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveCommandAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the can execute method or property. 23 | /// 24 | /// 25 | /// The name of the CanExecute Observable of bool. 26 | /// 27 | public string? CanExecute { get; init; } 28 | 29 | /// 30 | /// Gets the output scheduler. 31 | /// 32 | /// 33 | /// The output scheduler. 34 | /// 35 | public string? OutputScheduler { get; init; } 36 | } 37 | #nullable restore 38 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithOutputScheduler#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReativeCommandAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveCommandAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the can execute method or property. 23 | /// 24 | /// 25 | /// The name of the CanExecute Observable of bool. 26 | /// 27 | public string? CanExecute { get; init; } 28 | 29 | /// 30 | /// Gets the output scheduler. 31 | /// 32 | /// 33 | /// The output scheduler. 34 | /// 35 | public string? OutputScheduler { get; init; } 36 | } 37 | #nullable restore 38 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/REACTIVECMD/ReactiveCMDGeneratorTests.FromReactiveCommandWithParameter#ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.verified.cs: -------------------------------------------------------------------------------- 1 | //HintName: ReactiveUI.SourceGenerators.ReactiveCommandAttribute.g.cs 2 | // Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved. 3 | // Licensed to the .NET Foundation under one or more agreements. 4 | // The .NET Foundation licenses this file to you under the MIT license. 5 | // See the LICENSE file in the project root for full license information. 6 | 7 | using System; 8 | 9 | // 10 | #pragma warning disable 11 | #nullable enable 12 | namespace ReactiveUI.SourceGenerators; 13 | 14 | /// 15 | /// ReativeCommandAttribute. 16 | /// 17 | /// 18 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 19 | internal sealed class ReactiveCommandAttribute : Attribute 20 | { 21 | /// 22 | /// Gets the can execute method or property. 23 | /// 24 | /// 25 | /// The name of the CanExecute Observable of bool. 26 | /// 27 | public string? CanExecute { get; init; } 28 | 29 | /// 30 | /// Gets the output scheduler. 31 | /// 32 | /// 33 | /// The output scheduler. 34 | /// 35 | public string? OutputScheduler { get; init; } 36 | } 37 | #nullable restore 38 | #pragma warning restore -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/TestBase.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.CodeAnalysis; 7 | using Xunit.Abstractions; 8 | 9 | namespace ReactiveUI.SourceGenerator.Tests; 10 | 11 | /// 12 | /// A base class for handling test setup and teardown. 13 | /// 14 | /// Type of Incremental Generator. 15 | /// 16 | /// 17 | /// The output helper. 18 | public abstract class TestBase(ITestOutputHelper testOutputHelper) : IAsyncLifetime, IDisposable 19 | where T : IIncrementalGenerator, new() 20 | { 21 | /// 22 | /// Gets the TestHelper instance. 23 | /// 24 | protected TestHelper TestHelper { get; } = new(testOutputHelper); 25 | 26 | /// 27 | public Task InitializeAsync() => TestHelper.InitializeAsync(); 28 | 29 | /// 30 | public Task DisposeAsync() 31 | { 32 | TestHelper.Dispose(); 33 | return Task.CompletedTask; 34 | } 35 | 36 | /// 37 | public void Dispose() 38 | { 39 | Dispose(true); 40 | GC.SuppressFinalize(this); 41 | } 42 | 43 | /// 44 | /// Disposes the resources used by the TestBase. 45 | /// 46 | /// True if called from Dispose method, false if called from finalizer. 47 | protected virtual void Dispose(bool isDisposing) 48 | { 49 | if (isDisposing) 50 | { 51 | TestHelper.Dispose(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerator.Tests/UnitTests/BindableDerivedListGeneratorTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators; 7 | using Xunit.Abstractions; 8 | 9 | namespace ReactiveUI.SourceGenerator.Tests; 10 | 11 | /// 12 | /// BindableDerivedListGeneratorTests. 13 | /// 14 | public class BindableDerivedListGeneratorTests(ITestOutputHelper output) : TestBase(output) 15 | { 16 | /// 17 | /// Tests that the source generator correctly generates reactive properties. 18 | /// 19 | /// A task to monitor the async. 20 | [Fact] 21 | public Task FromReactiveProperties() 22 | { 23 | // Arrange: Setup the source code that matches the generator input expectations. 24 | const string sourceCode = """ 25 | using System.Collections.ObjectModel; 26 | using DynamicData; 27 | 28 | namespace TestNs; 29 | 30 | public partial class TestVM 31 | { 32 | [BindableDerivedList] 33 | private ReadOnlyObservableCollection _test1; 34 | } 35 | """; 36 | 37 | // Act: Initialize the helper and run the generator. Assert: Verify the generated code. 38 | return TestHelper.TestPass(sourceCode); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/AnalyzerReleases.Unshipped.md: -------------------------------------------------------------------------------- 1 | ; Unshipped analyzer releases 2 | ; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md 3 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Extensions/ISymbolExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.CodeAnalysis; 7 | 8 | namespace ReactiveUI.SourceGenerators.Extensions; 9 | 10 | /// 11 | /// Extension methods for the type. 12 | /// 13 | internal static class ISymbolExtensions 14 | { 15 | /// 16 | /// Checks whether or not a given symbol has an attribute with the specified fully qualified metadata name. 17 | /// 18 | /// The input instance to check. 19 | /// The attribute name to look for. 20 | /// Whether or not has an attribute with the specified name. 21 | public static bool HasAttributeWithFullyQualifiedMetadataName(this ISymbol symbol, string name) 22 | { 23 | foreach (var attribute in symbol.GetAttributes()) 24 | { 25 | if (attribute.AttributeClass?.HasFullyQualifiedMetadataName(name) == true) 26 | { 27 | return true; 28 | } 29 | } 30 | 31 | return false; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Core/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Diagnostics.CodeAnalysis.NotNullWhenAttribute.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | #pragma warning disable 3 | #nullable enable annotations 4 | 5 | // Licensed to the .NET Foundation under one or more agreements. 6 | // The .NET Foundation licenses this file to you under the MIT license. 7 | 8 | namespace System.Diagnostics.CodeAnalysis 9 | { 10 | /// 11 | /// Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. 12 | /// 13 | [global::System.AttributeUsage(global::System.AttributeTargets.Parameter, Inherited = false)] 14 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | internal sealed class NotNullWhenAttribute : global::System.Attribute 16 | { 17 | /// 18 | /// Initializes the attribute with the specified return value condition. 19 | /// 20 | /// The return value condition. If the method returns this value, the associated parameter will not be null. 21 | public NotNullWhenAttribute(bool returnValue) 22 | { 23 | ReturnValue = returnValue; 24 | } 25 | 26 | /// Gets the return value condition. 27 | public bool ReturnValue { get; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/Diagnostics/DiagnosticDescriptors.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.CodeAnalysis; 7 | 8 | #pragma warning disable IDE0090 // Use 'new DiagnosticDescriptor(...)' 9 | 10 | namespace ReactiveUI.SourceGenerators.CodeFixers.Diagnostics; 11 | 12 | /// 13 | /// A container for all instances for errors reported by analyzers in this project. 14 | /// 15 | internal static class DiagnosticDescriptors 16 | { 17 | /// 18 | /// The property to field rule. 19 | /// 20 | public static readonly DiagnosticDescriptor PropertyToReactiveFieldRule = new( 21 | id: "RXUISG0016", 22 | title: "Property To Reactive Field, change to [Reactive] private type _fieldName;", 23 | messageFormat: "Replace the property with a INPC Reactive Property for ReactiveUI", 24 | category: typeof(PropertyToReactiveFieldAnalyzer).FullName, 25 | defaultSeverity: DiagnosticSeverity.Info, 26 | isEnabledByDefault: true, 27 | description: "Used to create a Read Write INPC Reactive Property for ReactiveUI, annotated with [Reactive].", 28 | helpLinkUri: "https://www.reactiveui.net/docs/handbook/view-models/boilerplate-code.html"); 29 | } 30 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Analyzers.CodeFixes/ReactiveUI.SourceGenerators.Analyzers.CodeFixes.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | enable 6 | latest 7 | true 8 | true 9 | true 10 | true 11 | false 12 | true 13 | true 14 | true 15 | 16 | $(NoWarn);RS1038;RS2007;NU5128 17 | A MVVM framework that integrates with the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform. This is the Source Generators package for ReactiveUI 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute.Maui/IViewForTest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators; 7 | 8 | namespace SGReactiveUI.SourceGenerators.Test.Maui 9 | { 10 | /// 11 | /// IViewForTest. 12 | /// 13 | /// 14 | [IViewFor] 15 | public partial class IViewForTest : Shell; 16 | } 17 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute.Nested1/Class1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI; 7 | using ReactiveUI.SourceGenerators; 8 | 9 | namespace SGReactiveUI.SourceGenerators.Execute.Nested1; 10 | 11 | /// 12 | /// Class1. 13 | /// 14 | public partial class Class1 : ReactiveObject 15 | { 16 | [Reactive] 17 | private string? _property1; 18 | } 19 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute.Nested1/ReactiveUI.SourceGenerators.Execute.Nested1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | false 8 | 13.0 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute.Nested2/Class1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI; 7 | using ReactiveUI.SourceGenerators; 8 | 9 | namespace SGReactiveUI.SourceGenerators.Execute.Nested2; 10 | 11 | /// 12 | /// Class1. 13 | /// 14 | public partial class Class1 : ReactiveObject 15 | { 16 | [Reactive] 17 | private string? _property1; 18 | } 19 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute.Nested2/ReactiveUI.SourceGenerators.Execute.Nested2.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | false 8 | 13.0 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute.Nested3/Class1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI; 7 | using ReactiveUI.SourceGenerators; 8 | 9 | namespace SGReactiveUI.SourceGenerators.Execute.Nested3; 10 | 11 | /// 12 | /// Class1. 13 | /// 14 | public partial class Class1 : ReactiveObject 15 | { 16 | [Reactive] 17 | private string? _property1; 18 | } 19 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute.Nested3/Nested4/Class1.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI; 7 | using ReactiveUI.SourceGenerators; 8 | 9 | namespace SGReactiveUI.SourceGenerators.Execute.Nested4; 10 | 11 | /// 12 | /// Class1. 13 | /// 14 | public partial class Class1 : ReactiveObject 15 | { 16 | [Reactive] 17 | private string? _property1; 18 | } 19 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute.Nested3/ReactiveUI.SourceGenerators.Execute.Nested3.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | false 8 | 13.0 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/InternalTestViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI; 7 | using ReactiveUI.SourceGenerators; 8 | 9 | namespace SGReactiveUI.SourceGenerators.Test; 10 | 11 | internal partial class InternalTestViewModel : ReactiveObject 12 | { 13 | [Reactive] 14 | public partial int PublicPartialPropertyTest { get; set; } 15 | 16 | [Reactive] 17 | public required partial bool PublicRequiredPartialPropertyTest { get; set; } 18 | 19 | [Reactive] 20 | public partial int PublicPartialPropertyWithInternalProtectedTest { get; protected internal set; } 21 | 22 | [Reactive] 23 | public partial int PublicPartialPropertyWithPrivateProtectedTest { get; private protected set; } 24 | 25 | [Reactive] 26 | public partial int PublicPartialPropertyWithProtectedTest { get; protected set; } 27 | 28 | [Reactive] 29 | public partial int PublicPartialPropertyWithInternalTest { get; internal set; } 30 | 31 | [Reactive] 32 | public partial int PublicPartialPropertyWithPrivateTest { get; private set; } 33 | 34 | [Reactive] 35 | internal partial int InternalPartialPropertyTest { get; set; } 36 | 37 | [Reactive] 38 | protected internal partial int InternalProtectedPartialPropertyTest { get; set; } 39 | 40 | [Reactive] 41 | protected partial int ProtectedPartialPropertyTest { get; set; } 42 | 43 | [Reactive] 44 | private partial int PrivatePartialPropertyTest { get; set; } 45 | } 46 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/Person.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI; 7 | using ReactiveUI.SourceGenerators; 8 | 9 | namespace SGReactiveUI.SourceGenerators.Test; 10 | 11 | /// 12 | /// Person. 13 | /// 14 | /// 15 | public partial class Person : ReactiveObject 16 | { 17 | /// 18 | /// Gets or sets a value indicating whether this is deleted. 19 | /// 20 | /// 21 | /// true if deleted; otherwise, false. 22 | /// 23 | [Reactive] 24 | public bool Deleted { get; set; } 25 | } 26 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 SGReactiveUI.SourceGenerators.Test; 7 | 8 | /// 9 | /// EntryPoint. 10 | /// 11 | public static class Program 12 | { 13 | /// 14 | /// Defines the entry point of the application. 15 | /// 16 | public static void Main() => Application.Run(new TestViewWinForms()); 17 | } 18 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/ReactiveUI.SourceGenerators.Execute.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0-windows 6 | enable 7 | true 8 | true 9 | enable 10 | false 11 | 13.0 12 | $(NoWarn);CA1812 13 | A MVVM framework that integrates with the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform. This is the Source Generators package for ReactiveUI 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 SGReactiveUI.SourceGenerators.Test; 7 | 8 | /// 9 | /// TestAttribute. 10 | /// 11 | /// 12 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] 13 | public sealed class TestAttribute : Attribute 14 | { 15 | /// 16 | /// Gets a parameter. 17 | /// 18 | /// 19 | /// a parameter. 20 | /// 21 | public string? AParameter { get; init; } 22 | } 23 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestViewModel2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI; 7 | using ReactiveUI.SourceGenerators; 8 | 9 | namespace SGReactiveUI.SourceGenerators.Test; 10 | 11 | /// 12 | /// TestViewModel2. 13 | /// 14 | /// the type. 15 | /// 16 | public partial class TestViewModel2 : ReactiveObject 17 | { 18 | [Reactive] 19 | private bool _IsTrue; 20 | } 21 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestViewModel3.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI; 7 | using ReactiveUI.SourceGenerators; 8 | 9 | namespace SGReactiveUI.SourceGenerators.Test; 10 | 11 | /// 12 | /// TestViewModel3. 13 | /// 14 | public partial class TestViewModel3 : ReactiveObject 15 | { 16 | [Reactive] 17 | private float _testVM3Property; 18 | 19 | [Reactive] 20 | private float _testVM3Property2; 21 | 22 | [ReactiveCommand] 23 | private int Test1() => 10; 24 | 25 | /// 26 | /// TestInnerClass. 27 | /// 28 | public partial class TestInnerClass1 : ReactiveObject 29 | { 30 | [Reactive] 31 | private int _testInner1; 32 | 33 | [Reactive] 34 | private int _testInner11; 35 | 36 | [ReactiveCommand] 37 | private int TestI1() => 10; 38 | } 39 | 40 | /// 41 | /// TestInnerClass. 42 | /// 43 | public partial class TestInnerClass2 : ReactiveObject 44 | { 45 | [Reactive] 46 | private int _testInner2; 47 | 48 | [Reactive] 49 | private int _testInner22; 50 | 51 | [ReactiveCommand] 52 | private int TestI2() => 10; 53 | 54 | /// 55 | /// TestInnerClass4. 56 | /// 57 | /// 58 | public partial class TestInnerClass3 : ReactiveObject 59 | { 60 | [Reactive] 61 | private int _testInner3; 62 | 63 | [Reactive] 64 | private int _testInner33; 65 | 66 | [ReactiveCommand] 67 | private int TestI3() => 10; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestViewModel{partTwo}.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators; 7 | 8 | namespace SGReactiveUI.SourceGenerators.Test 9 | { 10 | /// 11 | /// TestViewModel. 12 | /// 13 | /// 14 | public partial class TestViewModel 15 | { 16 | /// 17 | /// Test2s this instance. 18 | /// 19 | /// Rectangle. 20 | [ReactiveCommand] 21 | private Point Test2() => default; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SGReactiveUI.SourceGenerators.Test 2 | { 3 | partial class TestViewWinForms 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 33 | this.ClientSize = new System.Drawing.Size(800, 450); 34 | this.Text = "TestViewWinForms"; 35 | } 36 | 37 | #endregion 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestViewWinForms.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators; 7 | 8 | namespace SGReactiveUI.SourceGenerators.Test 9 | { 10 | /// 11 | /// TestViewWinForms. 12 | /// 13 | /// 14 | [IViewFor] 15 | public partial class TestViewWinForms : Form 16 | { 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | public TestViewWinForms() 21 | { 22 | InitializeComponent(); 23 | ViewModel = TestViewModel.Instance; 24 | ViewModel.Activator.Activate(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestViewWpf.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.Windows; 7 | using ReactiveUI; 8 | using ReactiveUI.SourceGenerators; 9 | 10 | namespace SGReactiveUI.SourceGenerators.Test; 11 | 12 | /// 13 | /// TestView. 14 | /// 15 | [IViewFor] 16 | public partial class TestViewWpf : Window 17 | { 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | public TestViewWpf() => ViewModel = TestViewModel.Instance; 22 | 23 | /// 24 | /// Gets or sets the test property. 25 | /// 26 | /// 27 | /// The test property. 28 | /// 29 | public int TestProperty { get; set; } 30 | } 31 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestViewWpf2.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.Windows; 7 | using ReactiveUI.SourceGenerators; 8 | 9 | namespace SGReactiveUI.SourceGenerators.Test; 10 | 11 | /// 12 | /// TestViewWpf2. 13 | /// 14 | /// 15 | [IViewFor("TestViewModel2")] 16 | public partial class TestViewWpf2 : Window 17 | { 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | public TestViewWpf2() => ViewModel = new(); 22 | } 23 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestWinFormsRCHost.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SGReactiveUI.SourceGenerators.Test; 2 | 3 | partial class TestWinFormsRCHost 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | #region Component Designer generated code 11 | 12 | /// 13 | /// Required method for Designer support - do not modify 14 | /// the contents of this method with the code editor. 15 | /// 16 | private void InitializeComponent() 17 | { 18 | components = new System.ComponentModel.Container(); 19 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 20 | } 21 | 22 | #endregion 23 | } 24 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestWinFormsRCHost.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.WinForms; 7 | 8 | namespace SGReactiveUI.SourceGenerators.Test; 9 | 10 | /// 11 | /// TestWinFormsRCHost. 12 | /// 13 | [RoutedControlHost(nameof(UserControl))] 14 | public partial class TestWinFormsRCHost; 15 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestWinFormsVMCHost.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace SGReactiveUI.SourceGenerators.Test 2 | { 3 | partial class TestWinFormsVMCHost 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | #region Component Designer generated code 11 | 12 | /// 13 | /// Required method for Designer support - do not modify 14 | /// the contents of this method with the code editor. 15 | /// 16 | private void InitializeComponent() 17 | { 18 | components = new System.ComponentModel.Container(); 19 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 20 | } 21 | 22 | #endregion 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Execute/TestWinFormsVMCHost.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.WinForms; 7 | 8 | namespace SGReactiveUI.SourceGenerators.Test; 9 | 10 | /// 11 | /// TestWinFormsVMCHost. 12 | /// 13 | /// 14 | /// 15 | /// 16 | [ViewModelControlHost(nameof(UserControl))] 17 | public partial class TestWinFormsVMCHost; 18 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/AnalyzerReleases.Unshipped.md: -------------------------------------------------------------------------------- 1 | ; Unshipped analyzer releases 2 | ; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md 3 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/BindableDerivedList/Models/BindableDerivedListInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Helpers; 7 | using ReactiveUI.SourceGenerators.Models; 8 | 9 | namespace ReactiveUI.SourceGenerators.BindableDerivedList.Models; 10 | 11 | /// 12 | /// A model with gathered info on a given field. 13 | /// 14 | internal sealed record BindableDerivedListInfo( 15 | TargetInfo TargetInfo, 16 | string TypeNameWithNullabilityAnnotations, 17 | string FieldName, 18 | string PropertyName, 19 | bool IsReferenceTypeOrUnconstrainedTypeParameter, 20 | bool IncludeMemberNotNullOnSetAccessor, 21 | EquatableArray ForwardedAttributes); 22 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/Core/Extensions/SyntaxTokenExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.CodeAnalysis; 7 | using Microsoft.CodeAnalysis.CSharp; 8 | 9 | namespace ReactiveUI.SourceGenerators.Extensions; 10 | 11 | /// 12 | /// Extension methods for the type. 13 | /// 14 | internal static class SyntaxTokenExtensions 15 | { 16 | /// 17 | /// Deconstructs a into its value. 18 | /// 19 | /// The input value. 20 | /// The resulting value for . 21 | public static void Deconstruct(this in SyntaxToken syntaxToken, out SyntaxKind syntaxKind) => syntaxKind = syntaxToken.Kind(); 22 | } 23 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/Core/Helpers/SymbolHelpers.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.CodeAnalysis; 7 | 8 | namespace ReactiveUI.SourceGenerators.Helpers; 9 | 10 | /// 11 | /// Helper methods for working with symbols. 12 | /// 13 | internal static class SymbolHelpers 14 | { 15 | /// 16 | /// Default display format for symbols, omitting the global namespace and including nullable reference type modifiers. 17 | /// 18 | public static readonly SymbolDisplayFormat DefaultDisplay = 19 | SymbolDisplayFormat.FullyQualifiedFormat 20 | .WithGlobalNamespaceStyle(SymbolDisplayGlobalNamespaceStyle.Omitted) 21 | .WithMiscellaneousOptions(SymbolDisplayMiscellaneousOptions.IncludeNullableReferenceTypeModifier); 22 | } 23 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/Core/Models/PropertyAttributeData.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Models; 7 | 8 | internal record PropertyAttributeData(string? AttributeNamespace, string AttributeSyntax); 9 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/Core/Models/Result.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Helpers; 8 | 9 | namespace ReactiveUI.SourceGenerators.Models; 10 | 11 | /// 12 | /// A model representing a value and an associated set of diagnostic errors. 13 | /// 14 | /// The type of the wrapped value. 15 | /// The wrapped value for the current result. 16 | /// The associated diagnostic errors, if any. 17 | internal sealed record Result(TValue Value, EquatableArray Errors) 18 | where TValue : IEquatable?; 19 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/Diagnostics/SuppressionDescriptors.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.CodeAnalysis; 7 | 8 | namespace ReactiveUI.SourceGenerators.Diagnostics; 9 | 10 | internal static class SuppressionDescriptors 11 | { 12 | public static readonly SuppressionDescriptor FieldOrPropertyAttributeListForReactiveCommandMethod = new( 13 | id: "RXUISPR0001", 14 | suppressedDiagnosticId: "CS0657", 15 | justification: "Methods using [ReactiveCommand] can use [field:] and [property:] attribute lists to forward attributes to the generated fields and properties"); 16 | 17 | public static readonly SuppressionDescriptor FieldIsUsedToGenerateAObservableAsPropertyHelper = new( 18 | id: "RXUISPR0002", 19 | suppressedDiagnosticId: "IDE0052", 20 | justification: "Fields using [ObservableAsProperty] are never read"); 21 | 22 | public static readonly SuppressionDescriptor ReactiveCommandDoesNotAccessInstanceData = new( 23 | id: "RXUISPR0003", 24 | suppressedDiagnosticId: "CA1822", 25 | justification: "Methods using [ReactiveCommand] or [ObservableAsProperty] do not need to be static"); 26 | 27 | public static readonly SuppressionDescriptor ReactiveFieldsShouldNotBeReadOnly = new( 28 | id: "RXUISPR0004", 29 | suppressedDiagnosticId: "RCS1169", 30 | justification: "Fields using [Reactive] do not need to be ReadOnly"); 31 | 32 | public static readonly SuppressionDescriptor FieldOrPropertyAttributeListForReactiveProperty = new( 33 | id: "RXUISPR0005", 34 | suppressedDiagnosticId: "CS0657", 35 | justification: "Fields using [Reactive] can use [property:] attribute lists to forward attributes to the generated properties"); 36 | } 37 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | #pragma warning disable 3 | #nullable enable annotations 4 | 5 | // Licensed to the .NET Foundation under one or more agreements. 6 | // The .NET Foundation licenses this file to you under the MIT license. 7 | 8 | namespace System.Diagnostics.CodeAnalysis 9 | { 10 | /// 11 | /// Applied to a method that will never return under any circumstance. 12 | /// 13 | [global::System.AttributeUsage(global::System.AttributeTargets.Method, Inherited = false)] 14 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | internal sealed class DoesNotReturnAttribute : global::System.Attribute 16 | { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Diagnostics.CodeAnalysis.NotNullWhenAttribute.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | #pragma warning disable 3 | #nullable enable annotations 4 | 5 | // Licensed to the .NET Foundation under one or more agreements. 6 | // The .NET Foundation licenses this file to you under the MIT license. 7 | 8 | namespace System.Diagnostics.CodeAnalysis 9 | { 10 | /// 11 | /// Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. 12 | /// 13 | [global::System.AttributeUsage(global::System.AttributeTargets.Parameter, Inherited = false)] 14 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 15 | internal sealed class NotNullWhenAttribute : global::System.Attribute 16 | { 17 | /// 18 | /// Initializes the attribute with the specified return value condition. 19 | /// 20 | /// The return value condition. If the method returns this value, the associated parameter will not be null. 21 | public NotNullWhenAttribute(bool returnValue) 22 | { 23 | ReturnValue = returnValue; 24 | } 25 | 26 | /// Gets the return value condition. 27 | public bool ReturnValue { get; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/Generated/PolySharp.SourceGenerators/PolySharp.SourceGenerators.PolyfillsGenerator/System.Runtime.CompilerServices.IsExternalInit.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | #pragma warning disable 3 | #nullable enable annotations 4 | 5 | // Licensed to the .NET Foundation under one or more agreements. 6 | // The .NET Foundation licenses this file to you under the MIT license. 7 | 8 | namespace System.Runtime.CompilerServices 9 | { 10 | /// 11 | /// Reserved to be used by the compiler for tracking metadata. 12 | /// This class should not be used by developers in source code. 13 | /// 14 | [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] 15 | [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] 16 | internal static class IsExternalInit 17 | { 18 | } 19 | } -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/IViewFor/Models/IViewForBaseType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Input.Models; 7 | 8 | internal enum IViewForBaseType 9 | { 10 | None, 11 | Wpf, 12 | WinUI, 13 | Uno, 14 | WinForms, 15 | Avalonia, 16 | Maui, 17 | } 18 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/IViewFor/Models/IViewForInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Helpers; 7 | using ReactiveUI.SourceGenerators.Models; 8 | 9 | namespace ReactiveUI.SourceGenerators.Input.Models; 10 | 11 | /// 12 | /// A model with gathered info on a given command method. 13 | /// 14 | internal sealed record IViewForInfo( 15 | TargetInfo TargetInfo, 16 | string ViewModelTypeName, 17 | IViewForBaseType BaseType); 18 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/Models/ObservableFieldInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Helpers; 7 | using ReactiveUI.SourceGenerators.Models; 8 | 9 | namespace ReactiveUI.SourceGenerators.Reactive.Models; 10 | 11 | /// 12 | /// A model with gathered info on a given field. 13 | /// 14 | internal sealed record ObservableFieldInfo( 15 | TargetInfo TargetInfo, 16 | string TypeNameWithNullabilityAnnotations, 17 | string FieldName, 18 | string PropertyName, 19 | string? Initializer, 20 | bool IsReferenceTypeOrUnconstrainedTypeParameter, 21 | bool IncludeMemberNotNullOnSetAccessor, 22 | EquatableArray ForwardedAttributes, 23 | string IsReadOnly, 24 | string AccessModifier, 25 | string Inheritance); 26 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/Models/ObservableMethodInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.Globalization; 7 | using ReactiveUI.SourceGenerators.Helpers; 8 | using ReactiveUI.SourceGenerators.Models; 9 | 10 | namespace ReactiveUI.SourceGenerators.ObservableAsProperty.Models 11 | { 12 | internal record ObservableMethodInfo( 13 | TargetInfo TargetInfo, 14 | string MethodName, 15 | string MethodReturnType, 16 | string? ArgumentType, 17 | string PropertyName, 18 | string ObservableType, 19 | bool IsNullableType, 20 | bool IsProperty, 21 | EquatableArray ForwardedPropertyAttributes, 22 | string IsReadOnly, 23 | string AccessModifier, 24 | string? InitialValue) 25 | { 26 | public bool IsFromPartialProperty => ObservableType.Contains("##FromPartialProperty##"); 27 | 28 | public string PartialPropertyType => ObservableType.Replace("##FromPartialProperty##", string.Empty); 29 | 30 | public string GetGeneratedFieldName() 31 | { 32 | var propertyName = PropertyName; 33 | 34 | return $"_{char.ToLower(propertyName[0], CultureInfo.InvariantCulture)}{propertyName.Substring(1)}"; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/ObservableAsProperty/ObservableAsPropertyGenerator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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.Text; 7 | 8 | using Microsoft.CodeAnalysis; 9 | using Microsoft.CodeAnalysis.Text; 10 | 11 | using ReactiveUI.SourceGenerators.Helpers; 12 | 13 | namespace ReactiveUI.SourceGenerators; 14 | 15 | /// 16 | /// Main entry point. 17 | /// 18 | [Generator(LanguageNames.CSharp)] 19 | public sealed partial class ObservableAsPropertyGenerator : IIncrementalGenerator 20 | { 21 | internal static readonly string GeneratorName = typeof(ObservableAsPropertyGenerator).FullName!; 22 | internal static readonly string GeneratorVersion = typeof(ObservableAsPropertyGenerator).Assembly.GetName().Version.ToString(); 23 | 24 | /// 25 | public void Initialize(IncrementalGeneratorInitializationContext context) 26 | { 27 | context.RegisterPostInitializationOutput(ctx => 28 | ctx.AddSource($"{AttributeDefinitions.ObservableAsPropertyAttributeType}.g.cs", SourceText.From(AttributeDefinitions.ObservableAsPropertyAttribute, Encoding.UTF8))); 29 | 30 | RunObservableAsPropertyFromObservable(context); 31 | RunObservableAsPropertyFromField(context); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/Reactive/Models/PropertyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Helpers; 7 | using ReactiveUI.SourceGenerators.Models; 8 | 9 | namespace ReactiveUI.SourceGenerators.Reactive.Models; 10 | 11 | /// 12 | /// A model with gathered info on a given field. 13 | /// 14 | internal sealed record PropertyInfo( 15 | TargetInfo TargetInfo, 16 | string TypeNameWithNullabilityAnnotations, 17 | string FieldName, 18 | string PropertyName, 19 | bool IsReferenceTypeOrUnconstrainedTypeParameter, 20 | bool IncludeMemberNotNullOnSetAccessor, 21 | EquatableArray ForwardedAttributes, 22 | string SetAccessModifier, 23 | string Inheritance, 24 | string UseRequired, 25 | bool IsProperty, 26 | string PropertyAccessModifier); 27 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCommand/Models/CanExecuteTypeInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Input.Models; 7 | 8 | internal enum CanExecuteTypeInfo 9 | { 10 | PropertyObservable, 11 | MethodObservable, 12 | FieldObservable, 13 | } 14 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/ReactiveCommand/Models/CommandInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Helpers; 7 | using ReactiveUI.SourceGenerators.Models; 8 | 9 | namespace ReactiveUI.SourceGenerators.Input.Models; 10 | 11 | internal record CommandInfo( 12 | TargetInfo TargetInfo, 13 | string MethodName, 14 | string MethodReturnType, 15 | string? ArgumentType, 16 | bool IsTask, 17 | bool IsReturnTypeVoid, 18 | bool IsObservable, 19 | string? CanExecuteObservableName, 20 | CanExecuteTypeInfo? CanExecuteTypeInfo, 21 | string? OutputScheduler, 22 | EquatableArray ForwardedPropertyAttributes) 23 | { 24 | private const string UnitTypeName = "global::System.Reactive.Unit"; 25 | 26 | public string GetOutputTypeText() => IsReturnTypeVoid 27 | ? UnitTypeName 28 | : MethodReturnType; 29 | 30 | public string GetInputTypeText() => string.IsNullOrWhiteSpace(ArgumentType) 31 | ? UnitTypeName 32 | : ArgumentType!; 33 | } 34 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/ReactiveUI.SourceGenerators.Roslyn.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | bc460daf-92ed-41d9-9eb4-2c92121d62a8 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/RoutedControlHost/Models/RoutedControlHostInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Helpers; 7 | 8 | namespace ReactiveUI.SourceGenerators.Input.Models; 9 | 10 | /// 11 | /// A model with gathered info on a given command method. 12 | /// 13 | internal sealed record RoutedControlHostInfo( 14 | string FileHintName, 15 | string TargetName, 16 | string TargetNamespace, 17 | string TargetNamespaceWithNamespace, 18 | string TargetVisibility, 19 | string TargetType, 20 | string BaseTypeName, 21 | EquatableArray ForwardedAttributes); 22 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn/ViewModelControlHost/Models/ViewModelControlHostInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025 ReactiveUI and contributors. All rights reserved. 2 | // Licensed to the ReactiveUI and contributors under one or more agreements. 3 | // The ReactiveUI and contributors 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 ReactiveUI.SourceGenerators.Helpers; 7 | 8 | namespace ReactiveUI.SourceGenerators.Input.Models; 9 | 10 | /// 11 | /// A model with gathered info on a given command method. 12 | /// 13 | internal sealed record ViewModelControlHostInfo( 14 | string FileHintName, 15 | string TargetName, 16 | string TargetNamespace, 17 | string TargetNamespaceWithNamespace, 18 | string TargetVisibility, 19 | string TargetType, 20 | string ViewModelTypeName, 21 | EquatableArray ForwardedAttributes); 22 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn4120/ReactiveUI.SourceGenerators.Roslyn4120.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | enable 6 | latest 7 | true 8 | true 9 | true 10 | true 11 | false 12 | true 13 | false 14 | 15 | A MVVM framework that integrates with the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform. This is the Source Generators package for ReactiveUI 16 | ReactiveUI.SourceGenerators 17 | $(DefineConstants);ROSYLN_412 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators.Roslyn480/ReactiveUI.SourceGenerators.Roslyn480.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | enable 6 | latest 7 | true 8 | true 9 | true 10 | true 11 | false 12 | true 13 | false 14 | 15 | A MVVM framework that integrates with the Reactive Extensions for .NET to create elegant, testable User Interfaces that run on any mobile or desktop platform. This is the Source Generators package for ReactiveUI 16 | ReactiveUI.SourceGenerators 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/ReactiveUI.SourceGenerators/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "ReactiveUi_SG": { 4 | "commandName": "DebugRoslynComponent", 5 | "targetProject": "..\\ReactiveUI.SourceGenerators.Execute\\ReactiveUI.SourceGenerators.Execute.csproj" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication.Desktop/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 .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 | 8 | using Avalonia; 9 | using Avalonia.ReactiveUI; 10 | 11 | namespace AvaloniaApplication1.Desktop; 12 | 13 | /// 14 | /// Program. 15 | /// 16 | internal static class Program 17 | { 18 | // Initialization code. Don't use any Avalonia, third-party APIs or any 19 | // SynchronizationContext-reliant code before AppMain is called: things aren't initialized 20 | // yet and stuff might break. 21 | [STAThread] 22 | public static void Main(string[] args) => BuildAvaloniaApp() 23 | .StartWithClassicDesktopLifetime(args); 24 | 25 | // Avalonia configuration, don't remove; also used by visual designer. 26 | public static AppBuilder BuildAvaloniaApp() 27 | => AppBuilder.Configure() 28 | .UsePlatformDetect() 29 | .WithInterFont() 30 | .LogToTrace() 31 | .UseReactiveUI(); 32 | } 33 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication.Desktop/TestAvaloniaApplication.Desktop.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | WinExe 4 | 6 | net8.0 7 | enable 8 | true 9 | app.manifest 10 | false 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication.Desktop/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/App.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/App.axaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 .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 Avalonia; 7 | using Avalonia.Controls.ApplicationLifetimes; 8 | using Avalonia.Markup.Xaml; 9 | 10 | using AvaloniaApplication1.ViewModels; 11 | using AvaloniaApplication1.Views; 12 | 13 | namespace AvaloniaApplication1; 14 | 15 | /// 16 | /// App. 17 | /// 18 | /// 19 | public partial class App : Application 20 | { 21 | /// 22 | /// Initializes the application by loading XAML etc. 23 | /// 24 | public override void Initialize() 25 | { 26 | AvaloniaXamlLoader.Load(this); 27 | } 28 | 29 | /// 30 | /// Called when [framework initialization completed]. 31 | /// 32 | public override void OnFrameworkInitializationCompleted() 33 | { 34 | if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) 35 | { 36 | desktop.MainWindow = new MainWindow 37 | { 38 | DataContext = new MainViewModel() 39 | }; 40 | } 41 | else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) 42 | { 43 | singleViewPlatform.MainView = new MainView 44 | { 45 | DataContext = new MainViewModel() 46 | }; 47 | } 48 | 49 | base.OnFrameworkInitializationCompleted(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/Assets/avalonia-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactiveui/ReactiveUI.SourceGenerators/a09065e50e01261f6df3ab8137b115f3f084180a/src/TestApps/TestAvaloniaApplication/Assets/avalonia-logo.ico -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/TestAvaloniaApplication.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net8.0 4 | enable 5 | latest 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/ViewModels/MainViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 .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 AvaloniaApplication1.ViewModels; 7 | 8 | /// 9 | /// MainViewModel. 10 | /// 11 | /// 12 | public class MainViewModel : ViewModelBase 13 | { 14 | /// 15 | /// Gets the greeting. 16 | /// 17 | /// 18 | /// The greeting. 19 | /// 20 | #pragma warning disable CA1822 // Mark members as static 21 | public string Greeting => "Welcome to Avalonia!"; 22 | #pragma warning restore CA1822 // Mark members as static 23 | } 24 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/ViewModels/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 .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 ReactiveUI; 7 | 8 | namespace AvaloniaApplication1.ViewModels; 9 | 10 | /// 11 | /// ViewModelBase. 12 | /// 13 | /// 14 | public class ViewModelBase : ReactiveObject 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/Views/MainView.axaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/Views/MainView.axaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 .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 Avalonia.Controls; 7 | 8 | namespace AvaloniaApplication1.Views; 9 | 10 | /// 11 | /// MainView. 12 | /// 13 | /// 14 | [ReactiveUI.SourceGenerators.IViewFor] 15 | public partial class MainView : UserControl 16 | { 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | public MainView() 21 | { 22 | InitializeComponent(); 23 | ViewModel = new ViewModels.MainViewModel(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/Views/MainWindow.axaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/TestApps/TestAvaloniaApplication/Views/MainWindow.axaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 .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 Avalonia.Controls; 7 | 8 | namespace AvaloniaApplication1.Views; 9 | 10 | /// 11 | /// MainWindow. 12 | /// 13 | /// 14 | public partial class MainWindow : Window 15 | { 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | public MainWindow() 20 | { 21 | InitializeComponent(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/TestApps/TestMauiApplication/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/TestApps/TestMauiApplication/App.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 .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 MauiApp1 7 | { 8 | /// 9 | /// App. 10 | /// 11 | /// 12 | public partial class App : Application 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// 18 | /// To be added. 19 | /// 20 | public App() 21 | { 22 | InitializeComponent(); 23 | MainPage = new AppShell(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/TestApps/TestMauiApplication/AppShell.xaml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/TestApps/TestMauiApplication/AppShell.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024 .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 MauiApp1 7 | { 8 | /// 9 | /// AppShell. 10 | /// 11 | /// 12 | public partial class AppShell : Shell 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | /// 18 | /// To be added. 19 | /// 20 | public AppShell() 21 | { 22 | InitializeComponent(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/TestApps/TestMauiApplication/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | 10 | 15 | 16 |