Tags » Microsoft Windows Phone

Upgraded to Samsung Galaxy Note Edge!

After two or three years of using a tiny 2 1/2″ downgraded feature phone, I finally was able to upgrade to a 6″ smartphone. I researched and seriously thought of getting a Microsoft Windows Phone, but Microsoft stopped making the Nokia Lumia 1520 (the one I really wanted), so I ended up staying with Android. 222 more words

Tech

Simple C# Interlocked use case

Original code in a ViewModel for a Windows Phone application looked like this:

 private readonly object _lock = new object();
 private int _secondsToNextRefresh;
 public int SecondsToNextRefresh
 {
 get { return _secondsToNextRefresh; }
 set { _secondsToNextRefresh = value; RaisePropertyChanged(() => SecondsToNextRefresh); }
 }

 protected void ResetRefreshTimer()
 {
 if (_refreshTimer == null)
 {
  _refreshTimer = new Timer(arg =>
  {
    if (SecondsToNextRefresh == 0)
    {     
     GetData();
     SecondsToNextRefresh = GetSecondsToNextRefresh();
    }
    else
    { 
     ModifySecondsToNextRefresh(SecondsToNextRefresh - RefreshPeriodInSec);
    }
    },null, 0, RefreshPeriodInSec * Constants.MilliSecsPerSec);
  } 
 }

protected int ModifySecondsToNextRefresh(int value)
 { 
   lock (_lock)
  {
   SecondsToNextRefresh = value; 
  }
  return SecondsToNextRefresh;
}

… 78 more words
.NET