diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-28 10:31:15 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-28 10:31:15 +0300 |
| commit | 0159af4cc40ef8ba9c89516ced41ce69322c6bf7 (patch) | |
| tree | 5c7931aa8d18a2e46eea96452baa5dbecf7e9368 /Software/Visual_Studio/PPC/Tango.PPC.UI | |
| parent | 2843ce67c6ae76e1dd02d7c7cd1f611ca893f46f (diff) | |
| parent | f7424796d093009adc95df6cbb2d54d6bce57592 (diff) | |
| download | Tango-0159af4cc40ef8ba9c89516ced41ce69322c6bf7.tar.gz Tango-0159af4cc40ef8ba9c89516ced41ce69322c6bf7.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
36 files changed, 1869 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config new file mode 100644 index 000000000..895afa970 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <configSections> + <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> + <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> + </configSections> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> + </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> + <entityFramework> + <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> + <providers> + <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> + </providers> + </entityFramework> +</configuration>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml new file mode 100644 index 000000000..ddfb18c60 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml @@ -0,0 +1,164 @@ +<Application x:Class="Tango.PPC.UI.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" + xmlns:local="clr-namespace:Tango.PPC.UI" + StartupUri="MainWindow.xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d1p1:Ignorable="d" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"> + <Application.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Resources/Colors.xaml"/> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Resources/Fonts.xaml"/> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchToggleButton.xaml" /> + + <!--Styles--> + <ResourceDictionary> + <Style TargetType="{x:Type ListBoxItem}" x:Key="basicListBoxItem"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Padding" Value="0"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ListBoxItem}"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}" Padding="0" SnapsToDevicePixels="true"> + <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsSelected" Value="true"> + <Setter Property="Background" TargetName="Bd" Value="Transparent"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsSelected" Value="true"/> + <Condition Property="Selector.IsSelectionActive" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="Bd" Value="Transparent"/> + </MultiTrigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="emptyToggleButton" TargetType="ToggleButton"> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ToggleButton"> + <Grid Background="{TemplateBinding Background}"> + <ContentPresenter /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="emptyButton" TargetType="Button"> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <Grid Background="{TemplateBinding Background}"> + <ContentPresenter /> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <!--Drag & Drop--> + <Style x:Key="draggableGrid" TargetType="Grid"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> + </Setter.Value> + </Setter> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> + </Style> + + <Style x:Key="droppableGrid" TargetType="Grid"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> + </Setter.Value> + </Setter> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> + <Style.Triggers> + <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + <Trigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> + <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </Trigger.EnterActions> + <Trigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> + <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </Trigger.ExitActions> + </Trigger> + </Style.Triggers> + </Style> + + <Style x:Key="draggableDroppableGrid" TargetType="Grid"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> + </Setter.Value> + </Setter> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> + <Style.Triggers> + <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + <Trigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> + <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </Trigger.EnterActions> + <Trigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> + <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </Trigger.ExitActions> + </Trigger> + </Style.Triggers> + </Style> + <!--Drag & Drop--> + + <!--Extensions--> + + </ResourceDictionary> + + <ResourceDictionary Source="Resources/Colors.xaml"></ResourceDictionary> + <ResourceDictionary Source="Resources/MaterialOverride.xaml"></ResourceDictionary> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </Application.Resources> +</Application> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs new file mode 100644 index 000000000..357d15171 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.xaml.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; +using Tango.Settings; + +namespace Tango.PPC.UI +{ + /// <summary> + /// Interaction logic for App.xaml + /// </summary> + public partial class App : Application + { + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + + var s = SettingsManager.Default.GetOrCreate<Core.CoreSettings>(); + s.SQLServerAddress = "DB\\Tango.mdf"; + s.Save(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/cyan.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/cyan.png Binary files differnew file mode 100644 index 000000000..d53382f28 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/Job Issues/cyan.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/account.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/account.png Binary files differnew file mode 100644 index 000000000..46f0d38fc --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/account.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/arrows.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/arrows.png Binary files differnew file mode 100644 index 000000000..ae3482ee5 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/arrows.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/liquid.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/liquid.png Binary files differnew file mode 100644 index 000000000..7c5a4bceb --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/liquid.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/warning.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/warning.png Binary files differnew file mode 100644 index 000000000..5c7672421 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/warning.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml new file mode 100644 index 000000000..f716a6e88 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml @@ -0,0 +1,17 @@ +<Window x:Class="Tango.PPC.UI.MainWindow" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:Tango.PPC.UI" + xmlns:views="clr-namespace:Tango.PPC.UI.Views" + mc:Ignorable="d" + Title="MainWindow" Height="1000" Width="625" WindowStyle="None" ResizeMode="NoResize"> + <Grid> + <Viewbox Stretch="Fill"> + <Grid Height="1280" Width="800"> + <views:MainView/> + </Grid> + </Viewbox> + </Grid> +</Window> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs new file mode 100644 index 000000000..42ea21123 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/MainWindow.xaml.cs @@ -0,0 +1,40 @@ +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.Forms; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.UI +{ + /// <summary> + /// Interaction logic for MainWindow.xaml + /// </summary> + public partial class MainWindow : Window + { + public static MainWindow Instance { get; private set; } + + public MainWindow() + { + Instance = this; + + InitializeComponent(); + + WindowStartupLocation = WindowStartupLocation.Manual; + var lastMonitor = Screen.AllScreens.LastOrDefault(); + Left = lastMonitor.Bounds.Left; + Top = lastMonitor.Bounds.Top; + Width = lastMonitor.Bounds.Width; + Height = lastMonitor.Bounds.Height; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs new file mode 100644 index 000000000..83cf92f11 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common.Navigation; +using Tango.PPC.UI.Views; +using Tango.SharedUI.Controls; + +namespace Tango.PPC.UI.Navigation +{ + public class DefaultNavigationManager : INavigationManager + { + public void NavigateTo(NavigationView view) + { + NavigationControl[] controls = new NavigationControl[] + { + MainView.Instance.NavigationControl, + LayoutView.Instance.NavigationControl + }; + + var control = controls.Where(x => x.Elements.ToList().Exists(y => NavigationControl.GetNavigationName(y) == view.ToString())).SingleOrDefault(); + control.NavigateTo(view.ToString()); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs new file mode 100644 index 000000000..7f97f2a49 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -0,0 +1,116 @@ +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; +using FontAwesome.WPF; +using Tango.PPC.Common.Notifications; + +namespace Tango.PPC.UI.Notifications +{ + public class DefaultNotificationProvider : INotificationProvider + { + public ObservableCollection<TaskItem> TaskItems + { + get + { + throw new NotImplementedException(); + } + } + + public TaskItem CurrentTaskItem + { + get + { + throw new NotImplementedException(); + } + } + + 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 + { + throw new NotImplementedException(); + } + + public bool ShowQuestion(string message) + { + throw new NotImplementedException(); + } + + public string ShowTextInput(string message, string hint, string defaultResponse = null) + { + throw new NotImplementedException(); + } + + public void ShowWarning(string message) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs new file mode 100644 index 000000000..29b9f7823 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; +using Tango.Integration.Operation; +using Tango.Settings; +using Tango.PPC.Common.Application; +using Tango.Core.DI; +using Tango.PPC.Common; +using System.Windows; +using Tango.Core; + +namespace Tango.PPC.UI.PPCApplication +{ + public class DefaultPPCApplicationManager : ExtendedObject, IPPCApplicationManager + { + public bool IsShuttingDown + { + get + { + throw new NotImplementedException(); + } + } + + public IMachineOperator ConnectedMachine + { + get + { + throw new NotImplementedException(); + } + + set + { + throw new NotImplementedException(); + } + } + + public string Version + { + get + { + throw new NotImplementedException(); + } + } + + private Machine _machine; + public Machine Machine + { + private set + { + _machine = value; + } + get + { + return _machine; + } + } + + public event EventHandler<IMachineOperator> ConnectedMachineChanged; + + public DefaultPPCApplicationManager() + { + if (!DesignMode) + { + MainWindow.Instance.ContentRendered += (_, __) => + { + foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<PPCViewModel>()) + { + vm.OnApplicationStarted(); + } + }; + } + } + + public void ShutDown() + { + throw new NotImplementedException(); + } + + public void SetMachine(Machine machine) + { + Machine = machine; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..acd22cb21 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Tango.PPC.UI")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Tango.PanelPC.UI")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file +//inside a <PropertyGroup>. For example, if you are using US english +//in your source files, set the <UICulture> to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] 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 new file mode 100644 index 000000000..3af06554c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace Tango.PPC.UI.Properties +{ + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [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 + { + + 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() + { + } + + /// <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); + 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 + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Resources.resx b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file 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 new file mode 100644 index 000000000..dab4cb31e --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +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 + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Settings.settings b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/Settings.settings @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml new file mode 100644 index 000000000..431533fcb --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Colors.xaml @@ -0,0 +1,14 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.PPC.UI.Resources"> + + + <Color x:Key="AccentColor">#2F65EE</Color> + <SolidColorBrush x:Key="AccentColorBrush" Color="{StaticResource AccentColor}"></SolidColorBrush> + + <Color x:Key="WhiteColor">#FFFFFF</Color> + <SolidColorBrush x:Key="WhiteColorBrush" Color="{StaticResource WhiteColor}"></SolidColorBrush> + + <Color x:Key="BorderColor">#C8CBD4</Color> + <SolidColorBrush x:Key="BorderColorBrush" Color="{StaticResource BorderColor}"></SolidColorBrush> +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/MaterialOverride.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/MaterialOverride.xaml new file mode 100644 index 000000000..49fb3e837 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/MaterialOverride.xaml @@ -0,0 +1,185 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf;assembly=MaterialDesignThemes.Wpf" + xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf" + xmlns:local="clr-namespace:Tango.PPC.UI.Resources"> + + + <Style TargetType="ListBox" BasedOn="{StaticResource {x:Type ListBox}}"> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"></Setter> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"></Setter> + <Setter Property="ScrollViewer.PanningMode" Value="VerticalOnly"></Setter> + <Setter Property="VirtualizingStackPanel.ScrollUnit" Value="Pixel"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + </Style> + + <!--ListBoxItem--><!-- + <Style TargetType="{x:Type ListBoxItem}"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> + <Setter Property="Padding" Value="8"/> + <Setter Property="SnapsToDevicePixels" Value="True"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ListBoxItem}"> + <Border Background="White" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="5" + Margin="2" + ClipToBounds="{TemplateBinding ClipToBounds}"> + <Border.Effect> + <DropShadowEffect ShadowDepth="0" BlurRadius="8" Color="Silver" /> + </Border.Effect> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup Name="CommonStates"> + <VisualStateGroup.Transitions> + <VisualTransition GeneratedDuration="0:0:0.3" To="Normal"> + <VisualTransition.GeneratedEasingFunction> + <CircleEase EasingMode="EaseOut"/> + </VisualTransition.GeneratedEasingFunction> + </VisualTransition> + </VisualStateGroup.Transitions> + <VisualState Name="Normal"/> + --><!--<VisualState Name="MouseOver"> + <Storyboard> + <DoubleAnimation Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" + To="0.1" Duration="0"/> + </Storyboard> + </VisualState>--><!-- + <VisualState Name="Disabled"/> + </VisualStateGroup> + <VisualStateGroup Name="SelectionStates"> + <VisualStateGroup.Transitions> + <VisualTransition GeneratedDuration="0:0:0.6"/> + </VisualStateGroup.Transitions> + <VisualState Name="Selected"> + <Storyboard> + <DoubleAnimation Storyboard.TargetName="SelectedBorder" + Storyboard.TargetProperty="Opacity" + To="0.18" Duration="0"/> + </Storyboard> + </VisualState> + <VisualState Name="Unselected"/> + <VisualState Name="SelectedUnfocused"> + <Storyboard> + <DoubleAnimation Storyboard.TargetName="SelectedBorder" + Storyboard.TargetProperty="Opacity" + To="0.03" Duration="0"/> + </Storyboard> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + <Grid> + <Border x:Name="MouseOverBorder" + Opacity="0" CornerRadius="5" + Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}"/> + + <Border x:Name="SelectedBorder" + Opacity="0" CornerRadius="5" + Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" + RenderTransformOrigin="0.5,0.5"> + <Border.RenderTransform> + <ScaleTransform ScaleX="1"/> + </Border.RenderTransform> + </Border> + <wpf:Ripple Feedback="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" + Focusable="False" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" + ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Padding="{TemplateBinding Padding}"/> + </Grid> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsEnabled" Value="False"> + <Setter Property="Opacity" Value=".56" /> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + --><!--ListBoxItem--> + + <!--Colors--> + <SolidColorBrush x:Key="PrimaryHueLightBrush" Color="{StaticResource Primary200}" /> + <SolidColorBrush x:Key="PrimaryHueLightForegroundBrush" Color="{StaticResource Primary200Foreground}" /> + <SolidColorBrush x:Key="PrimaryHueMidBrush" Color="{StaticResource AccentColor}" /> + <SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="{StaticResource Primary500Foreground}" /> + <SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="{StaticResource Primary700}" /> + <SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="{StaticResource Primary700Foreground}" /> + <!--Colors--> + + <!--RoundedButton--><!-- + <Style x:Key="MaterialDesignRaisedRoundedButton" TargetType="{x:Type ButtonBase}"> + <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> + <Setter Property="Background" Value="{DynamicResource PrimaryHueMidBrush}"/> + <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/> + <Setter Property="Foreground" Value="{DynamicResource PrimaryHueMidForegroundBrush}"/> + <Setter Property="wpf:RippleAssist.Feedback" Value="White" /> + <Setter Property="Cursor" Value="Hand"/> + <Setter Property="wpf:ShadowAssist.ShadowDepth" Value="Depth1" /> + <Setter Property="TextBlock.FontWeight" Value="Medium"/> + <Setter Property="TextBlock.FontSize" Value="14"/> + <Setter Property="BorderThickness" Value="1"/> + <Setter Property="HorizontalContentAlignment" Value="Center"/> + <Setter Property="VerticalContentAlignment" Value="Center"/> + <Setter Property="Padding" Value="16 4 16 4"/> + <Setter Property="Height" Value="32" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ButtonBase}"> + <Grid> + <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}"> + <Grid> + <Border Background="{TemplateBinding Background}" CornerRadius="20" + BorderThickness="{TemplateBinding BorderThickness}" + BorderBrush="{TemplateBinding BorderBrush}" + x:Name="border" + Effect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ShadowAssist.ShadowDepth), Converter={x:Static converters:ShadowConverter.Instance}}" /> + <Border HorizontalAlignment="Left" Background="{DynamicResource MaterialDesignBackground}" Opacity=".4"> + <Border.Width> + <MultiBinding Converter="{StaticResource RangeLengthConverter}"> + <Binding Path="(wpf:ButtonProgressAssist.Minimum)" RelativeSource="{RelativeSource TemplatedParent}" /> + <Binding Path="(wpf:ButtonProgressAssist.Maximum)" RelativeSource="{RelativeSource TemplatedParent}" /> + <Binding Path="(wpf:ButtonProgressAssist.Value)" RelativeSource="{RelativeSource TemplatedParent}" /> + <Binding Path="ActualWidth" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type ButtonBase}}" /> + </MultiBinding> + </Border.Width> + </Border> + </Grid> + </AdornerDecorator> + <wpf:Ripple Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Focusable="False" + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" + Padding="{TemplateBinding Padding}" + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> + </Grid> + <ControlTemplate.Triggers> + <Trigger Property="IsMouseOver" Value="true"> + <Setter TargetName="border" Property="wpf:ShadowAssist.Darken" Value="True" /> + </Trigger> + <Trigger Property="IsKeyboardFocused" Value="true"> + <Setter TargetName="border" Property="wpf:ShadowAssist.Darken" Value="True" /> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Opacity" Value="0.23"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + --><!--RoundedButton--> + + +</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 new file mode 100644 index 000000000..110bbfc86 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml @@ -0,0 +1,19 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + 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 x:Key="JobsListBox" TargetType="ListBox" BasedOn="{StaticResource {x:Type ListBox}}"> + <Setter Property="ItemContainerStyle" Value="{StaticResource JobsListBoxItem}"></Setter> + <Setter Property="Background" Value="#f2f5fa"></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 new file mode 100644 index 000000000..6a60b6701 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -0,0 +1,236 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{654BEDA3-16FB-44FF-ADE7-B52E50B02E63}</ProjectGuid> + <OutputType>WinExe</OutputType> + <RootNamespace>Tango.PanelPC.UI</RootNamespace> + <AssemblyName>Tango.PanelPC.UI</AssemblyName> + <TargetFrameworkVersion>v4.6</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WarningLevel>4</WarningLevel> + <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\Build\Debug\PPC\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>..\..\Build\Release\PanelPC\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL"> + <HintPath>..\..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll</HintPath> + </Reference> + <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> + <HintPath>..\..\packages\EntityFramework.6.0.0\lib\net45\EntityFramework.dll</HintPath> + </Reference> + <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> + <Reference Include="System" /> + <Reference Include="System.ComponentModel.DataAnnotations" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <HintPath>..\..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll</HintPath> + </Reference> + <Reference Include="System.Xml" /> + <Reference Include="Microsoft.CSharp" /> + <Reference Include="System.Core" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Net.Http" /> + <Reference Include="System.Xaml"> + <RequiredTargetFramework>4.0</RequiredTargetFramework> + </Reference> + <Reference Include="WindowsBase" /> + <Reference Include="PresentationCore" /> + <Reference Include="PresentationFramework" /> + </ItemGroup> + <ItemGroup> + <ApplicationDefinition Include="App.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </ApplicationDefinition> + <Compile Include="Navigation\DefaultNavigationManager.cs" /> + <Compile Include="Notifications\DefaultNotificationProvider.cs" /> + <Compile Include="PPCApplication\DefaultPPCApplicationManager.cs" /> + <Compile Include="ViewModelLocator.cs" /> + <Compile Include="ViewModels\JobsViewVM.cs" /> + <Compile Include="ViewModels\LayoutViewVM.cs" /> + <Compile Include="ViewModels\LoadingViewVM.cs" /> + <Compile Include="ViewModels\MainViewVM.cs" /> + <Compile Include="Views\JobsView.xaml.cs"> + <DependentUpon>JobsView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\LayoutView.xaml.cs"> + <DependentUpon>LayoutView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\LoadingView.xaml.cs"> + <DependentUpon>LoadingView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\MainView.xaml.cs"> + <DependentUpon>MainView.xaml</DependentUpon> + </Compile> + <Page Include="MainWindow.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Compile Include="App.xaml.cs"> + <DependentUpon>App.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + <Compile Include="MainWindow.xaml.cs"> + <DependentUpon>MainWindow.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> + <Page Include="Resources\Colors.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Resources\MaterialOverride.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Resources\Styles.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\JobsView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\LayoutView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\LoadingView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\MainView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Properties\Settings.Designer.cs"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + <None Include="packages.config" /> + <None Include="Properties\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <LastGenOutput>Settings.Designer.cs</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <None Include="App.config" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Tango.BL\Tango.BL.csproj"> + <Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project> + <Name>Tango.BL</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Core\Tango.Core.csproj"> + <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project> + <Name>Tango.Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.DragAndDrop\Tango.DragAndDrop.csproj"> + <Project>{b112d89a-a106-41ae-a0c1-4abc84c477f5}</Project> + <Name>Tango.DragAndDrop</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Integration\Tango.Integration.csproj"> + <Project>{4206ac58-3b57-4699-8835-90bf6db01a61}</Project> + <Name>Tango.Integration</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Logging\Tango.Logging.csproj"> + <Project>{bc932dbd-7cdb-488c-99e4-f02cf441f55e}</Project> + <Name>Tango.Logging</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.PMR\Tango.PMR.csproj"> + <Project>{e4927038-348d-4295-aaf4-861c58cb3943}</Project> + <Name>Tango.PMR</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Serialization\Tango.Serialization.csproj"> + <Project>{22f87980-e990-4686-be81-be63d562c4d5}</Project> + <Name>Tango.Serialization</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Settings\Tango.Settings.csproj"> + <Project>{d8f1ad85-526a-4f50-b6dc-d437af63d8d8}</Project> + <Name>Tango.Settings</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.SharedUI\Tango.SharedUI.csproj"> + <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project> + <Name>Tango.SharedUI</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.TFS\Tango.TFS.csproj"> + <Project>{998f8471-dc1b-41b6-9d96-354e1b4e7a32}</Project> + <Name>Tango.TFS</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Touch\Tango.Touch.csproj"> + <Project>{fd86424c-6e84-491b-8df9-3d0f5c236a2a}</Project> + <Name>Tango.Touch</Name> + </ProjectReference> + <ProjectReference Include="..\..\Tango.Transport\Tango.Transport.csproj"> + <Project>{74e700b0-1156-4126-be40-ee450d3c3026}</Project> + <Name>Tango.Transport</Name> + </ProjectReference> + <ProjectReference Include="..\Tango.PPC.Common\Tango.PPC.Common.csproj"> + <Project>{0be74eee-22cb-4dba-b896-793b9e1a3ac0}</Project> + <Name>Tango.PPC.Common</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\liquid.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\account.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\arrows.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\Job Issues\cyan.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\warning.png" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs new file mode 100644 index 000000000..3a37fe452 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModelLocator.cs @@ -0,0 +1,93 @@ +using System; +using Tango.Core.DI; +using Tango.Integration.Services; +using Tango.Logging; +using Tango.PPC.Common.Application; +using Tango.PPC.Common.Authentication; +using Tango.PPC.Common.Diagnostics; +using Tango.PPC.Common.EventLogging; +using Tango.PPC.Common.Navigation; +using Tango.PPC.Common.Notifications; +using Tango.PPC.UI.Navigation; +using Tango.PPC.UI.Notifications; +using Tango.PPC.UI.PPCApplication; +using Tango.PPC.UI.ViewModels; +using Tango.TFS; + +namespace Tango.PPC.UI +{ + /// <summary> + /// This class contains static references to all the view models in the + /// application and provides an entry point for the bindings. + /// </summary> + public static class ViewModelLocator + { + /// <summary> + /// Initializes a new instance of the ViewModelLocator class. + /// </summary> + static ViewModelLocator() + { + TangoIOC.Default.Unregister<INotificationProvider>(); + TangoIOC.Default.Unregister<IAuthenticationProvider>(); + TangoIOC.Default.Unregister<INavigationManager>(); + TangoIOC.Default.Unregister<IPPCApplicationManager>(); + TangoIOC.Default.Unregister<ExternalBridgeScanner>(); + TangoIOC.Default.Unregister<IDiagnosticsFrameProvider>(); + TangoIOC.Default.Unregister<IEventLogger>(); + TangoIOC.Default.Unregister<ITeamFoundationServiceClient>(); + + TangoIOC.Default.Register<INotificationProvider, DefaultNotificationProvider>(); + TangoIOC.Default.Register<IAuthenticationProvider, DefaultAuthenticationProvider>(); + TangoIOC.Default.Register<INavigationManager, DefaultNavigationManager>(); + TangoIOC.Default.Register<IPPCApplicationManager, DefaultPPCApplicationManager>(); + TangoIOC.Default.Register<ExternalBridgeScanner, ExternalBridgeScanner>(); + TangoIOC.Default.Register<IDiagnosticsFrameProvider, DefaultDiagnosticsFrameProvider>(); + TangoIOC.Default.Register<IEventLogger, DefaultEventLogger>(); + //TangoIOC.Default.Register<TeamFoundationServiceExtendedClient>(new TeamFoundationServiceExtendedClient("https://twinetfs.visualstudio.com", String.Empty, "szzfokrceo4rhd4eqi5qpmxn3pa5iwl3q7tlqd36l2m7smz2ynoa")); + + TangoIOC.Default.Register<LoadingViewVM>(); + TangoIOC.Default.Register<MainViewVM>(); + TangoIOC.Default.Register<LayoutViewVM>(); + TangoIOC.Default.Register<JobsViewVM>(); + //TangoIOC.Default.Register<LoadingViewVM>(); + //TangoIOC.Default.Register<ShutdownViewVM>(); + //TangoIOC.Default.Register<LoginViewVM>(); + //TangoIOC.Default.Register<MachineConnectionViewVM>(); + //TangoIOC.Default.Register<ConnectedMachineViewVM>(); + //TangoIOC.Default.Register<MachineLoginViewVM>(); + //TangoIOC.Default.Register<UpdateViewVM>(); + } + + public static LoadingViewVM LoadingView + { + get + { + return TangoIOC.Default.GetInstance<LoadingViewVM>(); + } + } + + public static MainViewVM MainViewVM + { + get + { + return TangoIOC.Default.GetInstance<MainViewVM>(); + } + } + + public static LayoutViewVM LayoutViewVM + { + get + { + return TangoIOC.Default.GetInstance<LayoutViewVM>(); + } + } + + public static JobsViewVM JobsViewVM + { + get + { + return TangoIOC.Default.GetInstance<JobsViewVM>(); + } + } + } +}
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/JobsViewVM.cs new file mode 100644 index 000000000..0eb59eeeb --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/JobsViewVM.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; +using Tango.PPC.Common; +using Tango.PPC.Common.Application; +using Tango.PPC.Common.Authentication; +using Tango.PPC.Common.Navigation; +using Tango.PPC.Common.Notifications; +using Tango.Settings; +using Tango.SharedUI; + +namespace Tango.PPC.UI.ViewModels +{ + public class JobsViewVM : PPCViewModel + { + private ObservablesContext _jobsContext; + + private ObservableCollection<Job> _jobs; + + public ObservableCollection<Job> Jobs + { + get { return _jobs; } + set { _jobs = value; RaisePropertyChangedAuto(); } + } + + public JobsViewVM(IPPCApplicationManager application, IAuthenticationProvider authentication, INavigationManager navigation, INotificationProvider notification) : base(application, authentication, navigation, notification) + { + Jobs = new ObservableCollection<Job>(); + } + + public override void OnApplicationStarted() + { + LoadJobs(); + } + + private void LoadJobs() + { + Task.Factory.StartNew(() => + { + if (_jobsContext != null) + { + _jobsContext.Dispose(); + } + + _jobsContext = ObservablesContext.CreateDefault(); + Jobs = _jobsContext.Jobs.Where(x => x.Machine.SerialNumber == Settings.MachineSerialNumber).ToObservableCollection(); + }); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs new file mode 100644 index 000000000..cc64f82f5 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.PPC.UI.ViewModels +{ + public class LayoutViewVM : ViewModel + { + + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs new file mode 100644 index 000000000..4cc812a17 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; +using Tango.PPC.Common.Application; +using Tango.PPC.Common.Authentication; +using Tango.PPC.Common.Navigation; +using Tango.PPC.Common.Notifications; +using Tango.SharedUI; + +namespace Tango.PPC.UI.ViewModels +{ + public class LoadingViewVM : PPCViewModel + { + public LoadingViewVM(IPPCApplicationManager application, IAuthenticationProvider authentication, INavigationManager navigation, INotificationProvider notification) : base(application, authentication, navigation, notification) + { + + } + + public async override void OnApplicationStarted() + { + await Task.Delay(2000); + NavigationManager.NavigateTo(NavigationView.LayoutView); + NavigationManager.NavigateTo(NavigationView.JobsView); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..c75e031f1 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common.Application; +using Tango.SharedUI; + +namespace Tango.PPC.UI.ViewModels +{ + public class MainViewVM : ViewModel + { + public String Test { get; set; } + + public MainViewVM(IPPCApplicationManager application) + { + Test = "This is a binding test"; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml new file mode 100644 index 000000000..8062280de --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml @@ -0,0 +1,94 @@ +<UserControl x:Class="Tango.PPC.UI.Views.JobsView" + 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:vm="clr-namespace:Tango.PPC.UI.ViewModels" + xmlns:global="clr-namespace:Tango.PPC.UI" + xmlns:keyboard="clr-namespace:Tango.SharedUI.Keyboard;assembly=Tango.SharedUI" + xmlns:converters="clr-namespace:Tango.PPC.Common.Converters;assembly=Tango.PanelPC.Common" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:sys="clr-namespace:System;assembly=mscorlib" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:local="clr-namespace:Tango.PPC.UI.Views" + mc:Ignorable="d" + d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:JobsViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.JobsViewVM}"> + + <UserControl.Resources> + <converters:SegmentsToPieConverter x:Key="SegmentsToPieConverter" /> + <sharedConverters:DateTimeUTCToShortDateConverter x:Key="DateTimeUTCToShortDateConverter" /> + </UserControl.Resources> + + <Grid Background="{StaticResource TangoMidBackgroundBrush}"> + <Grid.RowDefinitions> + <RowDefinition Height="82"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Border 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="25" FontWeight="SemiBold">JOBS</TextBlock> + </Border> + + <Grid Grid.Row="1"> + <Grid.RowDefinitions> + <RowDefinition Height="100"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <touch:TouchNavigationLinks VerticalAlignment="Bottom" Margin="20" FontSize="18" FontWeight="SemiBold"> + <sys:String>READY TO DYE</sys:String> + <sys:String>NOT READY</sys:String> + <sys:String>ALL</sys:String> + </touch:TouchNavigationLinks> + + <Grid Grid.Row="1"> + <touch:TouchDataGrid ItemsSource="{Binding Jobs}" Margin="10" EnableDropShadow="True" ShadowColor="#ECECEC" AutoGenerateColumns="False" RowHeight="68" ColumnHeaderHeight="67"> + <touch:TouchDataGrid.Columns> + <DataGridTemplateColumn> + <DataGridTemplateColumn.Header> + <Image Source="/Images/warning.png" Width="24" /> + </DataGridTemplateColumn.Header> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Image Source="/Images/Job Issues/cyan.png" Width="38" /> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="Status" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Width="295" Binding="{Binding Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Length (m)" Binding="{Binding Length,StringFormat=0.0}"></DataGridTextColumn> + <DataGridTemplateColumn Header="Colors" SortMemberPath="Segments.Count"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <ContentControl Content="{Binding Segments,Converter={StaticResource SegmentsToPieConverter}}" Width="23" Height="23"></ContentControl> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="Updated" Binding="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter}}"></DataGridTextColumn> + <DataGridTextColumn Binding="{Binding JobIndex}" Width="70" SortMemberPath="JobIndex"> + <DataGridTextColumn.HeaderStyle> + <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}"> + <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + </Style> + </DataGridTextColumn.HeaderStyle> + <DataGridTextColumn.Header> + <Grid> + <Grid IsHitTestVisible="False"> + <Rectangle HorizontalAlignment="Left" StrokeThickness="2" Stroke="{StaticResource TangoColumnDividerBrush}" /> + <Image Source="/Images/arrows.png" Width="28" /> + </Grid> + </Grid> + </DataGridTextColumn.Header> + </DataGridTextColumn> + </touch:TouchDataGrid.Columns> + </touch:TouchDataGrid> + </Grid> + </Grid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml.cs new file mode 100644 index 000000000..3ccb48c01 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/JobsView.xaml.cs @@ -0,0 +1,28 @@ +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.PPC.UI.Views +{ + /// <summary> + /// Interaction logic for JobsView.xaml + /// </summary> + public partial class JobsView : UserControl + { + public JobsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml new file mode 100644 index 000000000..2a6d1b52b --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -0,0 +1,119 @@ +<UserControl x:Class="Tango.PPC.UI.Views.LayoutView" + 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.PPC.UI.Views" + xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" + xmlns:fa="http://schemas.fontawesome.io/icons/" + xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" + xmlns:global="clr-namespace:Tango.PPC.UI" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch" + mc:Ignorable="d" + d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LayoutViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LayoutViewVM}"> + + <Grid> + <touch:TouchSideMenu x:Name="menu"> + <touch:TouchSideMenu.MenuContent> + <Border x:Name="border" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDividerBrush}"> + <DockPanel LastChildFill="False" Background="{StaticResource TangoPrimaryBackgroundBrush}"> + <StackPanel MinWidth="300" DockPanel.Dock="Top"> + <Grid> + <touch:TouchToggleButton Style="{StaticResource TouchToggleButtonHamburger}" + HorizontalAlignment="Right" Margin="16" + IsChecked="{Binding ElementName=menu,Path=IsOpened}" /> + + <StackPanel Margin="5 0 0 0" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center"> + <Image Source="/Images/account.png" RenderOptions.BitmapScalingMode="Fant" VerticalAlignment="Center" Width="50" Height="50"></Image> + <StackPanel Margin="0 5 0 0"> + <TextBlock FontSize="16" TextTrimming="CharacterEllipsis" MaxWidth="170" FontStyle="Italic" FontWeight="Bold" Margin="10 0 0 0" VerticalAlignment="Center" Text="{Binding AuthenticationProvider.CurrentUser.Contact.FullName}"></TextBlock> + <TextBlock FontSize="12" TextTrimming="CharacterEllipsis" MaxWidth="170" FontStyle="Italic" Margin="10 5 0 0" VerticalAlignment="Center"> + <Run Text="{Binding AuthenticationProvider.CurrentUser.Organization.Name}"></Run> + , + <Run Text="{Binding AuthenticationProvider.CurrentUser.Roles[0].Name}"> + <Run.ToolTip> + <ItemsControl ItemsSource="{Binding AuthenticationProvider.CurrentUser.Roles}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal" Margin="2"> + <fa:ImageAwesome Icon="User" Width="16" Height="16" /> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}"></TextBlock> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </Run.ToolTip> + </Run> + <Run>...</Run> + </TextBlock> + </StackPanel> + </StackPanel> + </Grid> + <StackPanel Margin="0 16 0 0"> + <ListBoxItem> + <i:Interaction.Triggers> + <i:EventTrigger EventName="PreviewMouseUp"> + <i:InvokeCommandAction Command="{Binding HomeCommand}"></i:InvokeCommandAction> + </i:EventTrigger> + </i:Interaction.Triggers> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome VerticalAlignment="Center" Icon="Home" Width="32" Height="32"></fa:ImageAwesome> + <TextBlock FontSize="16" VerticalAlignment="Center" Margin="10 0 0 0">Home</TextBlock> + </StackPanel> + </ListBoxItem> + </StackPanel> + </StackPanel> + + <StackPanel DockPanel.Dock="Bottom"> + <Separator Margin="0 10 0 0" Background="Gainsboro" /> + <ListBoxItem> + <i:Interaction.Triggers> + <i:EventTrigger EventName="PreviewMouseUp"> + <i:InvokeCommandAction Command="{Binding SignoutCommand}"></i:InvokeCommandAction> + </i:EventTrigger> + </i:Interaction.Triggers> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome VerticalAlignment="Center" Icon="SignOut" Width="32" Height="32"></fa:ImageAwesome> + <TextBlock FontSize="16" VerticalAlignment="Center" Margin="10 0 0 0">Sign out</TextBlock> + </StackPanel> + </ListBoxItem> + </StackPanel> + </DockPanel> + </Border> + </touch:TouchSideMenu.MenuContent> + + <DockPanel> + <Border BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}" DockPanel.Dock="Top"> + <DockPanel> + <Border Padding="20" BorderThickness="0 0 1 0" BorderBrush="{StaticResource BorderColorBrush}"> + <touch:TouchToggleButton Width="50" Height="50" Foreground="{StaticResource TangoPrimaryAccentBrush}" Style="{StaticResource TouchToggleButtonHamburger}" IsChecked="{Binding ElementName=menu,Path=IsOpened}"> + <ToggleButton.Effect> + <DropShadowEffect ShadowDepth="15" BlurRadius="20" Color="Silver" /> + </ToggleButton.Effect> + </touch:TouchToggleButton> + </Border> + <Grid> + <StackPanel HorizontalAlignment="Right" Margin="30 0" Orientation="Horizontal"> + <touch:TouchButton Height="54" FontSize="20" Padding="0" Width="184" CornerRadius="30" BlurRadius="20"> + DYE + </touch:TouchButton> + </StackPanel> + </Grid> + </DockPanel> + </Border> + + <Grid Background="{StaticResource TangoMidBackgroundBrush}"> + <Grid> + <keyboard:KeyboardView> + <controls:NavigationControl x:Name="NavigationControl" x:FieldModifier="public" TransitionAlwaysFades="False" TransitionType="Slide"> + <local:JobsView controls:NavigationControl.NavigationName="JobsView"></local:JobsView> + </controls:NavigationControl> + </keyboard:KeyboardView> + </Grid> + </Grid> + </DockPanel> + </touch:TouchSideMenu> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs new file mode 100644 index 000000000..e6c778a92 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs @@ -0,0 +1,31 @@ +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.PPC.UI.Views +{ + /// <summary> + /// Interaction logic for LayoutView.xaml + /// </summary> + public partial class LayoutView : UserControl + { + public static LayoutView Instance { get; private set; } + + public LayoutView() + { + InitializeComponent(); + Instance = this; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml new file mode 100644 index 000000000..d50c42f7c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml @@ -0,0 +1,18 @@ +<UserControl x:Class="Tango.PPC.UI.Views.LoadingView" + 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:vm="clr-namespace:Tango.PPC.UI.ViewModels" + xmlns:global="clr-namespace:Tango.PPC.UI" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:local="clr-namespace:Tango.PPC.UI.Views" + mc:Ignorable="d" + d:DesignHeight="1280" d:DesignWidth="720" Background="White" d:DataContext="{d:DesignInstance Type=vm:LoadingViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LoadingView}"> + <Grid> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> + <touch:TouchBusyIndicator IsIndeterminate="True" Value="0" Width="200" Height="200" StrokeThickness="10"></touch:TouchBusyIndicator> + <TextBlock FontSize="20" Margin="20" HorizontalAlignment="Center">Loading...</TextBlock> + </StackPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs new file mode 100644 index 000000000..a1214a0df --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs @@ -0,0 +1,28 @@ +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.PPC.UI.Views +{ + /// <summary> + /// Interaction logic for LoadingView.xaml + /// </summary> + public partial class LoadingView : UserControl + { + public LoadingView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml new file mode 100644 index 000000000..9d264afae --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -0,0 +1,18 @@ +<UserControl x:Class="Tango.PPC.UI.Views.MainView" + 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:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" + xmlns:global="clr-namespace:Tango.PPC.UI" + xmlns:local="clr-namespace:Tango.PPC.UI.Views" + mc:Ignorable="d" + d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + <Grid> + <controls:NavigationControl TransitionAlwaysFades="True" TransitionType="Zoom" x:Name="NavigationControl" x:FieldModifier="public"> + <local:LoadingView controls:NavigationControl.NavigationName="LoadingView"></local:LoadingView> + <local:LayoutView controls:NavigationControl.NavigationName="LayoutView"></local:LayoutView> + </controls:NavigationControl> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml.cs new file mode 100644 index 000000000..cd7562d04 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml.cs @@ -0,0 +1,31 @@ +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.PPC.UI.Views +{ + /// <summary> + /// Interaction logic for MainView.xaml + /// </summary> + public partial class MainView : UserControl + { + public static MainView Instance { get; private set; } + + public MainView() + { + InitializeComponent(); + Instance = this; + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config new file mode 100644 index 000000000..e4617d73a --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="ControlzEx" version="3.0.2.4" targetFramework="net46" /> + <package id="EntityFramework" version="6.0.0" targetFramework="net46" /> + <package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net46" /> + <package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" /> + <package id="Google.Protobuf" version="3.4.1" targetFramework="net46" /> +</packages>
\ No newline at end of file |
