Skip to content

OAPH requires setting _nameHelper #47

@stokara

Description

@stokara

Following the docs I tried:

[ObservableAsProperty]
public partial Type SearchTermType { get; }
...
this.WhenAnyValue(x => x.SelectedProperty)
            .WhereNotNull()
            .Select(p => p.Type)
            .ToProperty(this, x => x.SearchTermType);

but when getting to code that references SearchTermType it is null;

however, this code, referencing the generated code backing OAPH field does work:

 _searchTermTypeHelper = this.WhenAnyValue(x => x.SelectedProperty)
     .WhereNotNull()
     .Select(p => p.Type)
     .ToProperty(this, x => x.SearchTermType);

this is the using the approach I see in ReactiveGeneratorDemo.ViewModels.OaphViewModel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions