-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Wpf IViewFor Generator (#13)
* Feature: Wpf IViewFor Generator * Add Wpf to resolve usings
- Loading branch information
1 parent
bf206c3
commit 48485a9
Showing
14 changed files
with
415 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
using System.Windows; | ||
using ReactiveUI; | ||
using ReactiveUI.SourceGenerators; | ||
|
||
namespace SGReactiveUI.SourceGenerators.Test; | ||
|
||
/// <summary> | ||
/// TestView. | ||
/// </summary> | ||
[IViewFor(nameof(TestViewModel))] | ||
public partial class TestView : Window | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="TestView"/> class. | ||
/// </summary> | ||
public TestView() | ||
{ | ||
ViewModel = TestViewModel.Instance; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/ReactiveUI.SourceGenerators/Attributes/IViewForAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
|
||
namespace ReactiveUI.SourceGenerators; | ||
|
||
/// <summary> | ||
/// ReactiveObjectAttribute. | ||
/// </summary> | ||
/// <seealso cref="System.Attribute" /> | ||
/// <remarks> | ||
/// Initializes a new instance of the <see cref="IViewForAttribute"/> class. | ||
/// </remarks> | ||
/// <param name="viewModelType">Type of the view model.</param> | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] | ||
#pragma warning disable CS9113 // Parameter is unread. | ||
public sealed class IViewForAttribute(string? viewModelType) : Attribute; | ||
#pragma warning restore CS9113 // Parameter is unread. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.