aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-06 18:39:17 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-06 18:39:17 +0300
commitcff4a8079c4d352cfd47793c701650e62337ed6e (patch)
treeaf145431e541f08ed99b1d3ae377d8a59faedc4f /Software/Visual_Studio
parent776d934a1adc8c58301e56f6639afdeeccb0dda6 (diff)
downloadTango-cff4a8079c4d352cfd47793c701650e62337ed6e.tar.gz
Tango-cff4a8079c4d352cfd47793c701650e62337ed6e.zip
Working on PPC..
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/MessageBoxVM.cs7
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs20
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/MessageBox Icons/information.pngbin1348 -> 2869 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs93
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml27
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml13
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/JobsViewVM.cs31
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs12
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml24
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs37
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/keyboard-iphone.wavbin0 -> 50036 bytes
-rw-r--r--Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml5
-rw-r--r--Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj4
19 files changed, 213 insertions, 90 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
index e5a825013..917a3e168 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
@@ -15,7 +15,7 @@ namespace Tango.PPC.Common.Notifications
public interface INotificationProvider
{
/// <summary>
- /// Gets or sets the current message box.
+ /// Gets the current message box.
/// </summary>
MessageBoxVM CurrentMessageBox { get; }
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/MessageBoxVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/MessageBoxVM.cs
index dbb1d0346..b626df880 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/MessageBoxVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/MessageBoxVM.cs
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows.Media;
using System.Windows.Media.Imaging;
using Tango.PPC.Common.Notifications;
@@ -11,8 +12,14 @@ namespace Tango.PPC.Common.Notifications
{
public class MessageBoxVM : DialogViewVM
{
+ public String Title { get; set; }
+
public BitmapSource Icon { get; set; }
+ public Brush Brush { get; set; }
+
public String Message { get; set; }
+
+ public bool HasCancel { get; set; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
index 58ad2fbed..d9d7097e0 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.Core.DI;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Authentication;
using Tango.PPC.Common.Navigation;
@@ -14,13 +15,17 @@ namespace Tango.PPC.Common
{
public abstract class PPCViewModel : ViewModel
{
- public IPPCApplicationManager ApplicationManager { get; private set; }
+ [TangoInject]
+ public IPPCApplicationManager ApplicationManager { get; set; }
- public IAuthenticationProvider AuthenticationProvider { get; private set; }
+ [TangoInject]
+ public IAuthenticationProvider AuthenticationProvider { get; set; }
- public INavigationManager NavigationManager { get; private set; }
+ [TangoInject]
+ public INavigationManager NavigationManager { get; set; }
- public INotificationProvider NotificationProvider { get; private set; }
+ [TangoInject]
+ public INotificationProvider NotificationProvider { get; set; }
private PPCSettings _settings;
public PPCSettings Settings
@@ -37,12 +42,9 @@ namespace Tango.PPC.Common
private set { _settings = value; }
}
- public PPCViewModel(IPPCApplicationManager application, IAuthenticationProvider authentication, INavigationManager navigation, INotificationProvider notification)
+ public PPCViewModel()
{
- ApplicationManager = application;
- AuthenticationProvider = authentication;
- NavigationManager = navigation;
- NotificationProvider = notification;
+
}
public abstract void OnApplicationStarted();
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml
index 5616ff68f..863a424a0 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml
@@ -1,7 +1,8 @@
<Application x:Class="Tango.PPC.UI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
xmlns:local="clr-namespace:Tango.PPC.UI"
StartupUri="MainWindow.xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d1p1:Ignorable="d" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006">
<Application.Resources>
@@ -20,6 +21,11 @@
<ResourceDictionary Source="Resources/Colors.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resources/Fonts.xaml"></ResourceDictionary>
<ResourceDictionary Source="Resources/Styles.xaml"></ResourceDictionary>
+
+ <!--Converters-->
+ <ResourceDictionary>
+ <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
+ </ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/MessageBox Icons/information.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/MessageBox Icons/information.png
index c56906674..c1c638c6b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/MessageBox Icons/information.png
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/MessageBox Icons/information.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml
index c80a1473c..289d0cdf2 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml
@@ -12,9 +12,9 @@
Foreground="{StaticResource TangoDarkForegroundBrush}">
<Grid>
<Viewbox Stretch="Fill">
- <Grid Height="1280" Width="800">
- <views:MainView/>
- </Grid>
- </Viewbox>
+ <Grid Height="1280" Width="800">
+ <views:MainView/>
+ </Grid>
+ </Viewbox>
</Grid>
</Window>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
index dbaafa6bb..02e41e087 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
@@ -8,16 +8,37 @@ using System.Windows;
using System.Windows.Media;
using Tango.PPC.Common.Notifications;
using Tango.Core;
+using System.Collections.Concurrent;
+using System.Windows.Media.Imaging;
+using Tango.SharedUI.Helpers;
namespace Tango.PPC.UI.Notifications
{
public class DefaultNotificationProvider : ExtendedObject, INotificationProvider
{
+ private class PendingMessageBox
+ {
+ public MessageBoxVM VM { get; set; }
+ public TaskCompletionSource<bool> CompletionSource { get; set; }
+ }
+
+ private ConcurrentQueue<PendingMessageBox> _pendingMessageBoxes;
+
+ public DefaultNotificationProvider()
+ {
+ _pendingMessageBoxes = new ConcurrentQueue<PendingMessageBox>();
+ }
+
private MessageBoxVM _currentMessageBox;
public MessageBoxVM CurrentMessageBox
{
get { return _currentMessageBox; }
- private set { _currentMessageBox = value; RaisePropertyChangedAuto(); }
+ private set
+ {
+ _currentMessageBox = value;
+ RaisePropertyChangedAuto();
+ RaisePropertyChanged(nameof(HasMessageBox));
+ }
}
public bool HasMessageBox
@@ -30,22 +51,84 @@ namespace Tango.PPC.UI.Notifications
public Task ShowError(string message)
{
- throw new NotImplementedException();
+ return ShowMessageBox(new MessageBoxVM()
+ {
+ Message = message,
+ Icon = ResourceHelper.GetImageFromResources("Images/MessageBox Icons/information.png"),
+ Title = "Error",
+ Brush = Application.Current.Resources["TangoMessageBoxErrorBrush"] as Brush,
+ });
}
public Task ShowInfo(string message)
{
- throw new NotImplementedException();
+ return ShowMessageBox(new MessageBoxVM()
+ {
+ Message = message,
+ Icon = ResourceHelper.GetImageFromResources("Images/MessageBox Icons/information.png"),
+ Title = "Information",
+ Brush = Application.Current.Resources["TangoMessageBoxInfoBrush"] as Brush,
+ });
}
public Task ShowWarning(string message)
{
- throw new NotImplementedException();
+ return ShowMessageBox(new MessageBoxVM()
+ {
+ Message = message,
+ Icon = ResourceHelper.GetImageFromResources("Images/MessageBox Icons/information.png"),
+ Title = "Warning",
+ Brush = Application.Current.Resources["TangoMessageBoxWarningBrush"] as Brush,
+ });
}
public Task<bool> ShowQuestion(string message)
{
- throw new NotImplementedException();
+ return ShowMessageBox(new MessageBoxVM()
+ {
+ Message = message,
+ Icon = ResourceHelper.GetImageFromResources("Images/MessageBox Icons/information.png"),
+ Title = "Confirm",
+ HasCancel = true,
+ Brush = Application.Current.Resources["TangoMessageBoxQuestionBrush"] as Brush,
+ });
+ }
+
+ private Task<bool> ShowMessageBox(MessageBoxVM vm)
+ {
+ TaskCompletionSource<bool> source = new TaskCompletionSource<bool>();
+
+ vm.Accepted += () => { OnMessageBoxClosed(); source.SetResult(true); };
+ vm.Canceled += () => { OnMessageBoxClosed(); source.SetResult(false); };
+
+ if (CurrentMessageBox == null)
+ {
+ CurrentMessageBox = vm;
+ }
+ else
+ {
+ _pendingMessageBoxes.Enqueue(new PendingMessageBox()
+ {
+ VM = vm,
+ CompletionSource = source,
+ });
+ }
+
+ return source.Task;
+ }
+
+ private void OnMessageBoxClosed()
+ {
+ CurrentMessageBox = null;
+
+ if (_pendingMessageBoxes.Count > 0)
+ {
+ PendingMessageBox p = null;
+ if (_pendingMessageBoxes.TryDequeue(out p))
+ {
+ CurrentMessageBox = p.VM;
+ }
+ }
}
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml
index a699902b8..07d3b11ac 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml
@@ -8,30 +8,37 @@
xmlns:vm="clr-namespace:Tango.PPC.Common.Notifications;assembly=Tango.PPC.Common"
xmlns:local="clr-namespace:Tango.PanelPC.UI.Notifications"
mc:Ignorable="d"
- d:DesignHeight="200" d:DesignWidth="500" d:DataContext="{d:DesignInstance vm:MessageBoxVM,IsDesignTimeCreatable=False}">
+ d:DesignHeight="400" d:DesignWidth="800" d:DataContext="{d:DesignInstance vm:MessageBoxVM,IsDesignTimeCreatable=False}">
<Grid>
- <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="10" Margin="10" Padding="10">
+ <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="10" Margin="10">
<Border.Effect>
<DropShadowEffect BlurRadius="10" />
</Border.Effect>
<Grid>
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="17*"/>
+ <ColumnDefinition Width="100"/>
<ColumnDefinition Width="75*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
+ <RowDefinition Height="100" />
<RowDefinition Height="1*" />
- <RowDefinition Height="Auto"/>
+ <RowDefinition Height="70"/>
</Grid.RowDefinitions>
- <Image Source="{Binding Icon,FallbackValue='/Images/MessageBox Icons/information.png'}" Margin="10" />
- <TextBlock x:Name="lbMessage" Grid.Column="1" TextWrapping="Wrap" VerticalAlignment="Center" Margin="10,50,10,55" Height="16"></TextBlock>
+ <Image Grid.Row="0" Source="{Binding Icon}" Margin="20" />
+ <TextBlock Grid.Column="1" Text="{Binding Title,TargetNullValue=Confirm}" Foreground="{Binding Brush,TargetNullValue={StaticResource TangoPrimaryAccentBrush}}" VerticalAlignment="Center" Margin="10" Style="{StaticResource TangoMessageBoxTitle}"></TextBlock>
- <UniformGrid Grid.Column="1" Grid.Row="1" HorizontalAlignment="Right" Rows="1" Width="220">
- <touch:TouchButton x:Name="btnCancel" Margin="2" Style="{StaticResource TangoFlatButtonTextOnly}">CANCEL</touch:TouchButton>
- <touch:TouchButton x:Name="btnOK" Margin="2" Style="{StaticResource TangoFlatButtonTextOnly}">OK</touch:TouchButton>
- </UniformGrid>
+ <Rectangle Stroke="{Binding Brush}" VerticalAlignment="Bottom" Grid.ColumnSpan="2" StrokeThickness="3" />
+
+ <TextBlock Grid.Row="1" FontSize="{StaticResource TangoMessageBoxMessageFontSize}" Text="{Binding Message}" VerticalAlignment="Top" Grid.Column="1" TextWrapping="Wrap" Margin="10 20 10 10"></TextBlock>
+
+ <Rectangle Stroke="{StaticResource TangoDividerBrush}" VerticalAlignment="Bottom" Grid.Row="1" Grid.ColumnSpan="2" StrokeThickness="1"/>
+
+ <StackPanel Grid.Column="1" Grid.Row="2" HorizontalAlignment="Right" Orientation="Horizontal">
+ <touch:TouchButton x:Name="btnCancel" Width="180" Margin="2 0" Style="{StaticResource TangoMessageBoxButton}" Command="{Binding CloseCommand}" Visibility="{Binding HasCancel,Converter={StaticResource BooleanToVisibilityConverter}}">CANCEL</touch:TouchButton>
+ <touch:TouchButton x:Name="btnOK" Width="180" Margin="2 0" Style="{StaticResource TangoMessageBoxButton}" Command="{Binding OKCommand}">OK</touch:TouchButton>
+ </StackPanel>
</Grid>
</Border>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml
index 1c24d118b..3b9ccf2fa 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml
@@ -4,4 +4,9 @@
<SolidColorBrush x:Key="TangoKeyboardBackground" Color="Silver" />
+ <SolidColorBrush x:Key="TangoMessageBoxInfoBrush" Color="{StaticResource TangoPrimaryAccentColor}" />
+ <SolidColorBrush x:Key="TangoMessageBoxWarningBrush" Color="#FF9629" />
+ <SolidColorBrush x:Key="TangoMessageBoxErrorBrush" Color="#FF6262" />
+ <SolidColorBrush x:Key="TangoMessageBoxQuestionBrush" Color="{StaticResource TangoPrimaryAccentColor}" />
+
</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml
index 46deceb85..659970db2 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml
@@ -11,5 +11,7 @@
<sys:Double x:Key="TangoNavigationLinksFontSize">18</sys:Double>
<sys:Double x:Key="TangoHeaderFontSize">30</sys:Double>
<sys:Double x:Key="TangoButtonFontSize">20</sys:Double>
+ <sys:Double x:Key="TangoMessageBoxTitleFontSize">30</sys:Double>
+ <sys:Double x:Key="TangoMessageBoxMessageFontSize">20</sys:Double>
</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml
index a82e1acb4..f83d71e92 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml
@@ -22,4 +22,17 @@
<Setter Property="FontSize" Value="{StaticResource TangoButtonFontSize}"></Setter>
</Style>
+ <Style x:Key="TangoMessageBoxButton" TargetType="{x:Type touch:TouchButton}" BasedOn="{StaticResource TangoFlatButton}">
+ <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}"></Setter>
+ <Setter Property="FontSize" Value="{StaticResource TangoButtonFontSize}"></Setter>
+ <Setter Property="BorderBrush" Value="{StaticResource TangoDividerBrush}"></Setter>
+ <Setter Property="BorderThickness" Value="1 0 0 0"></Setter>
+ </Style>
+
+ <Style x:Key="TangoMessageBoxTitle" TargetType="TextBlock">
+ <Setter Property="FontSize" Value="{StaticResource TangoMessageBoxTitleFontSize}"></Setter>
+ <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
+ </Style>
+
</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/JobsViewVM.cs
index b5e3e18fc..2af15b1ad 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/JobsViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/JobsViewVM.cs
@@ -51,20 +51,6 @@ namespace Tango.PPC.UI.ViewModels
public RelayCommand<DropEventArgs> OnDragAndDropCommand { get; set; }
- public JobsViewVM(IPPCApplicationManager application, IAuthenticationProvider authentication, INavigationManager navigation, INotificationProvider notification) : base(application, authentication, navigation, notification)
- {
- Jobs = new ObservableCollection<Job>();
-
- JobSelectedCommand = new RelayCommand((x) => JobSelected(x as Job));
- OnDragAndDropCommand = new RelayCommand<DropEventArgs>((e) =>
- {
- Job draggedJob = e.Draggable.DataContext as Job;
- Job droppedJob = e.Droppable.DataContext as Job;
-
- OnDragAndDropJobs(draggedJob, droppedJob);
- });
- }
-
private void OnDragAndDropJobs(Job draggedJob, Job droppedJob)
{
Debug.WriteLine(draggedJob.Name + " Dragged on to " + droppedJob.Name);
@@ -88,9 +74,24 @@ namespace Tango.PPC.UI.ViewModels
JobsCollectionView.Refresh();
}
- private void JobSelected(Job job)
+ private async void JobSelected(Job job)
{
Debug.WriteLine(job.Name);
+ await NotificationProvider.ShowInfo("Job details not yet implemented...");
+ }
+
+ public JobsViewVM()
+ {
+ Jobs = new ObservableCollection<Job>();
+
+ JobSelectedCommand = new RelayCommand((x) => JobSelected(x as Job));
+ OnDragAndDropCommand = new RelayCommand<DropEventArgs>((e) =>
+ {
+ Job draggedJob = e.Draggable.DataContext as Job;
+ Job droppedJob = e.Droppable.DataContext as Job;
+
+ OnDragAndDropJobs(draggedJob, droppedJob);
+ });
}
public override void OnApplicationStarted()
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
index 37940b2f8..a33dc25d7 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
@@ -17,11 +17,6 @@ namespace Tango.PPC.UI.ViewModels
{
public class LoadingViewVM : PPCViewModel
{
- public LoadingViewVM(IPPCApplicationManager application, IAuthenticationProvider authentication, INavigationManager navigation, INotificationProvider notification) : base(application, authentication, navigation, notification)
- {
-
- }
-
public async override void OnApplicationStarted()
{
await Task.Delay(500);
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 c75e031f1..d1fc4c015 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
@@ -3,18 +3,20 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.PPC.Common;
using Tango.PPC.Common.Application;
+using Tango.PPC.Common.Authentication;
+using Tango.PPC.Common.Navigation;
+using Tango.PPC.Common.Notifications;
using Tango.SharedUI;
namespace Tango.PPC.UI.ViewModels
{
- public class MainViewVM : ViewModel
+ public class MainViewVM : PPCViewModel
{
- public String Test { get; set; }
-
- public MainViewVM(IPPCApplicationManager application)
+ public override void OnApplicationStarted()
{
- Test = "This is a binding test";
+
}
}
}
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 9d264afae..8da05f0dd 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml
@@ -7,6 +7,7 @@
xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
xmlns:global="clr-namespace:Tango.PPC.UI"
xmlns:local="clr-namespace:Tango.PPC.UI.Views"
+ xmlns:notifications="clr-namespace:Tango.PanelPC.UI.Notifications"
mc:Ignorable="d"
d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
<Grid>
@@ -14,5 +15,28 @@
<local:LoadingView controls:NavigationControl.NavigationName="LoadingView"></local:LoadingView>
<local:LayoutView controls:NavigationControl.NavigationName="LayoutView"></local:LayoutView>
</controls:NavigationControl>
+
+ <Grid Background="#9E000000">
+ <Grid.Style>
+ <Style TargetType="Grid">
+ <Setter Property="Opacity" Value="0"></Setter>
+ <Setter Property="Visibility" Value="Hidden"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding NotificationProvider.HasMessageBox}" Value="True">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ <DataTrigger.EnterActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Duration="00:00:0.2" />
+ </Storyboard>
+ </BeginStoryboard>
+ </DataTrigger.EnterActions>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Style>
+
+ <notifications:MessageBox Height="400" Margin="20" DataContext="{Binding NotificationProvider.CurrentMessageBox}" />
+ </Grid>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
index 764299ef4..b0728e087 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
@@ -16,40 +16,15 @@ using System.Windows.Shapes;
using Tango.Core.Commands;
using System.Threading;
using System.Collections.ObjectModel;
+using System.Media;
+using Tango.Core.Helpers;
namespace Tango.Touch.Keyboard
{
- /// <summary>
- /// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
- ///
- /// Step 1a) Using this custom control in a XAML file that exists in the current project.
- /// Add this XmlNamespace attribute to the root element of the markup file where it is
- /// to be used:
- ///
- /// xmlns:MyNamespace="clr-namespace:Tango.Touch.Keyboard"
- ///
- ///
- /// Step 1b) Using this custom control in a XAML file that exists in a different project.
- /// Add this XmlNamespace attribute to the root element of the markup file where it is
- /// to be used:
- ///
- /// xmlns:MyNamespace="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch.Keyboard"
- ///
- /// You will also need to add a project reference from the project where the XAML file lives
- /// to this project and Rebuild to avoid compilation errors:
- ///
- /// Right click on the target project in the Solution Explorer and
- /// "Add Reference"->"Projects"->[Browse to and select this project]
- ///
- ///
- /// Step 2)
- /// Go ahead and use your control in the XAML file.
- ///
- /// <MyNamespace:TouchKeyboard/>
- ///
- /// </summary>
public class TouchKeyboard : Control
{
+ private SoundPlayer _soundPlayer;
+
//The system keyboard event.
[System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)]
static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
@@ -288,6 +263,8 @@ namespace Tango.Touch.Keyboard
NextLanguageCommand = new RelayCommand(NextLanguage);
ActionKeyCommand = new RelayCommand(InvokeActionKey);
NumericKeyCommand = new RelayCommand<object>((x) => SendKeys(x.ToString().Replace("'", "")));
+
+ _soundPlayer = new SoundPlayer(EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.Touch.Keyboard.keyboard-iphone.wav"));
}
private void Initialize()
@@ -389,6 +366,8 @@ namespace Tango.Touch.Keyboard
return Task.Factory.StartNew(() =>
{
+ _soundPlayer.Play();
+
if (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key))
{
Forms.SendKeys.SendWait("{" + key + "}");
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/keyboard-iphone.wav b/Software/Visual_Studio/Tango.Touch/Keyboard/keyboard-iphone.wav
new file mode 100644
index 000000000..760322f91
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/keyboard-iphone.wav
Binary files differ
diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
index a99b8f317..4c979c2d4 100644
--- a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
@@ -22,9 +22,4 @@
<Setter Property="RippleFactor" Value="10"></Setter>
</Style>
- <Style x:Key="TangoFlatButtonTextOnly" TargetType="{x:Type controls:TouchButton}" BasedOn="{StaticResource TangoFlatButton}">
- <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
- <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
- </Style>
-
</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
index 329d9dc53..af184b187 100644
--- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
+++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
@@ -205,6 +205,8 @@
<Name>Tango.SharedUI</Name>
</ProjectReference>
</ItemGroup>
- <ItemGroup />
+ <ItemGroup>
+ <EmbeddedResource Include="Keyboard\keyboard-iphone.wav" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> \ No newline at end of file