newValue argument as Ref for *Changing() generated methods
まだ誰も着手していません。
評価
調査の方向性
ObservableProperty のソース生成エントリポイントから開始し、Issue に示されている ref と non-ref のシグネチャを含め、*Changing methods がどのように生成されるかを確認します。生成された API が代入前の newValue の変更をサポートしていることを検証し、存在する場合は既存のジェネレーターテストまたは生成出力の fixture を確認します。既存のメソッドを壊すことなく、使用例で生成された ref オーバーロードを通じて WindowTitle を前置できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Overview
Hi, I'm migrating some old C# ViewModel code to use the [ObservableProperty] attribute on all the properties.
I'd like to convert the following code:
private string _windowTitle;
public string WindowTitle {
get {
return _windowTitle;
}
set {
_windowTitle = $ "Window title prefix: {value}";
OnPropertyChanged(nameof(WindowTitle));
}
}
...but I couldn't find any "simple" or "standard" method to accomplish the same behavior using the MVVM Toolkit.
I discovered that recently the methods *Changing(string? newValue) or *Changing(string? oldValue, string newValue) got added, but the newValue isn't passed as ref string, so I can't intercept and change the value.
Could this prototype be implemented for those methods? Thanks!
API breakdown
partial void OnWindowTitleChanging(ref string value);
partial void OnWindowTitleChanging(string? oldValue, ref string newValue);
Usage example
partial void OnWindowTitleChanging(string? oldValue, ref string newValue)
{
newValue = "Window title prefix: " + newValue;
}
Breaking change?
I'm not sure
Alternatives
Additional context
No response
Help us help you
No, just wanted to propose this
- 主要言語
- C#
- スター
- 3.8k
- フォーク
- 401
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CommunityToolkit/dotnet のほかの issue
-
RelayCommand<T>.CanExecute(null) returns false for value types without a predicate対応中かも @apachezy が 83 日前に担当しました。 オープンbug :bug:
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
CommunityToolkit/dotnet#1206 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
CommunityToolkit/dotnet#1186 ·
-
bug :bug:
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
CommunityToolkit/dotnet#648 ·
-
bug :bug:
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
CommunityToolkit/dotnet#1215 ·
-
Add segmented buffering and sequence reads to `ArrayPoolBufferWriter<T>`対応中かも @paulomorgado が 21 日前に担当しました。 オープンfeature request :mailbox_with_mail:
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
CommunityToolkit/dotnet#1214 ·
CommunityToolkit/dotnet の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
dette technique priorité: basse zone: service
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
damiensabau/nexus-lobby#25 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sebastienros/jint#4282 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
pyrevitlabs/pyRevit#3792 ·
メンテナーはふだん 1 日以内に返信
-
clawsweeper:needs-product-decision clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security impact:ux-friction issue-rating: 🦞 diamond lobster P2
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
openclaw/openclaw-windows-node#1763 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信