私は、WPF MVVM の列挙状態によって通知される検証に取り組んでいます。検証は、ボタンのクリックによってトリガーされます。これは列挙型とコマンドのコードです:
public enum StatusTest {None, Ok, Error, Processing }
public ICommand TestConnectionCommand
{
get
{
if (_testConnectionCommand == null)
_testConnectionCommand = new RelayCommand(
() => this.Test());
return _testConnectionCommand;
}
}
void Test()
{
Status = StatusTest.Processing;
if ( ValidationMethod()) Status = StatusTest.Ok;
else Status = StatusTest.Error;
}
ボタンの横には、ステータスの変更で塗りつぶしを変更した列挙型 StatusTest にリンクされた円があります。現在、最終ステータス (ok またはエラー) のみが表示され、処理は行われません。検証プロセス中に色処理によって円を塗りつぶすにはどうすればよいですか?