UI コンポーネントの Visibility が ViewModel プロパティにバインドされ、そのプロパティの PropertyChanged が実装されているにもかかわらず、UI がそれ自体の更新をスキップする可能性はありますか?
ビュー/XAML:
<Border Visibility="{Binding ShowLoadingPanel, Converter={StaticResource BoolToHiddenConverter}}">
<TextBlock Text="LOADING..." />
</Border>
ビューモデル:
Public Property ShowLoadingPanel As Boolean
Get
Return _showLoadingPanel
End Get
Set(value As Boolean)
_showLoadingPanel = value
OnPropertyChanged("ShowLoadingPanel")
End Set
End Property
ViewModel から以下を実行する場合:
ShowLoadingPanel = True
RunBigTask() 'runs a task that takes a long time
ShowLoadingPanel = False
...XAML で定義された Border が表示されません。
ただし、ユーザーの操作が必要なものを追加すると、たとえば次のようになります。
ShowLoadingPanel = True
MsgBox("Click to continue")
RunBigTask() 'runs a task that takes a long time
ShowLoadingPanel = False
...その後、必要に応じて境界線が表示されます。
そんなことがあるものか?