직접 근거
ControlsViewModel 역할 설명 코드 선언
비즈니스 동작이 연결되지 않은 순수 UI 상태에는 DreamineProperty를 ViewModel에서 직접 사용한다고 설명합니다.
public partial class ControlsViewModel : ViewModelBase, IActivatable, IVisibilityAware/// <summary>
/// \if KO
/// <para>Controls View Model 기능과 관련 상태를 캡슐화합니다.</para>
/// \endif
/// \if EN
/// <para>Controls showcase ViewModel. Platform-independent. Reusable across WPF, WinForms, Blazor, and MAUI. Actual behavior lives in <see cref="ControlsEvent"/>; pure UI-only state (no business logic attached) uses [DreamineProperty] directly here.</para>
/// \endif
/// </summary>
public partial class ControlsViewModel : ViewModelBase, IActivatable, IVisibilityAware
{
// ── ViewSwitcher.NotifyShown/NotifyHidden 데모 ──────────
/// <summary>
/// \if KO
20_SOURCES/998. DEMO/000. Sample/050. CrossUi/SampleCrossUi.Shared/ViewModels/ControlsViewModel.cs:90-102직접 근거
DreamineAutoWiringGenerator 선언 코드 선언
DreamineProperty 적용 필드를 기반으로 보조 프로퍼티 코드를 만드는 증분 생성기임을 명시합니다.
public sealed class DreamineAutoWiringGenerator : IIncrementalGenerator
namespace Dreamine.MVVM.Generators
{
/// <summary>
/// <c>DreamineModelAttribute</c>, <c>DreamineEventAttribute</c>,
/// <c>DreaminePropertyAttribute</c>가 적용된 필드를 기반으로
/// 보조 프로퍼티 코드를 생성하는 증분 생성기입니다.
/// </summary>
[Generator]
public sealed class DreamineAutoWiringGenerator : IIncrementalGenerator
{
private const string ModelAttributeMetadataName = "Dreamine.MVVM.Attributes.DreamineModelAttribute";
private const string EventAttributeMetadataName = "Dreamine.MVVM.Attributes.DreamineEventAttribute";
20_SOURCES/100. Library/Generators/DreamineAutoWiringGenerator.cs:9-21직접 근거
DreaminePropertyAttribute 선언 코드 선언
특성이 필드 대상이며, PropertyName 생략 시 필드 이름에서 기본 프로퍼티 이름을 유도한다고 설명합니다.
public sealed class DreaminePropertyAttribute : Attribute /// When <see cref="PropertyName"/> is omitted, the default naming convention derives the property name from the field name.
/// </para>
/// \endif
/// </remarks>
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
public sealed class DreaminePropertyAttribute : Attribute
{
/// <summary>
/// \if KO
/// 생성될 프로퍼티 이름을 가져옵니다.
/// \endif
/// \if EN
/// Gets the name of the property to generate.
20_SOURCES/100. Library/Attributes/DreaminePropertyAttribute.cs:26-38직접 근거
Generator README 코드 선언
DreamineProperty를 포함한 선언적 특성을 기반으로 MVVM 반복 코드를 컴파일 타임에 생성한다고 설명합니다.
This package generates MVVM boilerplate code at compile time based on declarative attributes.
This package generates MVVM boilerplate code at **compile time** based on declarative attributes.
The main attributes currently handled are:
- `DreamineProperty`
- `DreamineEntry`
- `DreamineModel`
- `DreamineEvent`
- `DreamineCommand`
The goal of this package is to reduce repetitive code while keeping generation rules and constraints explicit.
20_SOURCES/100. Library/Generators/README.md:13-25직접 근거
PageSubViewModel의 DreamineProperty 사용 예 코드 선언
`_message` 필드에 `[DreamineProperty]`를 적용한 실제 ViewModel 예제입니다.
[DreamineProperty] private string _message = string.Empty; /// \endif
/// \if EN
/// <para>Stores the message value.</para>
/// \endif
/// </summary>
[DreamineProperty]
private string _message = string.Empty;
/// <summary>
/// \if KO
/// <para>WindowSub 창이 열려 있는지 여부입니다.</para>
/// \endif
/// \if EN
20_SOURCES/998. DEMO/000. Sample/010. Wpfs/SampleSmart/Pages/PageSub/PageSub.xaml.ViewModel.cs:53-65