몇 가지 방법이 있습니다 - 당신은 그것을 기반 규칙 및 별 제어 규칙없이
당신은 예를 들어, 바쁜 속성을 사용할 수 있습니다를 수행하려는 경우 따라 달라집니다 당신의 통제에서 그런
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
을 당신은 심지어 IsBusy
속성에 텍스트 상자에 IsReadOnly
을 바인딩 할 수 있습니다. 이것은 물론 당신이 비 전통적 방법을 수행하고 Windows Phone 7에서 모두 작동하는 것을 염두에 두어야합니다.
이 작업을 수행하는 간단한 방법을 찾으셨습니까? – Nick