summaryrefslogtreecommitdiff
path: root/Juick/ViewModels/AppViewModel.cs
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-04-26 23:45:22 +0400
committerGravatar Vitaly Takmazov2013-04-26 23:45:22 +0400
commit4b2a51d8858ed3d28dd4af0aa86ca88fe2ec9ab3 (patch)
tree08d3e6e43b5fc5e5958c0570303c291aaa72e955 /Juick/ViewModels/AppViewModel.cs
parent648d914c8d5cf6fe2b3f8271839ec30143172376 (diff)
parentf2a831eb785ca81a069406f7df0f3890ac2be90a (diff)
Merge branch 'fix_repo'
Diffstat (limited to 'Juick/ViewModels/AppViewModel.cs')
-rw-r--r--Juick/ViewModels/AppViewModel.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/Juick/ViewModels/AppViewModel.cs b/Juick/ViewModels/AppViewModel.cs
index 07ba7cf..4b30c08 100644
--- a/Juick/ViewModels/AppViewModel.cs
+++ b/Juick/ViewModels/AppViewModel.cs
@@ -16,7 +16,7 @@ namespace Juick.ViewModels
public class AppViewModel : ViewModelBase
{
static readonly string IsNetworkAvailablePropertyName = ExpressionHelper.GetPropertyName<AppViewModel>(x => x.NetworkUnavailable);
- readonly HttpNotificationChannel _pushChannel;
+ readonly HttpNotificationChannel pushChannel;
// The name of our push channel.
private const string channelName = "JuickChannel";
@@ -26,11 +26,16 @@ namespace Juick.ViewModels
NetworkUnavailable = !DeviceNetworkInformation.IsNetworkAvailable;
}
+ public void UpdateNetworkStatus()
+ {
+ NetworkUnavailable = !DeviceNetworkInformation.IsNetworkAvailable;
+ }
+
public AppViewModel()
{
UpdateNetworkStatus();
NetworkChange.NetworkAddressChanged += (sender, args) => UpdateNetworkStatus();
- _pushChannel = HttpNotificationChannel.Find(channelName);
+ pushChannel = HttpNotificationChannel.Find(channelName);
// If the channel was not found, then create a new connection to the push service.
if (_pushChannel == null)
@@ -129,6 +134,16 @@ namespace Juick.ViewModels
}
}
}
+ private bool _isNetworkUnavailable;
+ public bool NetworkUnavailable
+ {
+ get { return _isNetworkUnavailable; }
+ set
+ {
+ _isNetworkUnavailable = value;
+ NotifyPropertyChanged(IsNetworkAvailablePropertyName);
+ }
+ }
private bool _isNetworkUnavailable;
public bool NetworkUnavailable