aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-11-13 10:46:15 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-11-13 10:46:15 +0200
commit00525cc261ec117e2eb78ac2a4525fa3da92d399 (patch)
tree9f4c311d915b0305f31925bab4d87a97cf82d790 /Software/Visual_Studio/PPC/Tango.PPC.UI
parent8d4920307ed4bbb6760245728934b91e249fe6c4 (diff)
parent996422d12e0a40aa408757989232f0225dc29a28 (diff)
downloadTango-00525cc261ec117e2eb78ac2a4525fa3da92d399.tar.gz
Tango-00525cc261ec117e2eb78ac2a4525fa3da92d399.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs35
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml23
4 files changed, 64 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs
index e990b50a1..a3420fb01 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs
@@ -115,7 +115,11 @@ namespace Tango.PPC.UI.Connectivity
await RefreshAvailableWiFiNetworks();
var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
- var auto_connect_network = AvailableWiFiNetworks.ToList().FirstOrDefault(x => x.Name == settings.AutoConnectWiFiName);
+ var networks = AvailableWiFiNetworks.ToList();
+
+ var auto_connect_network = networks.FirstOrDefault(x => x.Name == settings.AutoConnectWiFiName);
+
+ IsConnected = networks.Exists(x => x.IsConnected);
if (auto_connect_network != null && !auto_connect_network.IsConnected)
{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
index fd36d0d13..7ac7db47d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows.Threading;
using Tango.Core.Commands;
using Tango.Core.DI;
using Tango.Integration.Operation;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
index e207c30b3..b01be3734 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows.Threading;
using Tango.Core.DI;
using Tango.Integration.ExternalBridge;
using Tango.PPC.Common;
@@ -22,11 +23,45 @@ namespace Tango.PPC.UI.ViewModels
/// <seealso cref="Tango.PPC.Common.PPCViewModel" />
public class MainViewVM : PPCViewModel
{
+ private DispatcherTimer _date_timer;
+
+ private DateTime _currentDateTime;
+ /// <summary>
+ /// Gets or sets the current date time.
+ /// </summary>
+ public DateTime CurrentDateTime
+ {
+ get { return _currentDateTime; }
+ set { _currentDateTime = value; RaisePropertyChangedAuto(); }
+ }
+
+ public MainViewVM()
+ {
+ _date_timer = new DispatcherTimer();
+ _date_timer.Interval = TimeSpan.FromSeconds(1);
+ _date_timer.Tick += _date_timer_Tick;
+ _date_timer.Start();
+ }
+
/// <summary>
/// Called when the application has been started.
/// </summary>
public override void OnApplicationStarted()
{
}
+
+ #region Event Handlers
+
+ /// <summary>
+ /// Handles the Tick event of the _date_timer.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
+ private void _date_timer_Tick(object sender, EventArgs e)
+ {
+ CurrentDateTime = DateTime.Now;
+ }
+
+ #endregion
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
index 8e54f0990..890877bf9 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
@@ -39,6 +39,29 @@
</DataTemplate>
</touch:TouchPanel.NotificationTemplate>
+ <touch:TouchPanel.TaskBarElement>
+ <Border DockPanel.Dock="Top" Background="Black" Padding="5">
+ <DockPanel>
+ <TextBlock VerticalAlignment="Center" DockPanel.Dock="Right" Text="{Binding CurrentDateTime}" FontSize="16" Foreground="{StaticResource TangoPrimaryBackgroundBrush}"></TextBlock>
+ <touch:TouchIcon Width="20" Height="20" VerticalAlignment="Center">
+ <touch:TouchIcon.Style>
+ <Style TargetType="touch:TouchIcon" BasedOn="{StaticResource {x:Type touch:TouchIcon}}">
+ <Setter Property="Icon" Value="WifiStrengthOff"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource TangoGrayBrush}"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding ConnectivityProvider.IsConnected}" Value="True">
+ <Setter Property="Icon" Value="Wifi"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </touch:TouchIcon.Style>
+ </touch:TouchIcon>
+ <Grid></Grid>
+ </DockPanel>
+ </Border>
+ </touch:TouchPanel.TaskBarElement>
+
<controls:NavigationControl TransitionAlwaysFades="True" KeepElementsAttached="True" TransitionType="Zoom" x:Name="NavigationControl" x:FieldModifier="public">
<local:LoadingView></local:LoadingView>
<local:LoginView></local:LoginView>