CommunityToolkit / CommunityToolkit/Windows

IsEqualStateTrigger with Enum throwing FormatException at runtime

オープン
#46 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug components::triggers
主要言語
C#
スター
1.1k
フォーク
166
PR マージ指標
30日以内にマージされた PR はありません

説明

Bringing this issue from [here](https://github.com/CommunityToolkit/Labs-Windows/issues/216#issuecomment-1542604878)

I've discovered this while using `SettingsCard` and changing it's `ContentAlignment` property at runtime by editing XAML.
The `SettingsCard` uses the trigger like this:
```xaml

```

When I set that property before running the app, it works as it should.
But when I live edit it, it doesn't work and logs `FormatException`.

I found it fails here:
![image](https://github.com/CommunityToolkit/Labs-Windows/assets/13891066/94418914-c6d5-4ab0-9695-c818492c7b58)
![image](https://github.com/CommunityToolkit/Labs-Windows/assets/13891066/a7ed248b-6354-41f4-81c4-a22e77ce254f)

Two more notes:
- I didn't try binding it somewhere
- I'd say this might be occurring in other triggers too, didn't test

I'm running WindowsAppsSDK 1.3

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

IsEqualStateTrigger から始め、Windows App SDK 1.3 を使用して実行時に XAML の値を変更し、SettingsCard ContentAlignment のシナリオを再現します。FormatException を発生させる enum 変換を追跡し、他の state triggers でも同じ問題が発生するか確認します。enum 値をライブ編集しても例外がログに記録されず、trigger が正しく応答すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。