いくつかの方法があります-あなたがそれをコンベンションベースでコントロールごとにやりたいかどうかに依存します
慣例がなければ、忙しいプロパティを使用できます。
class SomeViewModel : Screen // or whatever
{
public bool IsBusy
{
get { // getter code
}
set { // setter code, calling notifypropertychanged
}
}
その後、あなたのコントロールで
<UserControl>
<Grid>
<TextBox>Hello World</TextBox>
<Border Background="#AAFFFFFF"> <!-- Semitransparent overlay -->
<ProgressBar IsIndeterminate="true" Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}" />
</Border>
</Grid>
</UserControl>
コンバーターは次のようになります。
class BooleanToVisibilityConverter : IValueConverter
{
public void Convert(object value, blah blah blah...)
{
if(value is bool)
{
if((bool)value) return Visibility.Visible;
return Visibility.Collapsed;
}
return null;
}
}
このようにして、コントロールで何かが起こっているときにプログレスバーをオーバーレイして、ユーザーが操作できないようにすることができます。
私はそのどれもテストしていないので、あなたは最高のフィット感のために微調整する必要があるかもしれません:P
IsReadOnly
テキストボックスをプロパティにバインドすることもできIsBusy
ます。これはもちろん、これを従来とは異なる方法で実行してもかまわず、すべてWindowsPhone7で機能することを前提としています:)