aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-05 18:54:19 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-05 18:54:19 +0300
commit9c78856e51418bebe66095fecf4c39d9b225e961 (patch)
treea0e2b7354a4805448acf229168dae56b6f3b1cd6
parentb1b9ec165cc318caed1fc9b5919a03029b6cb29e (diff)
downloadTango-9c78856e51418bebe66095fecf4c39d9b225e961.tar.gz
Tango-9c78856e51418bebe66095fecf4c39d9b225e961.zip
Working on PPC !
-rw-r--r--Software/Graphics/information.pngbin0 -> 1348 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/INotificationProvider.cs129
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/TaskItem.cs62
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/DialogViewVM.cs (renamed from Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/DialogViewVM.cs)0
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs51
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/MessageBoxVM.cs18
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Resources.Designer.cs5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Settings.Designer.cs14
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj11
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/packages.config1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml3
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Images/MessageBox Icons/information.pngbin0 -> 1348 bytes
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs89
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml38
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml.cs29
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs49
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Resources.Designer.cs44
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Settings.Designer.cs22
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml15
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml30
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs17
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml12
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml2
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/CapsLockMode.cs15
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyDefinition.cs15
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardActionKeyMode.cs15
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardDefinition.cs448
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardModeToVisibilityConverter.cs25
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardModeToVisibilityInverseConverter.cs25
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardView.xaml47
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardView.xaml.cs172
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/KeysLineDefinition.cs25
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyDefinition.cs21
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyDefinitionToWidthConverter.cs27
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyType.cs14
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboard.xaml445
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboard.xaml.cs436
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboardMode.cs16
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/UIAutomationHelper.cs118
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Keyboard/Win32.cs31
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj27
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchButton.xaml1
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchDataGrid.xaml2
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml1
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.xaml34
-rw-r--r--Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml7
-rw-r--r--Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml5
54 files changed, 335 insertions, 2316 deletions
diff --git a/Software/Graphics/information.png b/Software/Graphics/information.png
new file mode 100644
index 000000000..c56906674
--- /dev/null
+++ b/Software/Graphics/information.png
Binary files differ
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs
index 3a516c072..2a9ca212d 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs
@@ -21,12 +21,6 @@ namespace Tango.PPC.Common.Application
Machine Machine { get; }
/// <summary>
- /// Sets the machine.
- /// </summary>
- /// <param name="machine">The machine.</param>
- void SetMachine(Machine machine);
-
- /// <summary>
/// Occurs when the connected machine property has changed.
/// </summary>
event EventHandler<IMachineOperator> ConnectedMachineChanged;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/INotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/INotificationProvider.cs
deleted file mode 100644
index edad5c1e9..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/INotificationProvider.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Media;
-
-namespace Tango.PPC.Common.Notifications
-{
- /// <summary>
- /// Represents the Machine Studio user notification provider responsible for displaying information, alerts and dialogs to the user.
- /// </summary>
- public interface INotificationProvider
- {
- /// <summary>
- /// Gets the collection of active task items.
- /// </summary>
- ObservableCollection<TaskItem> TaskItems { get; }
-
- /// <summary>
- /// Gets the current displayed task item.
- /// </summary>
- TaskItem CurrentTaskItem { get; }
-
- /// <summary>
- /// Gets a value indicating whether there are any queued task items.
- /// </summary>
- bool HasTaskItems { get; }
-
- /// <summary>
- /// Pushes the specified task item to the queue.
- /// </summary>
- /// <param name="taskItem">The task item.</param>
- void PushTaskItem(TaskItem taskItem);
-
- /// <summary>
- /// Create and push a new task item from the specified message.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <returns></returns>
- TaskItem PushTaskItem(String message);
-
- /// <summary>
- /// Removed the specified task item from the queue.
- /// </summary>
- /// <param name="taskItem">The task item.</param>
- void PopTaskItem(TaskItem taskItem);
-
- /// <summary>
- /// Creates a new instance of the specified View type and displays it as a modal dialog.
- /// </summary>
- /// <typeparam name="View">The type of the view.</typeparam>
- /// <typeparam name="VM">The type of the view model.</typeparam>
- /// <param name="onAccept">Accept button callback.</param>
- /// <param name="onCancel">Cancel button callback.</param>
- void ShowModalDialog<View, VM>(Action<VM> onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM;
-
- /// <summary>
- /// Creates a new view by a naming convention of the specified view model type.
- /// </summary>
- /// <typeparam name="VM">The type of the view model.</typeparam>
- /// <param name="onAccept">Accept button callback.</param>
- /// <param name="onCancel">Cancel button callback.</param>
- void ShowModalDialog<VM>(Action<VM> onAccept, Action onCancel) where VM : DialogViewVM;
-
- /// <summary>
- /// Shows the specified view with the specified view model as it's data context.
- /// </summary>
- /// <typeparam name="VM">The type of the mm.</typeparam>
- /// <typeparam name="View">The type of the view.</typeparam>
- /// <param name="vm">The view model.</param>
- /// <param name="onAccept">The accept action.</param>
- /// <param name="onCancel">The cancel action.</param>
- void ShowModalDialog<VM, View>(VM vm, Action<VM> onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM;
-
- /// <summary>
- /// Shows the specified view with the specified view model as it's data context.
- /// </summary>
- /// <typeparam name="VM">The type of the mm.</typeparam>
- /// <typeparam name="View">The type of the view.</typeparam>
- /// <param name="vm">The view model.</param>
- /// <param name="view">The view.</param>
- /// <param name="onAccept">The accept action.</param>
- /// <param name="onCancel">The cancel action.</param>
- void ShowModalDialog<VM, View>(VM vm, View view, Action<VM> onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM;
-
- /// <summary>
- /// Creates a new view by a naming convention of the specified view model type.
- /// </summary>
- /// <typeparam name="VM">The type of the view model.</typeparam>
- /// <param name="onAccept">Accept button callback.</param>
- void ShowModalDialog<VM>(Action<VM> onAccept) where VM : DialogViewVM;
-
- /// <summary>
- /// Shows an information message box.
- /// </summary>
- /// <param name="message">The message.</param>
- void ShowInfo(String message);
-
- /// <summary>
- /// Shows warning message box.
- /// </summary>
- /// <param name="message">The message.</param>
- void ShowWarning(String message);
-
- /// <summary>
- /// Shows an error message box.
- /// </summary>
- /// <param name="message">The message.</param>
- void ShowError(String message);
-
- /// <summary>
- /// Shows a question message box.
- /// </summary>
- /// <param name="message">The message.</param>
- bool ShowQuestion(String message);
-
- /// <summary>
- /// Shows a dialog with a text input field and returns the response.
- /// </summary>
- /// <param name="message">The message.</param>
- /// <param name="hint">Text field hint.</param>
- /// <param name="defaultResponse">Optional default response.</param>
- /// <returns></returns>
- String ShowTextInput(String message, String hint, String defaultResponse = null);
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/TaskItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/TaskItem.cs
deleted file mode 100644
index b9ffa4a72..000000000
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/TaskItem.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Tango.Core;
-
-namespace Tango.PPC.Common.Notifications
-{
- /// <summary>
- /// Represents a Machine Studio "work-bar" item.
- /// </summary>
- /// <seealso cref="Tango.Core.ExtendedObject" />
- /// <seealso cref="System.IDisposable" />
- public class TaskItem : ExtendedObject, IDisposable
- {
- private INotificationProvider _notificationProvider;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="TaskItem"/> class.
- /// </summary>
- /// <param name="notificationProvider">The notification provider.</param>
- public TaskItem(INotificationProvider notificationProvider)
- {
- _notificationProvider = notificationProvider;
- }
-
- private String _message;
- /// <summary>
- /// Gets or sets the message.
- /// </summary>
- public String Message
- {
- get { return _message; }
- set { _message = value; RaisePropertyChangedAuto(); }
- }
-
- /// <summary>
- /// Removed this item from the queue.
- /// </summary>
- public void Pop()
- {
- _notificationProvider.PopTaskItem(this);
- }
-
- /// <summary>
- /// Pushes this item to the queue.
- /// </summary>
- public void Push()
- {
- _notificationProvider.PushTaskItem(this);
- }
-
- /// <summary>
- /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- /// </summary>
- public void Dispose()
- {
- Pop();
- }
- }
-}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/DialogViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/DialogViewVM.cs
index b7a48f259..b7a48f259 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notification/DialogViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/DialogViewVM.cs
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
new file mode 100644
index 000000000..e5a825013
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media;
+
+namespace Tango.PPC.Common.Notifications
+{
+ /// <summary>
+ /// Represents the Machine Studio user notification provider responsible for displaying information, alerts and dialogs to the user.
+ /// </summary>
+ public interface INotificationProvider
+ {
+ /// <summary>
+ /// Gets or sets the current message box.
+ /// </summary>
+ MessageBoxVM CurrentMessageBox { get; }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance has message box.
+ /// </summary>
+ bool HasMessageBox { get; }
+
+ /// <summary>
+ /// Shows an information message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ Task ShowInfo(String message);
+
+ /// <summary>
+ /// Shows warning message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ Task ShowWarning(String message);
+
+ /// <summary>
+ /// Shows an error message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ Task ShowError(String message);
+
+ /// <summary>
+ /// Shows a question message box.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ Task<bool> ShowQuestion(String message);
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/MessageBoxVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/MessageBoxVM.cs
new file mode 100644
index 000000000..dbb1d0346
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/MessageBoxVM.cs
@@ -0,0 +1,18 @@
+using FontAwesome.WPF;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media.Imaging;
+using Tango.PPC.Common.Notifications;
+
+namespace Tango.PPC.Common.Notifications
+{
+ public class MessageBoxVM : DialogViewVM
+ {
+ public BitmapSource Icon { get; set; }
+
+ public String Message { 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 d728b7939..58ad2fbed 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCViewModel.cs
@@ -46,5 +46,10 @@ namespace Tango.PPC.Common
}
public abstract void OnApplicationStarted();
+
+ public virtual void OnApplicationShuttingDown()
+ {
+
+ }
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs
index 3394347d0..6ce3aa6fa 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs
@@ -11,7 +11,7 @@ using System.Windows;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Tango.PanelPC.Common")]
+[assembly: AssemblyProduct("Tango.PPC.Common")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Resources.Designer.cs
index 243da50ac..60e2bdb01 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Resources.Designer.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Resources.Designer.cs
@@ -9,6 +9,7 @@
//------------------------------------------------------------------------------
namespace Tango.PPC.Common.Properties {
+ using System;
/// <summary>
@@ -37,8 +38,8 @@ namespace Tango.PPC.Common.Properties {
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
- if ((resourceMan == null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PanelPC.Common.Properties.Resources", typeof(Resources).Assembly);
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PPC.Common.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Settings.Designer.cs
index 8537a6bb1..8fe4f50ad 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Settings.Designer.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/Settings.Designer.cs
@@ -8,21 +8,17 @@
// </auto-generated>
//------------------------------------------------------------------------------
-namespace Tango.PPC.Common.Properties
-{
+namespace Tango.PPC.Common.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
- public static Settings Default
- {
- get
- {
+ public static Settings Default {
+ get {
return defaultInstance;
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
index 17c08bfb8..77667b147 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
@@ -6,7 +6,7 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0BE74EEE-22CB-4DBA-B896-793B9E1A3AC0}</ProjectGuid>
<OutputType>library</OutputType>
- <RootNamespace>Tango.PanelPC.Common</RootNamespace>
+ <RootNamespace>Tango.PPC.Common</RootNamespace>
<AssemblyName>Tango.PPC.Common</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
@@ -54,6 +54,9 @@
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
+ <Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath>
+ </Reference>
<Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
@@ -117,9 +120,9 @@
<Compile Include="EventLogging\IEventLogger.cs" />
<Compile Include="Navigation\INavigationManager.cs" />
<Compile Include="Navigation\NavigationView.cs" />
- <Compile Include="Notification\DialogViewVM.cs" />
- <Compile Include="Notification\INotificationProvider.cs" />
- <Compile Include="Notification\TaskItem.cs" />
+ <Compile Include="Notifications\DialogViewVM.cs" />
+ <Compile Include="Notifications\INotificationProvider.cs" />
+ <Compile Include="Notifications\MessageBoxVM.cs" />
<Compile Include="PPCSettings.cs" />
<Compile Include="PPCViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/packages.config b/Software/Visual_Studio/PPC/Tango.PPC.Common/packages.config
index 8ed1c5f7f..1cd27f563 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/packages.config
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/packages.config
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EntityFramework" version="6.0.0" targetFramework="net46" />
+ <package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" />
<package id="Google.Protobuf" version="3.4.1" targetFramework="net46" />
<package id="System.Data.SQLite" version="1.0.108.0" targetFramework="net46" />
<package id="System.Data.SQLite.Core" version="1.0.108.0" targetFramework="net46" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml
index a2cba71b1..5616ff68f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml
@@ -16,9 +16,10 @@
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchIconButton.xaml" />
-
<!--Local-->
<ResourceDictionary Source="Resources/Colors.xaml"></ResourceDictionary>
+ <ResourceDictionary Source="Resources/Fonts.xaml"></ResourceDictionary>
+ <ResourceDictionary Source="Resources/Styles.xaml"></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
new file mode 100644
index 000000000..c56906674
--- /dev/null
+++ 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 2465abc3d..c80a1473c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml
@@ -6,7 +6,10 @@
xmlns:local="clr-namespace:Tango.PPC.UI"
xmlns:views="clr-namespace:Tango.PPC.UI.Views"
mc:Ignorable="d"
- Title="MainWindow" Height="1000" Stylus.IsTapFeedbackEnabled="False" Stylus.IsPressAndHoldEnabled="False" Stylus.IsTouchFeedbackEnabled="False" Width="625" WindowStyle="None" ResizeMode="NoResize" FontFamily="{StaticResource TangoFlexoFontFamily}">
+ Title="MainWindow" Height="1000" Stylus.IsTapFeedbackEnabled="False" Stylus.IsPressAndHoldEnabled="False" Stylus.IsTouchFeedbackEnabled="False" Width="625" WindowStyle="None" ResizeMode="NoResize"
+ FontFamily="{StaticResource TangoFlexoFontFamily}"
+ FontSize="{StaticResource TangoDefaultFontSize}"
+ Foreground="{StaticResource TangoDarkForegroundBrush}">
<Grid>
<Viewbox Stretch="Fill">
<Grid Height="1280" Width="800">
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 7f97f2a49..dbaafa6bb 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
@@ -6,109 +6,44 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
-using FontAwesome.WPF;
using Tango.PPC.Common.Notifications;
+using Tango.Core;
namespace Tango.PPC.UI.Notifications
{
- public class DefaultNotificationProvider : INotificationProvider
+ public class DefaultNotificationProvider : ExtendedObject, INotificationProvider
{
- public ObservableCollection<TaskItem> TaskItems
+ private MessageBoxVM _currentMessageBox;
+ public MessageBoxVM CurrentMessageBox
{
- get
- {
- throw new NotImplementedException();
- }
+ get { return _currentMessageBox; }
+ private set { _currentMessageBox = value; RaisePropertyChangedAuto(); }
}
- public TaskItem CurrentTaskItem
+ public bool HasMessageBox
{
get
{
- throw new NotImplementedException();
+ return CurrentMessageBox != null;
}
}
- public bool HasTaskItems
- {
- get
- {
- throw new NotImplementedException();
- }
- }
-
- public void PopTaskItem(TaskItem taskItem)
- {
- throw new NotImplementedException();
- }
-
- public void PushTaskItem(TaskItem taskItem)
- {
- throw new NotImplementedException();
- }
-
- public TaskItem PushTaskItem(string message)
- {
- throw new NotImplementedException();
- }
-
- public void ShowError(string message)
- {
- throw new NotImplementedException();
- }
-
- public void ShowInfo(string message)
- {
- throw new NotImplementedException();
- }
-
- public bool? ShowMessageBox(FontAwesomeIcon icon, Brush iconColor, string message, bool hasCancel)
- {
- throw new NotImplementedException();
- }
-
- public void ShowModalDialog<View, VM>(Action<VM> onAccept, Action onCancel)
- where View : FrameworkElement
- where VM : DialogViewVM
- {
- throw new NotImplementedException();
- }
-
- public void ShowModalDialog<VM>(Action<VM> onAccept, Action onCancel) where VM : DialogViewVM
- {
- throw new NotImplementedException();
- }
-
- public void ShowModalDialog<VM, View>(VM vm, Action<VM> onAccept, Action onCancel)
- where VM : DialogViewVM
- where View : FrameworkElement
- {
- throw new NotImplementedException();
- }
-
- public void ShowModalDialog<VM, View>(VM vm, View view, Action<VM> onAccept, Action onCancel)
- where VM : DialogViewVM
- where View : FrameworkElement
- {
- throw new NotImplementedException();
- }
-
- public void ShowModalDialog<VM>(Action<VM> onAccept) where VM : DialogViewVM
+ public Task ShowError(string message)
{
throw new NotImplementedException();
}
- public bool ShowQuestion(string message)
+ public Task ShowInfo(string message)
{
throw new NotImplementedException();
}
- public string ShowTextInput(string message, string hint, string defaultResponse = null)
+ public Task ShowWarning(string message)
{
throw new NotImplementedException();
}
- public void ShowWarning(string message)
+ public Task<bool> ShowQuestion(string message)
{
throw new NotImplementedException();
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml
new file mode 100644
index 000000000..a699902b8
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml
@@ -0,0 +1,38 @@
+<UserControl x:Class="Tango.PanelPC.UI.Notifications.MessageBox"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:fa="http://schemas.fontawesome.io/icons/"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ 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}">
+ <Grid>
+ <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="10" Margin="10" Padding="10">
+ <Border.Effect>
+ <DropShadowEffect BlurRadius="10" />
+ </Border.Effect>
+
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="17*"/>
+ <ColumnDefinition Width="75*"/>
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="1*" />
+ <RowDefinition Height="Auto"/>
+ </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>
+
+ <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>
+ </Grid>
+ </Border>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml.cs
new file mode 100644
index 000000000..a13cfe81f
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml.cs
@@ -0,0 +1,29 @@
+using FontAwesome.WPF;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.PanelPC.UI.Notifications
+{
+ /// <summary>
+ /// Interaction logic for MessageBox.xaml
+ /// </summary>
+ public partial class MessageBox : UserControl
+ {
+ public MessageBox()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
index 29b9f7823..6c2afb403 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs
@@ -12,18 +12,14 @@ using Tango.Core.DI;
using Tango.PPC.Common;
using System.Windows;
using Tango.Core;
+using System.IO;
+using Tango.Core.Helpers;
namespace Tango.PPC.UI.PPCApplication
{
public class DefaultPPCApplicationManager : ExtendedObject, IPPCApplicationManager
{
- public bool IsShuttingDown
- {
- get
- {
- throw new NotImplementedException();
- }
- }
+ public bool IsShuttingDown { get; private set; }
public IMachineOperator ConnectedMachine
{
@@ -65,8 +61,35 @@ namespace Tango.PPC.UI.PPCApplication
{
if (!DesignMode)
{
- MainWindow.Instance.ContentRendered += (_, __) =>
+ MainWindow.Instance.ContentRendered += async (_, __) =>
{
+ await Task.Factory.StartNew(() =>
+ {
+ //TODO: Use this in the future.
+
+ //#if DEBUG
+ // DataSource = "localhost\\SQLEXPRESS";
+ //#else
+ // DataBaseSettings.DefaultDataSource = Path.Combine(PathHelper.GetUserTangoFolder(), "DB", "Tango.db");
+ //#endif
+
+ CoreSettings.DefaultDataBaseSource = Path.Combine(PathHelper.GetUserTangoFolder(), "DB", "Tango.db");
+
+ if (!File.Exists(CoreSettings.DefaultDataBaseSource))
+ {
+ Directory.CreateDirectory(Path.GetDirectoryName(CoreSettings.DefaultDataBaseSource));
+ File.Copy(Path.Combine(PathHelper.GetStartupPath(), "DB", "Tango.db"), CoreSettings.DefaultDataBaseSource);
+ }
+
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); ;
+
+ using (ObservablesContext db = ObservablesContext.CreateDefault())
+ {
+ Machine = db.Machines.SingleOrDefault(x => x.SerialNumber == settings.MachineSerialNumber);
+ }
+
+ });
+
foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<PPCViewModel>())
{
vm.OnApplicationStarted();
@@ -77,12 +100,12 @@ namespace Tango.PPC.UI.PPCApplication
public void ShutDown()
{
- throw new NotImplementedException();
- }
+ IsShuttingDown = true;
- public void SetMachine(Machine machine)
- {
- Machine = machine;
+ foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<PPCViewModel>())
+ {
+ vm.OnApplicationShuttingDown();
+ }
}
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
index acd22cb21..18397f182 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
@@ -11,7 +11,7 @@ using System.Windows;
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Tango.PanelPC.UI")]
+[assembly: AssemblyProduct("Tango.PPC.UI")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Resources.Designer.cs
index 3af06554c..6e810124c 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Resources.Designer.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Resources.Designer.cs
@@ -8,10 +8,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
-namespace Tango.PPC.UI.Properties
-{
-
-
+namespace Tango.PPC.UI.Properties {
+ using System;
+
+
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -22,48 +22,40 @@ namespace Tango.PPC.UI.Properties
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
+ internal class Resources {
+
private static global::System.Resources.ResourceManager resourceMan;
-
+
private static global::System.Globalization.CultureInfo resourceCulture;
-
+
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
+ internal Resources() {
}
-
+
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PanelPC.UI.Properties.Resources", typeof(Resources).Assembly);
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PPC.UI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
-
+
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
return resourceCulture;
}
- set
- {
+ set {
resourceCulture = value;
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Settings.Designer.cs
index dab4cb31e..46e3b6e70 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Settings.Designer.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Settings.Designer.cs
@@ -8,21 +8,17 @@
// </auto-generated>
//------------------------------------------------------------------------------
-namespace Tango.PPC.UI.Properties
-{
-
-
+namespace Tango.PPC.UI.Properties {
+
+
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
+
+ public static Settings Default {
+ get {
return defaultInstance;
}
}
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 4bbd08a06..1c24d118b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml
@@ -2,4 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Tango.PPC.UI.Resources">
+ <SolidColorBrush x:Key="TangoKeyboardBackground" Color="Silver" />
+
</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
new file mode 100644
index 000000000..46deceb85
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml
@@ -0,0 +1,15 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
+ xmlns:local="clr-namespace:Tango.PPC.UI.Resources">
+
+ <FontFamily x:Key="TangoFlexoFontFamily">Flexo</FontFamily>
+
+ <sys:Double x:Key="TangoDefaultFontSize">16</sys:Double>
+ <sys:Double x:Key="TangoKeyboardFontSize">20</sys:Double>
+ <sys:Double x:Key="TangoDataGridHeaderFontSize">16</sys:Double>
+ <sys:Double x:Key="TangoNavigationLinksFontSize">18</sys:Double>
+ <sys:Double x:Key="TangoHeaderFontSize">30</sys:Double>
+ <sys:Double x:Key="TangoButtonFontSize">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 110bbfc86..a82e1acb4 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml
@@ -1,19 +1,25 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:local="clr-namespace:Tango.PPC.UI.Resources">
- <Style x:Key="JobsListBoxItem" TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
- <Setter Property="BorderBrush" Value="Silver"></Setter>
- <Setter Property="BorderThickness" Value="0 0 0 1"></Setter>
- <Setter Property="Focusable" Value="False"></Setter>
- <Setter Property="Background" Value="White"></Setter>
- </Style>
-
-
+ <Style TargetType="{x:Type keyboard:TouchKeyboard}" BasedOn="{StaticResource {x:Type keyboard:TouchKeyboard}}">
+ <Setter Property="FontSize" Value="{StaticResource TangoKeyboardFontSize}"></Setter>
+ <Setter Property="VectorMarkupSize" Value="25"></Setter>
+ <Setter Property="Margin" Value="5"></Setter>
+ </Style>
- <Style x:Key="JobsListBox" TargetType="ListBox" BasedOn="{StaticResource {x:Type ListBox}}">
- <Setter Property="ItemContainerStyle" Value="{StaticResource JobsListBoxItem}"></Setter>
- <Setter Property="Background" Value="#f2f5fa"></Setter>
- </Style>
+ <Style TargetType="{x:Type touch:TouchDataGrid}" BasedOn="{StaticResource {x:Type touch:TouchDataGrid}}">
+ <Style.Resources>
+ <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
+ <Setter Property="FontSize" Value="{StaticResource TangoDataGridHeaderFontSize}"></Setter>
+ </Style>
+ </Style.Resources>
+ </Style>
+
+ <Style TargetType="{x:Type touch:TouchButton}" BasedOn="{StaticResource {x:Type touch:TouchButton}}">
+ <Setter Property="FontSize" Value="{StaticResource TangoButtonFontSize}"></Setter>
+ </Style>
</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
index 808aa4b5d..bad23c655 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
@@ -6,7 +6,7 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{654BEDA3-16FB-44FF-ADE7-B52E50B02E63}</ProjectGuid>
<OutputType>WinExe</OutputType>
- <RootNamespace>Tango.PanelPC.UI</RootNamespace>
+ <RootNamespace>Tango.PPC.UI</RootNamespace>
<AssemblyName>Tango.PPC.UI</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
@@ -91,6 +91,9 @@
</ApplicationDefinition>
<Compile Include="Navigation\DefaultNavigationManager.cs" />
<Compile Include="Notifications\DefaultNotificationProvider.cs" />
+ <Compile Include="Notifications\MessageBox.xaml.cs">
+ <DependentUpon>MessageBox.xaml</DependentUpon>
+ </Compile>
<Compile Include="PPCApplication\DefaultPPCApplicationManager.cs" />
<Compile Include="ViewModelLocator.cs" />
<Compile Include="ViewModels\JobsViewVM.cs" />
@@ -121,10 +124,18 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
+ <Page Include="Notifications\MessageBox.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Resources\Colors.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Resources\Fonts.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Resources\Styles.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -242,6 +253,9 @@
<ItemGroup>
<Resource Include="Images\warning.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\MessageBox Icons\information.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
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 df4a9c8e2..37940b2f8 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs
@@ -25,23 +25,6 @@ namespace Tango.PPC.UI.ViewModels
public async override void OnApplicationStarted()
{
await Task.Delay(500);
-
- //TODO: Use this in the future.
-
- //#if DEBUG
- // DataSource = "localhost\\SQLEXPRESS";
- //#else
- // DataBaseSettings.DefaultDataSource = Path.Combine(PathHelper.GetUserTangoFolder(), "DB", "Tango.db");
- //#endif
-
- CoreSettings.DefaultDataBaseSource = Path.Combine(PathHelper.GetUserTangoFolder(), "DB", "Tango.db");
-
- if (!File.Exists(CoreSettings.DefaultDataBaseSource))
- {
- Directory.CreateDirectory(Path.GetDirectoryName(CoreSettings.DefaultDataBaseSource));
- File.Copy(Path.Combine(PathHelper.GetStartupPath(), "DB", "Tango.db"), CoreSettings.DefaultDataBaseSource);
- }
-
NavigationManager.NavigateTo(NavigationView.LayoutView);
NavigationManager.NavigateTo(NavigationView.JobsView);
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml
index bbea55764..c67d09445 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml
@@ -6,7 +6,7 @@
xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
xmlns:global="clr-namespace:Tango.PPC.UI"
xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
- xmlns:keyboard="clr-namespace:Tango.SharedUI.Keyboard;assembly=Tango.SharedUI"
+ xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
xmlns:converters="clr-namespace:Tango.PPC.Common.Converters;assembly=Tango.PPC.Common"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:touchComponents="clr-namespace:Tango.Touch.Components;assembly=Tango.Touch"
@@ -26,15 +26,15 @@
<Grid Background="{StaticResource TangoMidBackgroundBrush}">
<Grid.RowDefinitions>
- <RowDefinition Height="82"/>
+ <RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
- <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}">
+ <Border Padding="20" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}">
<Border.Effect>
<DropShadowEffect Color="Silver" ShadowDepth="0" BlurRadius="20" Opacity="1" />
</Border.Effect>
- <TextBlock VerticalAlignment="Center" Margin="20" FontSize="{StaticResource TangoPageHeaderFontSize}" FontWeight="SemiBold">Jobs</TextBlock>
+ <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold">Jobs</TextBlock>
</Border>
<Grid Grid.Row="1">
@@ -49,7 +49,7 @@
<touch:TouchIconButton Padding="20" Icon="Refresh" Style="{StaticResource TangoRoundTouchIconButton}"></touch:TouchIconButton>
</StackPanel>
- <touch:TouchNavigationLinks VerticalAlignment="Bottom" Margin="20">
+ <touch:TouchNavigationLinks VerticalAlignment="Bottom" Margin="20" FontSize="{StaticResource TangoNavigationLinksFontSize}">
<sys:String>READY TO DYE</sys:String>
<sys:String>NOT READY</sys:String>
<sys:String>ALL</sys:String>
@@ -124,6 +124,8 @@
</DataGridTemplateColumn>
</touch:TouchDataGrid.Columns>
</touch:TouchDataGrid>
+
+ <TextBox VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="100" Width="200" keyboard:KeyboardView.Mode="Alpha"></TextBox>
</Grid>
</Grid>
</Grid>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
index e039ad14e..fb5cb4f8b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
@@ -94,7 +94,7 @@
</DockPanel>
</Border>
- <Grid Background="{StaticResource TangoMidBackgroundBrush}">
+ <Grid Background="{StaticResource TangoKeyboardBackground}">
<Grid>
<keyboard:KeyboardView>
<controls:NavigationControl x:Name="NavigationControl" x:FieldModifier="public" TransitionAlwaysFades="False" TransitionType="Slide">
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/CapsLockMode.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/CapsLockMode.cs
deleted file mode 100644
index c88194493..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/CapsLockMode.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.SharedUI.Keyboard
-{
- public enum CapsLockMode
- {
- None,
- SingleChar,
- Locked
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyDefinition.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyDefinition.cs
deleted file mode 100644
index 2f8dedc87..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyDefinition.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.SharedUI.Keyboard
-{
- public class KeyDefinition
- {
- public String StandardText { get; set; }
- public String CapsText { get; set; }
- public String HoldText { get; set; }
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardActionKeyMode.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardActionKeyMode.cs
deleted file mode 100644
index 42a55b629..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardActionKeyMode.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.SharedUI.Keyboard
-{
- public enum KeyboardActionKeyMode
- {
- Tab,
- Enter,
- Search,
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardDefinition.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardDefinition.cs
deleted file mode 100644
index d21694a27..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardDefinition.cs
+++ /dev/null
@@ -1,448 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Input;
-
-namespace Tango.SharedUI.Keyboard
-{
- public class KeyboardDefinition
- {
- public String Name { get; set; }
-
- public String LanguageCode { get; set; }
-
- public String EnterText { get; set; }
-
- public String TabText { get; set; }
-
- public List<KeysLineDefinition> KeysLinesDefinitions { get; set; }
-
- public KeyboardDefinition()
- {
- KeysLinesDefinitions = new List<KeysLineDefinition>();
- }
-
- private static KeyboardDefinition _default;
-
- public static KeyboardDefinition Default
- {
- get
- {
- if (_default == null)
- {
- _default = CreateDefaultAlphaNumeric();
- }
-
- return _default;
- }
- set { _default = value; }
- }
-
- internal static KeyboardDefinition CreateDefaultHebrewAlphaNumeric()
- {
- KeyboardDefinition definition = new KeyboardDefinition();
-
- definition.Name = "Hebrew";
- definition.LanguageCode = "HE";
- definition.EnterText = "בצע";
- definition.TabText = "הבא";
-
- KeysLineDefinition line1 = new KeysLineDefinition();
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = ",",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = ".",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ק",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ר",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "א",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ט",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ו",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ן",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ם",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "פ",
- });
-
- KeysLineDefinition line2 = new KeysLineDefinition();
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ש",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ד",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ג",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "כ",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ע",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "י",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ח",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ל",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ך",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ף",
- });
-
- KeysLineDefinition line3 = new KeysLineDefinition();
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ז",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ס",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ב",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ה",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "נ",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "מ",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "צ",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ת",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "ץ",
- });
-
- line3.SpecialRightKeyDefinitions.Add(new SpecialKeyDefinition()
- {
- Type = SpecialKeyType.StandardText,
- VectorMarkup = "M561 76.5H178.5c-17.85 0-30.6 7.65-40.8 22.95L0 306l137.7 206.55c10.2 12.75 22.95 22.95 40.8 22.95H561 c28.05 0 51-22.95 51-51v-357C612 99.45 589.05 76.5 561 76.5z M484.5 397.8l-35.7 35.7L357 341.7l-91.8 91.8l-35.7-35.7 l91.8-91.8l-91.8-91.8l35.7-35.7l91.8 91.8l91.8-91.8l35.7 35.7L392.7 306L484.5 397.8z",
- Output = "{BACKSPACE}",
- });
-
- definition.KeysLinesDefinitions.Add(line1);
- definition.KeysLinesDefinitions.Add(line2);
- definition.KeysLinesDefinitions.Add(line3);
-
- return definition;
- }
-
- private static KeyboardDefinition CreateDefaultAlphaNumeric()
- {
- KeyboardDefinition definition = new KeyboardDefinition();
-
- definition.Name = "English";
- definition.LanguageCode = "EN";
- definition.EnterText = "GO";
- definition.TabText = "NEXT";
-
- KeysLineDefinition line1 = new KeysLineDefinition();
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "q",
- CapsText = "Q",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "w",
- CapsText = "W",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "e",
- CapsText = "E",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "r",
- CapsText = "R",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "t",
- CapsText = "T",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "y",
- CapsText = "Y",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "u",
- CapsText = "U",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "i",
- CapsText = "I",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "o",
- CapsText = "O",
- });
-
- line1.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "p",
- CapsText = "P",
- });
-
- KeysLineDefinition line2 = new KeysLineDefinition();
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "a",
- CapsText = "A",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "s",
- CapsText = "S",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "d",
- CapsText = "D",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "f",
- CapsText = "F",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "g",
- CapsText = "G",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "h",
- CapsText = "H",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "j",
- CapsText = "J",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "k",
- CapsText = "K",
- });
-
- line2.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "l",
- CapsText = "L",
- });
-
- KeysLineDefinition line3 = new KeysLineDefinition();
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "z",
- CapsText = "Z",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "x",
- CapsText = "X",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "c",
- CapsText = "C",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "v",
- CapsText = "V",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "b",
- CapsText = "B",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "n",
- CapsText = "N",
- });
-
- line3.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "m",
- CapsText = "M",
- });
-
- line3.SpecialLeftKeyDefinitions.Add(new SpecialKeyDefinition()
- {
- VectorMarkup = "M235.252 13.406l-0.447-0.998c-3.417-7.622-11.603-12.854-19.677-12.375l-0.3 0.016l-0.302-0.016 C214.194 0.011 213.856 0 213.524 0c-7.706 0-15.386 5.104-18.674 12.413l-0.452 0.998L13.662 176.079 c-6.871 6.183-6.495 12.657-4.971 16.999c2.661 7.559 10.361 13.373 18.313 13.82l1.592 0.297c0.68 0.168 1.356 0.348 2.095 0.427 c23.036 2.381 45.519 2.876 64.472 3.042l5.154 0.048V407.93c0 11.023 7.221 15.152 11.522 16.635l0.967 0.33l0.77 0.671 c3.105 2.717 7.02 4.093 11.644 4.093h179.215c4.626 0 8.541-1.376 11.639-4.093l0.771-0.671l0.965-0.33 c4.307-1.482 11.532-5.611 11.532-16.635V210.706l5.149-0.048c18.961-0.17 41.446-0.666 64.475-3.042 c0.731-0.079 1.407-0.254 2.082-0.422l1.604-0.302c7.952-0.447 15.65-6.262 18.312-13.82c1.528-4.336 1.899-10.811-4.972-16.998 L235.252 13.406z M344.114 173.365c-11.105 0.18-22.216 0.254-33.337 0.254c-5.153 0-9.363 1.607-12.507 4.768 c-3.372 3.4-5.296 8.48-5.266 13.932l0.005 0.65l-0.157 0.629c-0.437 1.767-0.64 3.336-0.64 4.928v194.001H137.458V198.526 c0-1.597-0.201-3.161-0.638-4.928l-0.157-0.629l0.005-0.65c0.031-5.456-1.892-10.537-5.271-13.937 c-3.141-3.161-7.353-4.763-12.507-4.768c-11.124 0-22.224-0.074-33.337-0.254l-13.223-0.218L214.834 44.897l142.503 128.249 L344.114 173.365z",
- Output = "{CAPSLOCK}",
- Type = SpecialKeyType.CapsLock,
- });
-
- line3.SpecialRightKeyDefinitions.Add(new SpecialKeyDefinition()
- {
- Type = SpecialKeyType.StandardText,
- VectorMarkup = "M561 76.5H178.5c-17.85 0-30.6 7.65-40.8 22.95L0 306l137.7 206.55c10.2 12.75 22.95 22.95 40.8 22.95H561 c28.05 0 51-22.95 51-51v-357C612 99.45 589.05 76.5 561 76.5z M484.5 397.8l-35.7 35.7L357 341.7l-91.8 91.8l-35.7-35.7 l91.8-91.8l-91.8-91.8l35.7-35.7l91.8 91.8l91.8-91.8l35.7 35.7L392.7 306L484.5 397.8z",
- Output = "{BACKSPACE}",
- ColumnSpan = 2,
- });
-
- definition.KeysLinesDefinitions.Add(line1);
- definition.KeysLinesDefinitions.Add(line2);
- definition.KeysLinesDefinitions.Add(line3);
-
- return definition;
- }
-
- internal static List<KeysLineDefinition> CreateDefaultSpecialCharacters()
- {
- KeysLineDefinition line1 = CreateLine("+", "x", "÷", "=", "%", "/", "\\", "$", "€", "£");
- KeysLineDefinition line2 = CreateLine("@", "*", "!", "#", ":", ";", "&", "_", "(", ")");
- KeysLineDefinition line3 = CreateLine("-", "'", "\"", ",", ".", "?");
-
- line3.SpecialRightKeyDefinitions.Add(new SpecialKeyDefinition()
- {
- Type = SpecialKeyType.StandardText,
- VectorMarkup = "M561 76.5H178.5c-17.85 0-30.6 7.65-40.8 22.95L0 306l137.7 206.55c10.2 12.75 22.95 22.95 40.8 22.95H561 c28.05 0 51-22.95 51-51v-357C612 99.45 589.05 76.5 561 76.5z M484.5 397.8l-35.7 35.7L357 341.7l-91.8 91.8l-35.7-35.7 l91.8-91.8l-91.8-91.8l35.7-35.7l91.8 91.8l91.8-91.8l35.7 35.7L392.7 306L484.5 397.8z",
- Output = "{BACKSPACE}",
- ColumnSpan = 2,
- });
-
- return new List<KeysLineDefinition>()
- {
- line1,
- line2,
- line3
- };
- }
-
- private static KeysLineDefinition CreateLine(params String[] chars)
- {
- KeysLineDefinition line = new KeysLineDefinition();
-
- foreach (var c in chars)
- {
- line.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = c,
- });
- }
-
- return line;
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardModeToVisibilityConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardModeToVisibilityConverter.cs
deleted file mode 100644
index 4bf02260b..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardModeToVisibilityConverter.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Data;
-
-namespace Tango.SharedUI.Keyboard
-{
- public class KeyboardModeToVisibilityConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if ((TouchKeyboardMode)value == (TouchKeyboardMode)parameter) return Visibility.Visible;
- return Visibility.Collapsed;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardModeToVisibilityInverseConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardModeToVisibilityInverseConverter.cs
deleted file mode 100644
index bba6593ff..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardModeToVisibilityInverseConverter.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Data;
-
-namespace Tango.SharedUI.Keyboard
-{
- public class KeyboardModeToVisibilityInverseConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if ((TouchKeyboardMode)value == (TouchKeyboardMode)parameter) return Visibility.Collapsed;
- return Visibility.Visible;
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardView.xaml b/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardView.xaml
deleted file mode 100644
index 25eb21b73..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardView.xaml
+++ /dev/null
@@ -1,47 +0,0 @@
-<UserControl x:Class="Tango.SharedUI.Keyboard.KeyboardView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:Tango.SharedUI.Keyboard"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300" DataContext="{Binding RelativeSource={RelativeSource Self}}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="1*"/>
- <RowDefinition Height="Auto">
- <RowDefinition.Style>
- <Style TargetType="RowDefinition">
- <Setter Property="MaxHeight" Value="0"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsOpened}" Value="True">
- <DataTrigger.EnterActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetProperty="MaxHeight" To="1000" Duration="00:00:0.2"></DoubleAnimation>
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>
- <DataTrigger.ExitActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetProperty="MaxHeight" To="0" Duration="00:00:0.1"></DoubleAnimation>
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.ExitActions>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </RowDefinition.Style>
- </RowDefinition>
- </Grid.RowDefinitions>
-
- <Grid>
- <ContentPresenter Content="{Binding View}"></ContentPresenter>
- </Grid>
-
- <Grid Grid.Row="1">
- <local:TouchKeyboard x:Name="keyboard" ActionKeyPressed="OnActionKeyPressed" />
- </Grid>
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardView.xaml.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardView.xaml.cs
deleted file mode 100644
index 8108a1963..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardView.xaml.cs
+++ /dev/null
@@ -1,172 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Markup;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace Tango.SharedUI.Keyboard
-{
- /// <summary>
- /// Interaction logic for KeyboardView.xaml
- /// </summary>
- [ContentProperty(nameof(View))]
- public partial class KeyboardView : UserControl
- {
- private static KeyboardView _instance;
-
- #region Properties
-
- public bool IsOpened
- {
- get { return (bool)GetValue(IsOpenedProperty); }
- set { SetValue(IsOpenedProperty, value); }
- }
- public static readonly DependencyProperty IsOpenedProperty =
- DependencyProperty.Register("IsOpened", typeof(bool), typeof(KeyboardView), new PropertyMetadata(false));
-
- public FrameworkElement View
- {
- get { return (FrameworkElement)GetValue(ViewProperty); }
- set { SetValue(ViewProperty, value); }
- }
- public static readonly DependencyProperty ViewProperty =
- DependencyProperty.Register("View", typeof(FrameworkElement), typeof(KeyboardView), new PropertyMetadata(null));
-
- #endregion
-
- #region Attached Properties
-
- #region Mode
-
- public static readonly DependencyProperty ModeProperty =
- DependencyProperty.RegisterAttached("Mode",
- typeof(TouchKeyboardMode?), typeof(KeyboardView),
- new FrameworkPropertyMetadata(null, ModeChanged));
-
- /// <summary>
- /// Mode changed.
- /// </summary>
- /// <param name="d">The d.</param>
- /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
- private static void ModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- RegisterElement(d as FrameworkElement);
- }
-
- /// <summary>
- /// Sets the Mode attached property.
- /// </summary>
- /// <param name="element">The element.</param>
- /// <param name="value">if set to <c>true</c> [value].</param>
- public static void SetMode(FrameworkElement element, TouchKeyboardMode? value)
- {
- element.SetValue(ModeProperty, value);
- }
-
- /// <summary>
- /// Gets the Mode attached property.
- /// </summary>
- /// <param name="element">The element.</param>
- /// <returns></returns>
- public static TouchKeyboardMode? GetMode(FrameworkElement element)
- {
- return (TouchKeyboardMode?)element.GetValue(ModeProperty);
- }
-
- private static void RegisterElement(FrameworkElement element)
- {
- element.PreviewMouseUp += (_, __) => OnElementFocused(element);
- element.PreviewTouchUp += (_, __) => OnElementFocused(element);
- element.GotFocus += (_, __) => OnElementFocused(element);
- element.LostFocus += (_, __) => OnElementLostFocus(element);
- }
-
- private async static void OnElementFocused(FrameworkElement element)
- {
- _instance.keyboard.ActionKeyMode = GetAction(element);
- _instance.keyboard.Mode = GetMode(element).Value;
- _instance.IsOpened = true;
- await Task.Delay(200);
- element.BringIntoView();
- }
-
- private static void OnElementLostFocus(FrameworkElement element)
- {
- _instance.IsOpened = false;
- }
-
- #endregion
-
- #region Action
-
- public static readonly DependencyProperty ActionProperty =
- DependencyProperty.RegisterAttached("Action",
- typeof(KeyboardActionKeyMode), typeof(KeyboardView),
- new FrameworkPropertyMetadata(KeyboardActionKeyMode.Tab, ActionChanged));
-
- /// <summary>
- /// Action changed.
- /// </summary>
- /// <param name="d">The d.</param>
- /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
- private static void ActionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- RegisterElement(d as FrameworkElement);
- }
-
- /// <summary>
- /// Sets the Action attached property.
- /// </summary>
- /// <param name="element">The element.</param>
- /// <param name="value">if set to <c>true</c> [value].</param>
- public static void SetAction(FrameworkElement element, KeyboardActionKeyMode value)
- {
- element.SetValue(ActionProperty, value);
- }
-
- /// <summary>
- /// Gets the Action attached property.
- /// </summary>
- /// <param name="element">The element.</param>
- /// <returns></returns>
- public static KeyboardActionKeyMode GetAction(FrameworkElement element)
- {
- return (KeyboardActionKeyMode)element.GetValue(ActionProperty);
- }
-
- #endregion
-
- #endregion
-
- #region Constructors
-
- /// <summary>
- /// Initializes a new instance of the <see cref="KeyboardView"/> class.
- /// </summary>
- public KeyboardView()
- {
- InitializeComponent();
- _instance = this;
- }
-
- #endregion
-
- private void OnActionKeyPressed(object sender, KeyboardActionKeyMode mode)
- {
- if (mode == KeyboardActionKeyMode.Enter || mode == KeyboardActionKeyMode.Search)
- {
- IsOpened = false;
- }
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeysLineDefinition.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeysLineDefinition.cs
deleted file mode 100644
index b582b746d..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeysLineDefinition.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace Tango.SharedUI.Keyboard
-{
- public class KeysLineDefinition
- {
- public List<KeyDefinition> KeyDefinitions { get; set; }
-
- public List<SpecialKeyDefinition> SpecialLeftKeyDefinitions { get; set; }
-
- public List<SpecialKeyDefinition> SpecialRightKeyDefinitions { get; set; }
-
- public KeysLineDefinition()
- {
- KeyDefinitions = new List<KeyDefinition>();
- SpecialLeftKeyDefinitions = new List<SpecialKeyDefinition>();
- SpecialRightKeyDefinitions = new List<SpecialKeyDefinition>();
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyDefinition.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyDefinition.cs
deleted file mode 100644
index 4c4fd19a2..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyDefinition.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.SharedUI.Keyboard
-{
- public class SpecialKeyDefinition
- {
- public SpecialKeyType Type { get; set; }
- public String VectorMarkup { get; set; }
- public int ColumnSpan { get; set; }
- public String Output { get; set; }
-
- public SpecialKeyDefinition()
- {
- ColumnSpan = 1;
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyDefinitionToWidthConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyDefinitionToWidthConverter.cs
deleted file mode 100644
index 85b14d935..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyDefinitionToWidthConverter.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Data;
-
-namespace Tango.SharedUI.Keyboard
-{
- public class SpecialKeyDefinitionToWidthConverter : IMultiValueConverter
- {
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- Size size = (Size)values[0];
- int columnSpan = (int)values[1];
-
- return size.Width * (double)columnSpan;
- }
-
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyType.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyType.cs
deleted file mode 100644
index 643d725e8..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/SpecialKeyType.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.SharedUI.Keyboard
-{
- public enum SpecialKeyType
- {
- StandardText,
- CapsLock,
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboard.xaml b/Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboard.xaml
deleted file mode 100644
index 735b45c6b..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboard.xaml
+++ /dev/null
@@ -1,445 +0,0 @@
-<UserControl x:Class="Tango.SharedUI.Keyboard.TouchKeyboard"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:converters="clr-namespace:Tango.SharedUI.Converters"
- xmlns:local="clr-namespace:Tango.SharedUI.Keyboard"
- xmlns:fa="http://schemas.fontawesome.io/icons/"
- mc:Ignorable="d"
- d:DesignHeight="250" d:DesignWidth="400" Focusable="False" Background="Silver" d:DataContext="{d:DesignInstance Type=UserControl, IsDesignTimeCreatable=True}" DataContext="{Binding RelativeSource={RelativeSource Self}}">
-
- <UserControl.Resources>
-
- <local:KeyboardModeToVisibilityConverter x:Key="KeyboardModeToVisibilityConverter" />
- <local:KeyboardModeToVisibilityInverseConverter x:Key="KeyboardModeToVisibilityInverseConverter" />
- <local:SpecialKeyDefinitionToWidthConverter x:Key="SpecialKeyDefinitionToWidthConverter" />
- <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
- <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
- <converters:MathOperatorConverter x:Key="MathOperatorConverter" />
-
-
- <Style x:Key="keyboardButton" TargetType="RepeatButton">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Focusable" Value="False"></Setter>
- <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RepeatButton">
- <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Opacity" Value="0.5"></Setter>
- </Trigger>
- <Trigger Property="RepeatButton.IsPressed" Value="True">
- <Setter Property="Opacity" Value="0.8"></Setter>
- </Trigger>
- <EventTrigger RoutedEvent="RepeatButton.TouchDown">
- <EventTrigger.Actions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
- <DiscreteDoubleKeyFrame KeyTime="0">
- <DiscreteDoubleKeyFrame.Value>
- 0.8
- </DiscreteDoubleKeyFrame.Value>
- </DiscreteDoubleKeyFrame>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger.Actions>
- </EventTrigger>
- <EventTrigger RoutedEvent="RepeatButton.TouchUp">
- <EventTrigger.Actions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
- <DiscreteDoubleKeyFrame KeyTime="0">
- <DiscreteDoubleKeyFrame.Value>
- 1
- </DiscreteDoubleKeyFrame.Value>
- </DiscreteDoubleKeyFrame>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger.Actions>
- </EventTrigger>
- </Style.Triggers>
- </Style>
-
- <Style x:Key="normalButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
- <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersBackground}"></Setter>
- <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}"></Setter>
- <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
- <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
- <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeyDefinitionCommand}"></Setter>
- <Setter Property="CommandParameter" Value="{Binding}"></Setter>
- </Style>
-
- <Style x:Key="numberButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
- <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}"></Setter>
- <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
- <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
- <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
- <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeyDefinitionCommand}"></Setter>
- <Setter Property="CommandParameter" Value="{Binding}"></Setter>
- </Style>
-
- <Style x:Key="specialButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
- <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}"></Setter>
- <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
- <Setter Property="Width">
- <Setter.Value>
- <MultiBinding Converter="{StaticResource SpecialKeyDefinitionToWidthConverter}">
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="KeySize"></Binding>
- <Binding Path="ColumnSpan"></Binding>
- </MultiBinding>
- </Setter.Value>
- </Setter>
- <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
- <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialKeyDefinitionCommand}"></Setter>
- <Setter Property="CommandParameter" Value="{Binding}"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RepeatButton">
- <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
- <Grid>
- <Viewbox Stretch="Uniform" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}">
- <Path Data="{Binding VectorMarkup}" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}" Stretch="Uniform">
- <Path.Style>
- <Style TargetType="Path">
- <Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=RepeatButton},Path=Foreground}"></Setter>
- <Style.Triggers>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CapsLockMode}" Value="{x:Static local:CapsLockMode.Locked}" />
- <Condition Binding="{Binding Type}" Value="{x:Static local:SpecialKeyType.CapsLock}" />
- </MultiDataTrigger.Conditions>
- <Setter Property="Fill" Value="#47C904"></Setter>
- </MultiDataTrigger>
- </Style.Triggers>
- </Style>
- </Path.Style>
- </Path>
- </Viewbox>
-
- <Ellipse Margin="2" HorizontalAlignment="Right" VerticalAlignment="Top" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}">
- <Ellipse.Style>
- <Style TargetType="Ellipse">
- <Setter Property="Visibility" Value="Collapsed"></Setter>
- <Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsCapsLockOn}" Value="True">
- <Setter Property="Fill" Value="#47C904"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Type}" Value="{x:Static local:SpecialKeyType.CapsLock}">
- <Setter Property="Visibility" Value="Visible"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Ellipse.Style>
- </Ellipse>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="bottomButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
- <Setter Property="Delay" Value="100000"></Setter>
- <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}"></Setter>
- <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
- <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
- <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RepeatButton">
- <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="bottomButtonDots" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
- <Setter Property="Delay" Value="100000"></Setter>
- <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}"></Setter>
- <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}"></Setter>
- <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
- <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RepeatButton">
- <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
- <Grid>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="2">
- <Ellipse Margin="0 0 2 0" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}" />
- <Ellipse Margin="0 0 2 0" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}" />
- <Ellipse Margin="0 0 2 0" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DotsSize}" Fill="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}" />
- </StackPanel>
- <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="stretchedButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
- <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersBackground}"></Setter>
- <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}"></Setter>
- <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Width}"></Setter>
- <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=KeySize.Height}"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RepeatButton">
- <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersCornerRadius}">
- <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="numericButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
- <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersBackground}"></Setter>
- <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}"></Setter>
- <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualWidth,Converter={StaticResource MathOperatorConverter},ConverterParameter='*0.7'}"></Setter>
- <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=NumericKeyCommand}"></Setter>
- <Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Self},Path=Tag}"></Setter>
- </Style>
- </UserControl.Resources>
-
- <Grid>
- <!--AlphaNumeric-->
- <Grid>
- <Grid.Style>
- <Style TargetType="Grid">
- <Setter Property="Visibility" Value="Visible"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Integer}">
- <Setter Property="Visibility" Value="Collapsed"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Float}">
- <Setter Property="Visibility" Value="Collapsed"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Grid.Style>
-
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
-
- <ItemsControl ItemsSource="{Binding NumbersLineDefinition.KeyDefinitions}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Columns="{Binding NumbersLineDefinition.KeyDefinitions.Count}"></UniformGrid>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RepeatButton Content="{Binding StandardText}" Style="{StaticResource numberButton}"></RepeatButton>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
-
- <Grid Grid.Row="1">
- <ItemsControl ItemsSource="{Binding CurrentKeyboardDefinition.KeysLinesDefinitions}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="1*" />
- </Grid.ColumnDefinitions>
-
- <ItemsControl ItemsSource="{Binding SpecialLeftKeyDefinitions}" HorizontalAlignment="Left">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Rows="1" HorizontalAlignment="Stretch"></UniformGrid>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RepeatButton Style="{StaticResource specialButton}"/>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
-
- <ItemsControl ItemsSource="{Binding SpecialRightKeyDefinitions}" Grid.Column="2" HorizontalAlignment="Right">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Rows="1" HorizontalAlignment="Stretch"></UniformGrid>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RepeatButton Style="{StaticResource specialButton}"/>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
-
- <ItemsControl ItemsSource="{Binding KeyDefinitions}" Grid.Column="1">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <UniformGrid Rows="1" HorizontalAlignment="Center"></UniformGrid>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RepeatButton Style="{StaticResource normalButton}">
- <TextBlock>
- <TextBlock.Style>
- <Style TargetType="TextBlock">
- <Setter Property="Text" Value="{Binding StandardText}"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=IsCapsLockOn}" Value="True">
- <Setter Property="Text" Value="{Binding CapsText}"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </TextBlock.Style>
- </TextBlock>
- </RepeatButton>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Grid>
-
- <Grid Grid.Row="2">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="1*"/>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
-
- <RepeatButton Style="{StaticResource bottomButtonDots}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersCommand}">
- <ContentControl>
- <ContentControl.Style>
- <Style TargetType="ContentControl">
- <Setter Property="Content">
- <Setter.Value>
- <StackPanel Orientation="Horizontal">
- <fa:ImageAwesome Icon="ShareAlt" Foreground="{Binding RelativeSource={RelativeSource AncestorType=RepeatButton},Path=Foreground}" Width="10" />
- <TextBlock Margin="5 0 0 0">1#</TextBlock>
- </StackPanel>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsSpecialCharactersOn}" Value="True">
- <Setter Property="Content">
- <Setter.Value>
- <TextBlock>abc</TextBlock>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </ContentControl.Style>
- </ContentControl>
- </RepeatButton>
-
- <RepeatButton Command="{Binding NextLanguageCommand}" Style="{StaticResource bottomButtonDots}" Grid.Column="1" Visibility="{Binding IsSpecialCharactersOn,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
- <TextBlock Text="{Binding CurrentKeyboardDefinition.LanguageCode}"></TextBlock>
- </RepeatButton>
-
- <RepeatButton Command="{Binding FreeTextCommand}" CommandParameter="/" Style="{StaticResource bottomButton}" Grid.Column="2" Visibility="{Binding IsSpecialCharactersOn,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
- <TextBlock Text="/"></TextBlock>
- </RepeatButton>
-
- <RepeatButton Style="{StaticResource stretchedButton}" Grid.Column="3" Command="{Binding FreeTextCommand}" CommandParameter=" ">
- <DockPanel Margin="20 0" Height="10">
- <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Left" Stroke="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}" StrokeThickness="1" DockPanel.Dock="Left" />
- <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Right" Stroke="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}" StrokeThickness="1" DockPanel.Dock="Right" />
- <Rectangle VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Stroke="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=CharactersForeground}" StrokeThickness="1" />
- </DockPanel>
- </RepeatButton>
-
- <RepeatButton Command="{Binding FreeTextCommand}" CommandParameter="." Style="{StaticResource bottomButtonDots}" Grid.Column="4">
- <TextBlock Text="."></TextBlock>
- </RepeatButton>
-
- <RepeatButton Style="{StaticResource bottomButton}" Grid.Column="5" Command="{Binding ActionKeyCommand}">
- <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ActionKeyText}"></TextBlock>
- </RepeatButton>
- </Grid>
- </Grid>
- </Grid>
- <!--AlphaNumeric-->
-
- <!--Numeric-->
- <Grid>
- <Grid.Style>
- <Style TargetType="Grid">
- <Setter Property="Visibility" Value="Collapsed"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Integer}">
- <Setter Property="Visibility" Value="Visible"></Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Float}">
- <Setter Property="Visibility" Value="Visible"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Grid.Style>
- <UniformGrid Rows="4" Columns="4">
- <RepeatButton Style="{StaticResource numericButton}" Tag="1">1</RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="2">2</RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="3">3</RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="'{BACKSPACE}'" Background="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersBackground}" Foreground="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SpecialCharactersForeground}">
- <Viewbox Stretch="Uniform" Width="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=VectorMarkupSize}">
- <Path Fill="{Binding RelativeSource={RelativeSource AncestorType=RepeatButton},Path=Foreground}" Data="M561 76.5H178.5c-17.85 0-30.6 7.65-40.8 22.95L0 306l137.7 206.55c10.2 12.75 22.95 22.95 40.8 22.95H561 c28.05 0 51-22.95 51-51v-357C612 99.45 589.05 76.5 561 76.5z M484.5 397.8l-35.7 35.7L357 341.7l-91.8 91.8l-35.7-35.7 l91.8-91.8l-91.8-91.8l35.7-35.7l91.8 91.8l91.8-91.8l35.7 35.7L392.7 306L484.5 397.8z"></Path>
- </Viewbox>
- </RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="4">4</RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="5">5</RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="6">6</RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" IsEnabled="False"></RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="7">7</RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="8">8</RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="9">9</RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" IsEnabled="False"></RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" IsEnabled="False"></RepeatButton>
- <RepeatButton Style="{StaticResource numericButton}" Tag="0">0</RepeatButton>
- <RepeatButton Tag=".">
- <RepeatButton.Style>
- <Style TargetType="RepeatButton" BasedOn="{StaticResource numericButton}">
- <Setter Property="Content" Value=" "></Setter>
- <Setter Property="IsEnabled" Value="False"></Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Float}">
- <Setter Property="Content" Value="."></Setter>
- <Setter Property="IsEnabled" Value="True"></Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </RepeatButton.Style>
- </RepeatButton>
- <RepeatButton Style="{StaticResource bottomButton}" Grid.Column="5" Command="{Binding ActionKeyCommand}" Height="{Binding RelativeSource={RelativeSource Self},Path=ActualWidth,Converter={StaticResource MathOperatorConverter},ConverterParameter='*0.7'}">
- <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ActionKeyText}"></TextBlock>
- </RepeatButton>
- </UniformGrid>
- </Grid>
- <!--Numeric-->
-
- </Grid>
-</UserControl>
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboard.xaml.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboard.xaml.cs
deleted file mode 100644
index 0ee40af0d..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboard.xaml.cs
+++ /dev/null
@@ -1,436 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using Forms = System.Windows.Forms;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using Tango.Core.Commands;
-using System.Threading;
-using System.Collections.ObjectModel;
-
-namespace Tango.SharedUI.Keyboard
-{
- /// <summary>
- /// Interaction logic for TouchKeyboard.xaml
- /// </summary>
- public partial class TouchKeyboard : UserControl
- {
- private bool _isInitialized;
-
- public event EventHandler<KeyboardActionKeyMode> ActionKeyPressed;
-
- public bool IsSpecialCharactersOn
- {
- get { return (bool)GetValue(IsSpecialCharactersOnProperty); }
- set { SetValue(IsSpecialCharactersOnProperty, value); }
- }
- public static readonly DependencyProperty IsSpecialCharactersOnProperty =
- DependencyProperty.Register("IsSpecialCharactersOn", typeof(bool), typeof(TouchKeyboard), new PropertyMetadata(false, (d, e) => (d as TouchKeyboard).OnSpecialCharactersOnChanged()));
-
- public TouchKeyboardMode Mode
- {
- get { return (TouchKeyboardMode)GetValue(ModeProperty); }
- set { SetValue(ModeProperty, value); }
- }
- public static readonly DependencyProperty ModeProperty =
- DependencyProperty.Register("Mode", typeof(TouchKeyboardMode), typeof(TouchKeyboard), new PropertyMetadata(TouchKeyboardMode.AlphaNumeric));
-
- public KeyboardActionKeyMode ActionKeyMode
- {
- get { return (KeyboardActionKeyMode)GetValue(ActionKeyModeProperty); }
- set { SetValue(ActionKeyModeProperty, value); }
- }
- public static readonly DependencyProperty ActionKeyModeProperty =
- DependencyProperty.Register("ActionKeyMode", typeof(KeyboardActionKeyMode), typeof(TouchKeyboard), new PropertyMetadata(KeyboardActionKeyMode.Tab, (d, e) => (d as TouchKeyboard).OnActionKeyModeChanged()));
-
- public String ActionKeyText
- {
- get { return (String)GetValue(ActionKeyTextProperty); }
- private set { SetValue(ActionKeyTextProperty, value); }
- }
- public static readonly DependencyProperty ActionKeyTextProperty =
- DependencyProperty.Register("ActionKeyText", typeof(String), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public KeyboardDefinition CurrentKeyboardDefinition
- {
- get { return (KeyboardDefinition)GetValue(CurrentKeyboardDefinitionProperty); }
- set { SetValue(CurrentKeyboardDefinitionProperty, value); }
- }
- public static readonly DependencyProperty CurrentKeyboardDefinitionProperty =
- DependencyProperty.Register("CurrentKeyboardDefinition", typeof(KeyboardDefinition), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public int CurrentKeyboardDefinitionIndex
- {
- get { return (int)GetValue(CurrentKeyboardDefinitionIndexProperty); }
- set { SetValue(CurrentKeyboardDefinitionIndexProperty, value); }
- }
- public static readonly DependencyProperty CurrentKeyboardDefinitionIndexProperty =
- DependencyProperty.Register("CurrentKeyboardDefinitionIndex", typeof(int), typeof(TouchKeyboard), new PropertyMetadata(0));
-
- public ObservableCollection<KeyboardDefinition> KeyboardDefinitions
- {
- get { return (ObservableCollection<KeyboardDefinition>)GetValue(KeyboardDefinitionsProperty); }
- set { SetValue(KeyboardDefinitionsProperty, value); }
- }
- public static readonly DependencyProperty KeyboardDefinitionsProperty =
- DependencyProperty.Register("KeyboardDefinitions", typeof(ObservableCollection<KeyboardDefinition>), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public Size KeySize
- {
- get { return (Size)GetValue(KeySizeProperty); }
- set { SetValue(KeySizeProperty, value); }
- }
- public static readonly DependencyProperty KeySizeProperty =
- DependencyProperty.Register("KeySize", typeof(Size), typeof(TouchKeyboard), new PropertyMetadata(Size.Empty));
-
- public double MaxSpecialKeyWidth
- {
- get { return (double)GetValue(MaxSpecialKeyWidthProperty); }
- set { SetValue(MaxSpecialKeyWidthProperty, value); }
- }
- public static readonly DependencyProperty MaxSpecialKeyWidthProperty =
- DependencyProperty.Register("MaxSpecialKeyWidth", typeof(double), typeof(TouchKeyboard), new PropertyMetadata(0.0));
-
- public KeysLineDefinition NumbersLineDefinition
- {
- get { return (KeysLineDefinition)GetValue(NumbersLineDefinitionProperty); }
- set { SetValue(NumbersLineDefinitionProperty, value); }
- }
- public static readonly DependencyProperty NumbersLineDefinitionProperty =
- DependencyProperty.Register("NumbersLineDefinition", typeof(KeysLineDefinition), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public Brush CharactersBackground
- {
- get { return (Brush)GetValue(CharactersBackgroundProperty); }
- set { SetValue(CharactersBackgroundProperty, value); }
- }
- public static readonly DependencyProperty CharactersBackgroundProperty =
- DependencyProperty.Register("CharactersBackground", typeof(Brush), typeof(TouchKeyboard), new PropertyMetadata(Brushes.Gainsboro));
-
- public Brush CharactersForeground
- {
- get { return (Brush)GetValue(CharactersForegroundProperty); }
- set { SetValue(CharactersForegroundProperty, value); }
- }
- public static readonly DependencyProperty CharactersForegroundProperty =
- DependencyProperty.Register("CharactersForeground", typeof(Brush), typeof(TouchKeyboard), new PropertyMetadata(new SolidColorBrush(Color.FromRgb(20, 20, 20))));
-
- public Brush SpecialCharactersBackground
- {
- get { return (Brush)GetValue(SpecialCharactersBackgroundProperty); }
- set { SetValue(SpecialCharactersBackgroundProperty, value); }
- }
- public static readonly DependencyProperty SpecialCharactersBackgroundProperty =
- DependencyProperty.Register("SpecialCharactersBackground", typeof(Brush), typeof(TouchKeyboard), new PropertyMetadata(Brushes.Gray));
-
- public Brush SpecialCharactersForeground
- {
- get { return (Brush)GetValue(SpecialCharactersForegroundProperty); }
- set { SetValue(SpecialCharactersForegroundProperty, value); }
- }
- public static readonly DependencyProperty SpecialCharactersForegroundProperty =
- DependencyProperty.Register("SpecialCharactersForeground", typeof(Brush), typeof(TouchKeyboard), new PropertyMetadata(Brushes.Gainsboro));
-
- public double VectorMarkupSize
- {
- get { return (double)GetValue(VectorMarkupSizeProperty); }
- set { SetValue(VectorMarkupSizeProperty, value); }
- }
- public static readonly DependencyProperty VectorMarkupSizeProperty =
- DependencyProperty.Register("VectorMarkupSize", typeof(double), typeof(TouchKeyboard), new PropertyMetadata(10.0));
-
- public double DotsSize
- {
- get { return (double)GetValue(DotsSizeProperty); }
- set { SetValue(DotsSizeProperty, value); }
- }
- public static readonly DependencyProperty DotsSizeProperty =
- DependencyProperty.Register("DotsSize", typeof(double), typeof(TouchKeyboard), new PropertyMetadata(5.0));
-
- public double CharactersCornerRadius
- {
- get { return (double)GetValue(CharactersCornerRadiusProperty); }
- set { SetValue(CharactersCornerRadiusProperty, value); }
- }
- public static readonly DependencyProperty CharactersCornerRadiusProperty =
- DependencyProperty.Register("CharactersCornerRadius", typeof(double), typeof(TouchKeyboard), new PropertyMetadata(5.0));
-
- public CapsLockMode CapsLockMode
- {
- get { return (CapsLockMode)GetValue(CapsLockModeProperty); }
- set { SetValue(CapsLockModeProperty, value); }
- }
- public static readonly DependencyProperty CapsLockModeProperty =
- DependencyProperty.Register("CapsLockMode", typeof(CapsLockMode), typeof(TouchKeyboard), new PropertyMetadata(CapsLockMode.None));
-
- public bool IsCapsLockOn
- {
- get { return (bool)GetValue(IsCapsLockOnProperty); }
- private set { SetValue(IsCapsLockOnProperty, value); }
- }
- public static readonly DependencyProperty IsCapsLockOnProperty =
- DependencyProperty.Register("IsCapsLockOn", typeof(bool), typeof(TouchKeyboard), new PropertyMetadata(false));
-
- public RelayCommand<KeyDefinition> KeyDefinitionCommand
- {
- get { return (RelayCommand<KeyDefinition>)GetValue(KeyDefinitionCommandProperty); }
- set { SetValue(KeyDefinitionCommandProperty, value); }
- }
- public static readonly DependencyProperty KeyDefinitionCommandProperty =
- DependencyProperty.Register("KeyDefinitionCommand", typeof(RelayCommand<KeyDefinition>), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public RelayCommand<SpecialKeyDefinition> SpecialKeyDefinitionCommand
- {
- get { return (RelayCommand<SpecialKeyDefinition>)GetValue(SpecialKeyDefinitionCommandProperty); }
- set { SetValue(SpecialKeyDefinitionCommandProperty, value); }
- }
- public static readonly DependencyProperty SpecialKeyDefinitionCommandProperty =
- DependencyProperty.Register("SpecialKeyDefinitionCommand", typeof(RelayCommand<SpecialKeyDefinition>), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public RelayCommand SpecialCharactersCommand
- {
- get { return (RelayCommand)GetValue(SpecialCharactersCommandProperty); }
- set { SetValue(SpecialCharactersCommandProperty, value); }
- }
- public static readonly DependencyProperty SpecialCharactersCommandProperty =
- DependencyProperty.Register("SpecialCharactersCommand", typeof(RelayCommand), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public RelayCommand<String> FreeTextCommand
- {
- get { return (RelayCommand<String>)GetValue(FreeTextCommandProperty); }
- set { SetValue(FreeTextCommandProperty, value); }
- }
- public static readonly DependencyProperty FreeTextCommandProperty =
- DependencyProperty.Register("FreeTextCommand", typeof(RelayCommand<String>), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public RelayCommand NextLanguageCommand
- {
- get { return (RelayCommand)GetValue(NextLanguageCommandProperty); }
- set { SetValue(NextLanguageCommandProperty, value); }
- }
- public static readonly DependencyProperty NextLanguageCommandProperty =
- DependencyProperty.Register("NextLanguageCommand", typeof(RelayCommand), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public RelayCommand ActionKeyCommand
- {
- get { return (RelayCommand)GetValue(ActionKeyCommandProperty); }
- set { SetValue(ActionKeyCommandProperty, value); }
- }
- public static readonly DependencyProperty ActionKeyCommandProperty =
- DependencyProperty.Register("ActionKeyCommand", typeof(RelayCommand), typeof(TouchKeyboard), new PropertyMetadata(null));
-
- public RelayCommand<Object> NumericKeyCommand
- {
- get { return (RelayCommand<Object>)GetValue(NumericKeyCommandProperty); }
- set { SetValue(NumericKeyCommandProperty, value); }
- }
- public static readonly DependencyProperty NumericKeyCommandProperty =
- DependencyProperty.Register("NumericKeyCommand", typeof(RelayCommand<Object>), typeof(TouchKeyboard), new PropertyMetadata(null));
-
-
- public TouchKeyboard()
- {
- KeyboardDefinitions = new ObservableCollection<KeyboardDefinition>();
- Initialize();
-
- InitializeComponent();
-
- this.SizeChanged += (_, __) => SetKeySize();
- KeyDefinitionCommand = new RelayCommand<KeyDefinition>(InvokeKeyDefinition);
- SpecialKeyDefinitionCommand = new RelayCommand<SpecialKeyDefinition>(InvokeSpecialKeyDefinition);
- SpecialCharactersCommand = new RelayCommand(ToggleSpecialKeys);
- FreeTextCommand = new RelayCommand<string>((x) => SendKeys(x));
- NextLanguageCommand = new RelayCommand(NextLanguage);
- ActionKeyCommand = new RelayCommand(InvokeActionKey);
- NumericKeyCommand = new RelayCommand<object>((x) => SendKeys(x.ToString().Replace("'", "")));
- }
-
- private void Initialize()
- {
- if (!_isInitialized)
- {
- var numbers = new KeysLineDefinition();
-
- for (int i = 1; i < 10; i++)
- {
- numbers.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = i.ToString(),
- });
- }
-
- numbers.KeyDefinitions.Add(new KeyDefinition()
- {
- StandardText = "0",
- });
-
- NumbersLineDefinition = numbers;
-
- CurrentKeyboardDefinition = KeyboardDefinition.Default;
- KeyboardDefinitions.Add(CurrentKeyboardDefinition);
- KeyboardDefinitions.Add(KeyboardDefinition.CreateDefaultHebrewAlphaNumeric());
-
- SetKeySize();
-
- OnActionKeyModeChanged();
-
- _isInitialized = true;
- }
- }
-
- private void SetKeySize()
- {
- KeySize = new Size(ActualWidth / NumbersLineDefinition.KeyDefinitions.Count, (ActualWidth / NumbersLineDefinition.KeyDefinitions.Count) * 0.90);
- MaxSpecialKeyWidth = KeySize.Width * 2;
- }
-
- private void InvokeKeyDefinition(KeyDefinition key)
- {
- if (IsCapsLockOn)
- {
- SendKeys(key.CapsText);
- }
- else
- {
- //UIAutomationHelper.GetActiveWindow();
-
- //IInputElement focusedControl = FocusManager.GetFocusedElement(this);
-
- SendKeys(key.StandardText);
- }
- }
-
- private void InvokeSpecialKeyDefinition(SpecialKeyDefinition key)
- {
- switch (key.Type)
- {
- case SpecialKeyType.StandardText:
- SendKeys(key.Output);
- break;
- case SpecialKeyType.CapsLock:
-
- if (CapsLockMode == CapsLockMode.None)
- {
- CapsLockMode = CapsLockMode.SingleChar;
- }
- else if (CapsLockMode == CapsLockMode.SingleChar)
- {
- CapsLockMode = CapsLockMode.Locked;
- }
- else
- {
- CapsLockMode = CapsLockMode.None;
- }
-
- IsCapsLockOn = CapsLockMode != CapsLockMode.None;
-
- break;
- }
- }
-
- private Task SendKeys(String key)
- {
- Application.Current.MainWindow.Activate();
-
- var isSpecialChar = IsSpecialCharactersOn;
- var definition = CurrentKeyboardDefinition;
-
- if (CapsLockMode == CapsLockMode.SingleChar)
- {
- CapsLockMode = CapsLockMode.None;
- IsCapsLockOn = false;
- }
-
- return Task.Factory.StartNew(() =>
- {
- if (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key))
- {
- Forms.SendKeys.SendWait("{" + key + "}");
- }
- else
- {
- Forms.SendKeys.SendWait(key);
- }
- });
- }
-
- private void OnSpecialCharactersOnChanged()
- {
- if (!IsSpecialCharactersOn)
- {
- CurrentKeyboardDefinition = KeyboardDefinitions[CurrentKeyboardDefinitionIndex];
- }
- else
- {
- KeyboardDefinition definition = new KeyboardDefinition();
- definition.EnterText = CurrentKeyboardDefinition.EnterText;
- definition.KeysLinesDefinitions = KeyboardDefinition.CreateDefaultSpecialCharacters();
- CurrentKeyboardDefinition = definition;
- }
- }
-
- private void ToggleSpecialKeys()
- {
- IsSpecialCharactersOn = !IsSpecialCharactersOn;
- }
-
- private void NextLanguage()
- {
- IsCapsLockOn = false;
-
- CurrentKeyboardDefinitionIndex++;
-
- if (CurrentKeyboardDefinitionIndex > KeyboardDefinitions.Count - 1)
- {
- CurrentKeyboardDefinitionIndex = 0;
- }
-
- CurrentKeyboardDefinition = KeyboardDefinitions[CurrentKeyboardDefinitionIndex];
-
- OnActionKeyModeChanged();
- }
-
- private void OnActionKeyModeChanged()
- {
- switch (ActionKeyMode)
- {
- case KeyboardActionKeyMode.Enter:
- ActionKeyText = CurrentKeyboardDefinition.EnterText;
- break;
- case KeyboardActionKeyMode.Tab:
- ActionKeyText = CurrentKeyboardDefinition.TabText;
- break;
- case KeyboardActionKeyMode.Search:
- ActionKeyText = "Search"; // TODO: Make trigger in view and vector path.
- break;
- }
- }
-
- private void InvokeActionKey()
- {
- switch (ActionKeyMode)
- {
- case KeyboardActionKeyMode.Enter:
- SendKeys("{ENTER}");
- break;
- case KeyboardActionKeyMode.Tab:
- SendKeys("{TAB}");
- break;
- case KeyboardActionKeyMode.Search:
- SendKeys("{ENTER}");
- break;
- }
-
- ActionKeyPressed?.Invoke(this, ActionKeyMode);
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboardMode.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboardMode.cs
deleted file mode 100644
index 9ba62b05e..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/TouchKeyboardMode.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.SharedUI.Keyboard
-{
- public enum TouchKeyboardMode
- {
- AlphaNumeric,
- Integer,
- Float,
- Alpha
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/UIAutomationHelper.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/UIAutomationHelper.cs
deleted file mode 100644
index 5a4703d95..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/UIAutomationHelper.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.SharedUI.Keyboard
-{
- /// <summary>
- /// This class helps in UI Automation
- /// </summary>
- public static class UIAutomationHelper
- {
- public static IntPtr GetActiveWindow()
- {
- return Win32.GetForegroundWindow();
- }
-
- /// <summary>
- /// Find a window specified by the window title
- /// </summary>
- /// <param name="windowName"></param>
- /// <returns></returns>
- public static IntPtr FindWindow(string windowName)
- {
- return Win32.FindWindow(null, windowName);
- }
-
- /// <summary>
- /// Find a window specified by the class name as well as the window title
- /// </summary>
- /// <param name="className"></param>
- /// <param name="windowName"></param>
- /// <returns></returns>
- public static IntPtr FindWindow(string className, string windowName)
- {
- return Win32.FindWindow(className, windowName);
- }
-
- /// <summary>
- /// Finds a window specified by the window title and set focues on that window
- /// </summary>
- /// <param name="windowName"></param>
- /// <returns></returns>
- public static IntPtr FindWindowAndFocus(string windowName)
- {
- return UIAutomationHelper.FindWindowAndFocus(null, windowName);
- }
-
- /// <summary>
- /// Finds a window specified by the class name and window title and set focuses on that window
- /// </summary>
- /// <param name="className"></param>
- /// <param name="windowName"></param>
- /// <returns></returns>
- public static IntPtr FindWindowAndFocus(string className, string windowName)
- {
- IntPtr hWindow = Win32.FindWindow(className, windowName);
- Win32.SetForegroundWindow(hWindow);
- return hWindow;
- }
-
- /// <summary>
- /// Finds a child window
- /// </summary>
- /// <param name="windowName"></param>
- /// <param name="childWindowName"></param>
- /// <returns></returns>
- public static IntPtr FindChildWindow(String windowName, String childWindowName)
- {
- return UIAutomationHelper.FindChildWindow(null, windowName, null, childWindowName);
- }
-
- /// <summary>
- /// Finds a child window
- /// </summary>
- /// <param name="className"></param>
- /// <param name="windowName"></param>
- /// <param name="childClassName"></param>
- /// <param name="childWindowName"></param>
- /// <returns></returns>
- public static IntPtr FindChildWindow(String className, String windowName,
- String childClassName, String childWindowName)
- {
- IntPtr hWindow = Win32.FindWindow(className, windowName);
- IntPtr hWindowEx = Win32.FindWindowEx(hWindow,
- IntPtr.Zero, childClassName, childWindowName);
- return hWindowEx;
- }
-
- /// <summary>
- /// Simulates pressing a key
- /// </summary>
- /// <param name="hWindow"></param>
- /// <param name="key"></param>
- public static void PressKey(IntPtr hWindow, System.Windows.Input.Key key)
- {
- Win32.PostMessage(hWindow, Win32.WM_KEYDOWN,
- System.Windows.Input.KeyInterop.VirtualKeyFromKey(key),
- 0);
- }
-
- /// <summary>
- /// Simulates pressing several keys
- /// </summary>
- /// <param name="hWindow"></param>
- /// <param name="keys"></param>
- public static void PressKeys(IntPtr hWindow,
- IEnumerable<System.Windows.Input.Key> keys)
- {
- foreach (var key in keys)
- {
- UIAutomationHelper.PressKey(hWindow, key);
- }
- }
-
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Keyboard/Win32.cs b/Software/Visual_Studio/Tango.SharedUI/Keyboard/Win32.cs
deleted file mode 100644
index e69a88dd2..000000000
--- a/Software/Visual_Studio/Tango.SharedUI/Keyboard/Win32.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.SharedUI.Keyboard
-{
- public class Win32
- {
- public const int WM_KEYDOWN = 0x100;
- public const int WM_KEYUP = 0x101;
-
- [DllImport("User32.dll", SetLastError = true)]
- public static extern IntPtr FindWindow(String lpClassName, String lpWindowName);
-
- [DllImport("user32.dll", SetLastError = true)]
- public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter,
- string lpszClass, string lpszWindow);
- [DllImport("User32.dll", SetLastError = true)]
- public static extern IntPtr SetForegroundWindow(IntPtr hWnd);
-
- [return: MarshalAs(UnmanagedType.Bool)]
- [DllImport("user32.dll", SetLastError = true)]
- public static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
-
- [DllImport("user32.dll")]
- public static extern IntPtr GetForegroundWindow();
- }
-}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
index 35b9a61e4..ec53f2c9e 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
+++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
@@ -117,25 +117,6 @@
<Compile Include="Helpers\ResourceHelper.cs" />
<Compile Include="Helpers\UIHelper.cs" />
<Compile Include="IView.cs" />
- <Compile Include="Keyboard\CapsLockMode.cs" />
- <Compile Include="Keyboard\KeyboardActionKeyMode.cs" />
- <Compile Include="Keyboard\KeyboardDefinition.cs" />
- <Compile Include="Keyboard\KeyboardModeToVisibilityInverseConverter.cs" />
- <Compile Include="Keyboard\KeyboardModeToVisibilityConverter.cs" />
- <Compile Include="Keyboard\KeyboardView.xaml.cs">
- <DependentUpon>KeyboardView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Keyboard\KeyDefinition.cs" />
- <Compile Include="Keyboard\KeysLineDefinition.cs" />
- <Compile Include="Keyboard\SpecialKeyDefinition.cs" />
- <Compile Include="Keyboard\SpecialKeyDefinitionToWidthConverter.cs" />
- <Compile Include="Keyboard\SpecialKeyType.cs" />
- <Compile Include="Keyboard\TouchKeyboard.xaml.cs">
- <DependentUpon>TouchKeyboard.xaml</DependentUpon>
- </Compile>
- <Compile Include="Keyboard\TouchKeyboardMode.cs" />
- <Compile Include="Keyboard\UIAutomationHelper.cs" />
- <Compile Include="Keyboard\Win32.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
@@ -187,14 +168,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
- <Page Include="Keyboard\KeyboardView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Keyboard\TouchKeyboard.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
<Page Include="Rendering\RenderWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.xaml
index 4a9ca1482..34716f740 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.xaml
@@ -17,7 +17,6 @@
<Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FontWeight" Value="Medium"></Setter>
- <Setter Property="FontSize" Value="{StaticResource TangoButtonFontSize}"></Setter>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"></Setter>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchDataGrid.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchDataGrid.xaml
index e840d4580..d8b213678 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchDataGrid.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchDataGrid.xaml
@@ -36,7 +36,6 @@
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter>
- <Setter Property="FontSize" Value="{StaticResource TangoColumnHeaderFontSize}"></Setter>
<Setter Property="components:TransformationHelper.TransformWhenPressed" Value="True"></Setter>
<Setter Property="FontWeight" Value="Medium"></Setter>
<Setter Property="Template">
@@ -161,7 +160,6 @@
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
- <Setter Property="FontSize" Value="{StaticResource TangoCellFontSize}"></Setter>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Padding" Value="10"></Setter>
<Setter Property="Template">
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml
index 81aa7e450..7aec7b17d 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNavigationLinks.xaml
@@ -14,7 +14,6 @@
<Style TargetType="{x:Type local:TouchNavigationLinks}">
<Setter Property="SelectedIndex" Value="0"></Setter>
- <Setter Property="FontSize" Value="{StaticResource TangoNavigationLinksFontSize}"></Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.xaml b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.xaml
index b429d1a31..d1bad8589 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.xaml
@@ -261,8 +261,38 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="1*" />
+ <ColumnDefinition>
+ <ColumnDefinition.Style>
+ <Style TargetType="ColumnDefinition">
+ <Setter Property="Width" Value="Auto"></Setter>
+ <Style.Triggers>
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding SpecialLeftKeyDefinitions.Count}" Value="0" />
+ <Condition Binding="{Binding SpecialRightKeyDefinitions.Count}" Value="0" />
+ </MultiDataTrigger.Conditions>
+ <Setter Property="Width" Value="1*"></Setter>
+ </MultiDataTrigger>
+ </Style.Triggers>
+ </Style>
+ </ColumnDefinition.Style>
+ </ColumnDefinition>
+ <ColumnDefinition>
+ <ColumnDefinition.Style>
+ <Style TargetType="ColumnDefinition">
+ <Setter Property="Width" Value="1*"></Setter>
+ <Style.Triggers>
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding SpecialLeftKeyDefinitions.Count}" Value="0" />
+ <Condition Binding="{Binding SpecialRightKeyDefinitions.Count}" Value="0" />
+ </MultiDataTrigger.Conditions>
+ <Setter Property="Width" Value="Auto"></Setter>
+ </MultiDataTrigger>
+ </Style.Triggers>
+ </Style>
+ </ColumnDefinition.Style>
+ </ColumnDefinition>
</Grid.ColumnDefinitions>
<ItemsControl ItemsSource="{Binding SpecialLeftKeyDefinitions}" HorizontalAlignment="Left">
diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml
index 00247275e..8a27319b2 100644
--- a/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Resources/Fonts.xaml
@@ -3,11 +3,4 @@
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:Tango.Touch.Resources">
- <FontFamily x:Key="TangoFlexoFontFamily">Flexo</FontFamily>
- <sys:Double x:Key="TangoColumnHeaderFontSize">15.350000000000001</sys:Double>
- <sys:Double x:Key="TangoCellFontSize">14.75</sys:Double>
- <sys:Double x:Key="TangoNavigationLinksFontSize">16.524999999999999</sys:Double>
- <sys:Double x:Key="TangoButtonFontSize">17.899999999999999</sys:Double>
- <sys:Double x:Key="TangoPageHeaderFontSize">25.474999999999998</sys:Double>
-
</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
index 4c979c2d4..a99b8f317 100644
--- a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml
@@ -22,4 +22,9 @@
<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