だから私はしばらくこれについて頭を悩ませてきましたが、それを理解することはできません. どこでハングアップしているかを確認するためにいくつかのデバッグ手順を実行しましたが、Visual Studio からは何も得られません。基本的に、配列と現在の画像への現在のインデックスを追跡する配列を持つクラスがあります。
ただし、デバッグ中 (またはデバッグしていないとき) は、"index" の値に関係なく、"currentLocation" は更新されません。問題が何であるかを理解できないようです。助言がありますか?
public class TestClass : INotifyPropertyChanged
{
//...
public void GoTo(int index)
{
if (index == currentLocation)
return;
else if (index >= data.Length)
this.currentLocation = data.Length - 1;
else if (index <= 0)
this.currentLocation = 0;
else
this.currentLocation = index;
//this is where the debugging drops off
}
//doesn't matter if I initialize the value or not
//private int _currentLocation = 0;
private int _currentLocation;
public int currentLocation
{
get { return _currentLocation; }
set
{
//never hits this line
this.SetProperty(ref this._currentLocation, value);
//more work
}
}
//...
}