diff --git a/YJMPD-UWP/ViewModels/MatchVM.cs b/YJMPD-UWP/ViewModels/MatchVM.cs index 2bb399f..fd6e3cb 100644 --- a/YJMPD-UWP/ViewModels/MatchVM.cs +++ b/YJMPD-UWP/ViewModels/MatchVM.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Diagnostics; using YJMPD_UWP.Model.Object; namespace YJMPD_UWP.ViewModels @@ -36,7 +37,8 @@ namespace YJMPD_UWP.ViewModels dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { NotifyPropertyChanged(nameof(MatchAvailable)); - NotifyPropertyChanged(nameof(ConnectingServer)); + NotifyPropertyChanged(nameof(ServerAvailable)); + NotifyPropertyChanged(nameof(ServerMessage)); }); } @@ -45,7 +47,8 @@ namespace YJMPD_UWP.ViewModels dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { NotifyPropertyChanged(nameof(MatchAvailable)); - NotifyPropertyChanged(nameof(ConnectingServer)); + NotifyPropertyChanged(nameof(ServerAvailable)); + NotifyPropertyChanged(nameof(ServerMessage)); }); } @@ -77,7 +80,7 @@ namespace YJMPD_UWP.ViewModels } } - public bool ConnectingServer + public bool ServerAvailable { get { @@ -85,6 +88,42 @@ namespace YJMPD_UWP.ViewModels } } + public string ServerMessage + { + get + { + string str = ""; + + switch (App.Network.Status) + { + case Model.NetworkHandler.NetworkStatus.DISCONNECTED: + str = "Disconnected"; + break; + case Model.NetworkHandler.NetworkStatus.CONNECTING: + str = "Connecting to server..."; + break; + } + + switch(App.Geo.Status) + { + case Windows.Devices.Geolocation.PositionStatus.Disabled: + case Windows.Devices.Geolocation.PositionStatus.NotAvailable: + case Windows.Devices.Geolocation.PositionStatus.NoData: + str = "GPS not available"; + break; + case Windows.Devices.Geolocation.PositionStatus.NotInitialized: + case Windows.Devices.Geolocation.PositionStatus.Initializing: + str = "Waiting on GPS..."; + break; + } + + if (str == "") + str = "Connected"; + + return str; + } + } + public bool StartMatch { get diff --git a/YJMPD-UWP/Views/MatchView.xaml b/YJMPD-UWP/Views/MatchView.xaml index de8292b..3993876 100644 --- a/YJMPD-UWP/Views/MatchView.xaml +++ b/YJMPD-UWP/Views/MatchView.xaml @@ -45,9 +45,9 @@ - + - +