diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-19 14:45:01 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-19 14:45:01 +0300 |
| commit | 1db87b6d19c6148351b37a32e8ff2b127768e945 (patch) | |
| tree | 3cf05c7a2dff684da139603e87a86aa4743ea5c8 /Software/Visual_Studio/PPC/Tango.PPC.UI | |
| parent | 6f9da1e19024c7c65d7dbd6038cd34776453f9dc (diff) | |
| download | Tango-1db87b6d19c6148351b37a32e8ff2b127768e945.tar.gz Tango-1db87b6d19c6148351b37a32e8ff2b127768e945.zip | |
Embedded Touch Panel in PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
8 files changed, 30 insertions, 142 deletions
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 cbdbab848..fc1ba894f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -13,6 +13,7 @@ using System.Windows.Media.Imaging; using Tango.SharedUI.Helpers; using System.Timers; using Tango.Core.Commands; +using Tango.Touch.Controls; namespace Tango.PPC.UI.Notifications { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml deleted file mode 100644 index b1fe7ddcc..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml +++ /dev/null @@ -1,45 +0,0 @@ -<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="400" d:DesignWidth="800" d:DataContext="{d:DesignInstance vm:MessageBoxVM,IsDesignTimeCreatable=False}"> - <Grid> - <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="10" Margin="10"> - <Border.Effect> - <DropShadowEffect BlurRadius="10" /> - </Border.Effect> - - <Grid ClipToBounds="True"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="100"/> - <ColumnDefinition Width="75*"/> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="100" /> - <RowDefinition Height="1*" /> - <RowDefinition Height="70"/> - </Grid.RowDefinitions> - - <Image Grid.Row="0" Source="{Binding Icon}" Margin="20" /> - <TextBlock Grid.Column="1" Text="{Binding Title,TargetNullValue=Confirm}" Foreground="{Binding Brush,TargetNullValue={StaticResource TangoPrimaryAccentBrush}}" VerticalAlignment="Center" Margin="10" Style="{StaticResource TangoMessageBoxTitle}"></TextBlock> - - <Rectangle Stroke="{Binding Brush}" VerticalAlignment="Bottom" Grid.ColumnSpan="2" StrokeThickness="3" /> - - <TextBlock Grid.Row="1" FontSize="{StaticResource TangoMessageBoxMessageFontSize}" Text="{Binding Message}" VerticalAlignment="Top" Grid.Column="1" TextWrapping="Wrap" Margin="10 20 10 10"></TextBlock> - - <Rectangle Stroke="{StaticResource TangoDividerBrush}" VerticalAlignment="Bottom" Grid.Row="1" Grid.ColumnSpan="2" StrokeThickness="1"/> - - <StackPanel Grid.Column="1" Grid.Row="2" HorizontalAlignment="Right" Orientation="Horizontal"> - <touch:TouchButton x:Name="btnCancel" Width="180" Margin="2 0" Style="{StaticResource TangoMessageBoxButton}" Command="{Binding CloseCommand}" Visibility="{Binding HasCancel,Converter={StaticResource BooleanToVisibilityConverter}}">CANCEL</touch:TouchButton> - <touch:TouchButton x:Name="btnOK" Width="180" Margin="2 0" Style="{StaticResource TangoMessageBoxButton}" Command="{Binding OKCommand}">OK</touch:TouchButton> - </StackPanel> - </Grid> - </Border> - </Grid> -</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 deleted file mode 100644 index a13cfe81f..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml.cs +++ /dev/null @@ -1,29 +0,0 @@ -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/Resources/Fonts.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml index c510f85e5..57a7fa9f4 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Fonts.xaml @@ -3,7 +3,6 @@ xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Tango.PPC.UI.Resources"> - <sys:Double x:Key="TangoMessageBoxTitleFontSize">30</sys:Double> - <sys:Double x:Key="TangoMessageBoxMessageFontSize">20</sys:Double> + </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml index d2948f070..62cbe86db 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Resources/Styles.xaml @@ -14,17 +14,4 @@ <Setter Property="FontSize" Value="{StaticResource TangoButtonFontSize}"></Setter> </Style> - <Style x:Key="TangoMessageBoxButton" TargetType="{x:Type touch:TouchButton}" BasedOn="{StaticResource TangoFlatButton}"> - <Setter Property="HorizontalContentAlignment" Value="Center"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}"></Setter> - <Setter Property="FontSize" Value="{StaticResource TangoButtonFontSize}"></Setter> - <Setter Property="BorderBrush" Value="{StaticResource TangoDividerBrush}"></Setter> - <Setter Property="BorderThickness" Value="1 0 0 0"></Setter> - </Style> - - <Style x:Key="TangoMessageBoxTitle" TargetType="TextBlock"> - <Setter Property="FontSize" Value="{StaticResource TangoMessageBoxTitleFontSize}"></Setter> - <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> - </Style> - </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index a74d3a687..ffe4c0799 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 @@ -97,9 +97,6 @@ <Compile Include="Modules\DefaultStudioModuleLoader.cs" /> <Compile Include="Navigation\DefaultNavigationManager.cs" /> <Compile Include="Notifications\DefaultNotificationProvider.cs" /> - <Compile Include="Notifications\MessageBox.xaml.cs"> - <DependentUpon>MessageBox.xaml</DependentUpon> - </Compile> <Compile Include="Notifications\NotificationItems\EmptyCartridgesNotification.cs" /> <Compile Include="Notifications\NotificationItems\EmptyCartridgesNotificationView.xaml.cs"> <DependentUpon>EmptyCartridgesNotificationView.xaml</DependentUpon> @@ -132,10 +129,6 @@ <DependentUpon>MainWindow.xaml</DependentUpon> <SubType>Code</SubType> </Compile> - <Page Include="Notifications\MessageBox.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </Page> <Page Include="Notifications\NotificationItems\EmptyCartridgesNotificationView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> 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 a3f7d70e1..5e20e0887 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -19,16 +19,7 @@ <localConverters:NotificationItemConverter x:Key="NotificationItemConverter" /> </UserControl.Resources> - <touch:TouchNotificationBar MinNotificationHeight="60" HasNotifications="{Binding NotificationProvider.HasNotificationItems}" Notifications="{Binding NotificationProvider.NotificationItems}"> - <touch:TouchNotificationBar.NotificationTemplate> - <DataTemplate> - <Grid> - <ContentControl Content="{Binding Converter={StaticResource NotificationItemConverter}}" /> - <touch:TouchIconButton Background="Transparent" Padding="20" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.NotificationProvider.PopNotificationCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="60" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="White" /> - </Grid> - </DataTemplate> - </touch:TouchNotificationBar.NotificationTemplate> - + <Grid> <touch:TouchSideMenu x:Name="menu" IsOpened="{Binding IsMenuOpened,Mode=TwoWay}" Grid.Row="1"> <touch:TouchSideMenu.MenuContent> <Border x:Name="border" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDividerBrush}"> @@ -124,15 +115,11 @@ </Border> <Grid Background="{StaticResource TangoKeyboardBackground}"> - <Grid> - <keyboard:KeyboardView> - <controls:NavigationControl x:Name="NavigationControl" x:FieldModifier="public" TransitionAlwaysFades="False" TransitionType="Zoom"> - - </controls:NavigationControl> - </keyboard:KeyboardView> - </Grid> + <controls:NavigationControl x:Name="NavigationControl" x:FieldModifier="public" TransitionAlwaysFades="False" TransitionType="Zoom"> + <!--MODULES GOES HERE--> + </controls:NavigationControl> </Grid> </DockPanel> </touch:TouchSideMenu> - </touch:TouchNotificationBar> + </Grid> </UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index 1bfdda517..88515de8e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -7,36 +7,31 @@ xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" xmlns:global="clr-namespace:Tango.PPC.UI" xmlns:local="clr-namespace:Tango.PPC.UI.Views" - xmlns:notifications="clr-namespace:Tango.PanelPC.UI.Notifications" + xmlns:notifications="clr-namespace:Tango.PPC.UI.Notifications" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:localConverters="clr-namespace:Tango.PPC.UI.Converters" 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" KeepElementsAttached="True"> - <local:LoadingView></local:LoadingView> - <local:LayoutView></local:LayoutView> - </controls:NavigationControl> - <Grid Background="#9E000000"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="Opacity" Value="0"></Setter> - <Setter Property="Visibility" Value="Hidden"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding NotificationProvider.HasMessageBox}" Value="True"> - <Setter Property="Visibility" Value="Visible"></Setter> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Duration="00:00:0.2" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> + <UserControl.Resources> + <localConverters:NotificationItemConverter x:Key="NotificationItemConverter" /> + </UserControl.Resources> - <notifications:MessageBox Height="400" Margin="20" DataContext="{Binding NotificationProvider.CurrentMessageBox}" /> - </Grid> - </Grid> + <Grid> + <touch:TouchPanel HasMessageBox="{Binding NotificationProvider.HasMessageBox}" CurrentMessageBox="{Binding NotificationProvider.CurrentMessageBox}" HasNotifications="{Binding NotificationProvider.HasNotificationItems}" Notifications="{Binding NotificationProvider.NotificationItems}"> + <touch:TouchPanel.NotificationTemplate> + <DataTemplate> + <Grid> + <ContentControl Content="{Binding Converter={StaticResource NotificationItemConverter}}" /> + <touch:TouchIconButton Background="Transparent" Padding="20" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.NotificationProvider.PopNotificationCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="60" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="White" /> + </Grid> + </DataTemplate> + </touch:TouchPanel.NotificationTemplate> + + <controls:NavigationControl TransitionAlwaysFades="True" TransitionType="Zoom" x:Name="NavigationControl" x:FieldModifier="public" KeepElementsAttached="True"> + <local:LoadingView></local:LoadingView> + <local:LayoutView></local:LayoutView> + </controls:NavigationControl> + </touch:TouchPanel> + </Grid> </UserControl> |
