0

まず、このような質問をするのは本当に申し訳ありませんが、助けていただければ幸いです。プログレスバーを備えたWindows Phone 7.1 1つのアプリケーションがあります。プログレスバーの TwoWay モードをバインドしたいのですが、いろいろ試しましたが、解決策が見つかりませんでした。

ビューモデル:

public class CollectionViewModel : INotifyPropertyChanged
{
    private bool _isLoading;

    public bool IsLoading 
    { 
        get { return _isLoading; }

        set
        {
            if (_isLoading != value)
            {
                _isLoading = value;

                NotifyPropertyChanged("IsLoading");
            }
        }
    }
}

私の PivotPage では、次のように collectionViewModel のインスタンスを PivotItem にバインドします。

 public partial class Main_PivotPage : PhoneApplicationPage
 {
    CollectionViewModel _collectionViewModel;

    public Main_PivotPage()
    {
        InitializeComponent();
        _collectionViewModel = new CollectionViewModel();
        collectionPivotItem.DataContext = _collectionViewModel;
    }
}

このピボットページ内には、IsLoading プロパティにバインドされた ProgressBar があります。

XAML

 <ProgressBar IsIndeterminate="{Binding IsLoading, Mode=TwoWay}"/>

そのプロパティの値を true に変更しても、何も起こりません。プログレスバーの読み込みが開始されません。

4

1 に答える 1