diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-04 19:46:05 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-03-04 19:46:05 +0200 |
| commit | fc8f4f7a358640f8f6495397f822320f87018d04 (patch) | |
| tree | e185ab464f2cdfdf71ed473ca87d5044e6b04c23 /Software/Visual_Studio | |
| parent | ecd2a6146289cd6b3c3dd7c1153a5f9da16dd69c (diff) | |
| download | Tango-fc8f4f7a358640f8f6495397f822320f87018d04.tar.gz Tango-fc8f4f7a358640f8f6495397f822320f87018d04.zip | |
Fixed issue with Start/Stop App Button on PPC.
Implemented new notifications design.
Diffstat (limited to 'Software/Visual_Studio')
12 files changed, 172 insertions, 75 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/AppButtons/StopPrintingButton.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/AppButtons/StopPrintingButton.cs index 8c3b444b3..d9ef86861 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/AppButtons/StopPrintingButton.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/AppButtons/StopPrintingButton.cs @@ -9,7 +9,7 @@ namespace Tango.PPC.Jobs.AppButtons { public class StopPrintingButton : AppButton { - public StopPrintingButton() : base("STOP DYEING", true) + public StopPrintingButton() : base("STOP", true) { } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index 6d4a4ef55..042272960 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -1035,6 +1035,16 @@ namespace Tango.PPC.Jobs.ViewModels public override void OnApplicationStarted() { base.OnApplicationStarted(); + + MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded; + } + + private void MachineOperator_PrintingEnded(object sender, Integration.Operation.PrintingEventArgs e) + { + if (IsVisible) + { + _start_printing_btn.Push(); + } } /// <summary> @@ -1042,7 +1052,10 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> public override void OnNavigatedTo() { - _start_printing_btn.Push(); + if (MachineProvider.MachineOperator.Status != Integration.Operation.MachineStatuses.Printing) + { + _start_printing_btn.Push(); + } base.OnNavigatedTo(); LoadJob(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml index efb6a5447..63350a9e6 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItems/MessageNotificationItemView.xaml @@ -6,62 +6,113 @@ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:local="clr-namespace:Tango.PPC.Common.Notifications.NotificationItems" mc:Ignorable="d" - d:DesignHeight="60" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:MessageNotificationItem, IsDesignTimeCreatable=False}" MinHeight="60" Height="60" MaxHeight="150"> + d:DesignHeight="60" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:MessageNotificationItem, IsDesignTimeCreatable=False}" MinHeight="90" Height="90" MaxHeight="150" Background="White"> - <ContentControl> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding MessageType}" Value="Info"> - <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding MessageType}" Value="Success"> - <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding MessageType}" Value="Warning"> - <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding MessageType}" Value="Error"> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding MessageType}" Value="Critical"> - <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - <DockPanel> - <touch:TouchIcon Margin="15" DockPanel.Dock="Left" MaxHeight="50"> - <touch:TouchIcon.Style> - <Style TargetType="touch:TouchIcon"> - <Setter Property="Icon" Value="Information"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding MessageType}" Value="Info"> - <Setter Property="Icon" Value="Information"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding MessageType}" Value="Success"> - <Setter Property="Icon" Value="Check"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding MessageType}" Value="Warning"> - <Setter Property="Icon" Value="AlertCircleOutline"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding MessageType}" Value="Error"> - <Setter Property="Icon" Value="AlertCircleOutline"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding MessageType}" Value="Critical"> - <Setter Property="Icon" Value="Alert"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </touch:TouchIcon.Style> - </touch:TouchIcon> - <StackPanel Margin="10 0 0 0" VerticalAlignment="Center"> - <TextBlock Text="{Binding Message}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap"></TextBlock> + <Grid> + <Border BorderThickness="0 0 0 2"> + <Border.Style> + <Style TargetType="Border"> + <Style.Triggers> + <DataTrigger Binding="{Binding MessageType}" Value="Info"> + <Setter Property="Background"> + <Setter.Value> + <SolidColorBrush Color="{StaticResource TangoPrimaryAccentColor}" Opacity="0.2"></SolidColorBrush> + </Setter.Value> + </Setter> + <Setter Property="BorderBrush" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Success"> + <Setter Property="Background"> + <Setter.Value> + <SolidColorBrush Color="{StaticResource TangoSuccessColor}" Opacity="0.2"></SolidColorBrush> + </Setter.Value> + </Setter> + <Setter Property="BorderBrush" Value="{StaticResource TangoSuccessBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Warning"> + <Setter Property="Background"> + <Setter.Value> + <SolidColorBrush Color="{StaticResource TangoWarningColor}" Opacity="0.2"></SolidColorBrush> + </Setter.Value> + </Setter> + <Setter Property="BorderBrush" Value="{StaticResource TangoWarningBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Error"> + <Setter Property="Background"> + <Setter.Value> + <SolidColorBrush Color="{StaticResource TangoErrorColor}" Opacity="0.2"></SolidColorBrush> + </Setter.Value> + </Setter> + <Setter Property="BorderBrush" Value="{StaticResource TangoErrorBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Critical"> + <Setter Property="Background"> + <Setter.Value> + <SolidColorBrush Color="{StaticResource TangoErrorColor}" Opacity="0.2"></SolidColorBrush> + </Setter.Value> + </Setter> + <Setter Property="BorderBrush" Value="{StaticResource TangoErrorBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + </Border> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding MessageType}" Value="Info"> + <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Success"> + <Setter Property="Foreground" Value="{StaticResource TangoSuccessBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Warning"> + <Setter Property="Foreground" Value="{StaticResource TangoWarningBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Error"> + <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Critical"> + <Setter Property="Foreground" Value="{StaticResource TangoErrorBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + <DockPanel> + <touch:TouchIcon Margin="15" DockPanel.Dock="Left" MaxHeight="40"> + <touch:TouchIcon.Style> + <Style TargetType="touch:TouchIcon"> + <Setter Property="Icon" Value="Information"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding MessageType}" Value="Info"> + <Setter Property="Icon" Value="Information"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Success"> + <Setter Property="Icon" Value="Check"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Warning"> + <Setter Property="Icon" Value="AlertCircleOutline"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Error"> + <Setter Property="Icon" Value="AlertCircleOutline"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding MessageType}" Value="Critical"> + <Setter Property="Icon" Value="Alert"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </touch:TouchIcon.Style> + </touch:TouchIcon> - <TextBlock Margin="5 20 0 0" Foreground="{StaticResource TangoGrayTextBrush}" Text="{Binding ExpandedMessage}" TextWrapping="Wrap" Visibility="{Binding IsExpanded,Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock> - </StackPanel> - </DockPanel> - </ContentControl> + <StackPanel Margin="10 0 0 0" VerticalAlignment="Center"> + <TextBlock Text="{Binding Message}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Foreground="Black"></TextBlock> + + <TextBlock Margin="0 10 0 0" Foreground="{StaticResource TangoDarkForegroundBrush}" Text="{Binding ExpandedMessage}" TextWrapping="Wrap" Visibility="{Binding IsExpanded,Converter={StaticResource BooleanToVisibilityConverter}}"></TextBlock> + </StackPanel> + </DockPanel> + </ContentControl> + </Grid> </UserControl> 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 9cd34e67c..d7dca484e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -29,6 +29,7 @@ namespace Tango.PPC.UI.Notifications { private ConcurrentQueue<PendingNotification<MessageBoxVM, bool>> _pendingMessageBoxes; private ConcurrentQueue<PendingNotification<DialogAndView, DialogViewVM>> _pendingDialogs; + private List<AppButton> _appButtons; private bool _notificationsVisible; /// <summary> @@ -60,6 +61,7 @@ namespace Tango.PPC.UI.Notifications TaskBarItems = new ObservableCollection<TaskBarItem>(); _pendingMessageBoxes = new ConcurrentQueue<PendingNotification<MessageBoxVM, bool>>(); _pendingDialogs = new ConcurrentQueue<PendingNotification<DialogAndView, DialogViewVM>>(); + _appButtons = new List<AppButton>(); PopNotificationCommand = new RelayCommand<NotificationItem>((x) => PopNotification(x)); @@ -521,6 +523,7 @@ namespace Tango.PPC.UI.Notifications /// <param name="appButton">The app button.</param> public void PushAppButton(AppButton appButton) { + _appButtons.Insert(0, appButton); CurrentAppButton = appButton; } @@ -530,10 +533,9 @@ namespace Tango.PPC.UI.Notifications /// <param name="appButton">The app button.</param> public void PopAppButton(AppButton appButton) { - if (CurrentAppButton == appButton) - { - CurrentAppButton = null; - } + _appButtons.RemoveAll(x => x == appButton); + + CurrentAppButton = _appButtons.FirstOrDefault(); } } } 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 bf3a85543..0a6919fbf 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -141,7 +141,7 @@ <TextBlock Margin="0 10 0 0" Text="{Binding MachineProvider.MachineOperator.Status,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock> </StackPanel> - <touch:TouchButton Margin="40 0 0 0" Height="54" Padding="50 0" MinWidth="184" CornerRadius="30" BlurRadius="20" Command="{Binding NotificationProvider.CurrentAppButton.Command}" IsEnabled="{Binding NotificationProvider.CurrentAppButton.IsEnabled}" Content="{Binding NotificationProvider.CurrentAppButton.Text}" Visibility="{Binding NotificationProvider.CurrentAppButton,Converter={StaticResource IsNullToVisibilityConverter}}"></touch:TouchButton> + <touch:TouchButton Margin="40 0 0 0" Height="65" Padding="50 0" MinWidth="200" CornerRadius="35" BlurRadius="20" Command="{Binding NotificationProvider.CurrentAppButton.Command}" IsEnabled="{Binding NotificationProvider.CurrentAppButton.IsEnabled}" Content="{Binding NotificationProvider.CurrentAppButton.Text}" Visibility="{Binding NotificationProvider.CurrentAppButton,Converter={StaticResource IsNullToVisibilityConverter}}"></touch:TouchButton> </StackPanel> </Grid> <Grid> 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 c6e3fa6ea..e4c107049 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -32,10 +32,10 @@ <touch:TouchPanel.NotificationTemplate> <DataTemplate> <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="0" Command="{Binding PressedCommand}" components:TransformationHelper.TransformWhenPressed="False"> - <DockPanel> - <touch:TouchIconButton Visibility="{Binding CanClose,Converter={StaticResource BooleanToVisibilityConverter}}" DockPanel.Dock="Right" Background="Transparent" Padding="20" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="60" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="White" /> + <Grid> <ContentControl Content="{Binding Converter={StaticResource ItemBaseConverter}}"/> - </DockPanel> + <touch:TouchIconButton Visibility="{Binding CanClose,Converter={StaticResource BooleanToVisibilityConverter}}" DockPanel.Dock="Right" Background="Transparent" Padding="35" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="90" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="{StaticResource TangoDarkForegroundBrush}" /> + </Grid> </touch:TouchButton> </DataTemplate> </touch:TouchPanel.NotificationTemplate> diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs index e371708e3..992323c6d 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs @@ -96,6 +96,11 @@ namespace Tango.Integration.Operation event EventHandler<PrintingEventArgs> PrintingCompleted; /// <summary> + /// Occurs when a printing process has ended. + /// </summary> + event EventHandler<PrintingEventArgs> PrintingEnded; + + /// <summary> /// Occurs when the machine operator has detected that a job is in progress after connecting to the machine. /// </summary> event EventHandler<ResumingJobEventArgs> ResumingJob; diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index e170b2fb8..d49dcc53c 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -164,6 +164,11 @@ namespace Tango.Integration.Operation public event EventHandler<PrintingEventArgs> PrintingAborted; /// <summary> + /// Occurs when a printing process has ended. + /// </summary> + public event EventHandler<PrintingEventArgs> PrintingEnded; + + /// <summary> /// Occurs when the machine operator has detected that a job is in progress after connecting to the machine. /// </summary> public event EventHandler<ResumingJobEventArgs> ResumingJob; @@ -812,6 +817,7 @@ namespace Tango.Integration.Operation { var result = await SendRequest<AbortJobRequest, AbortJobResponse>(new AbortJobRequest()); PrintingAborted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); handler.RaiseCanceled(); } catch (Exception ex) @@ -850,6 +856,7 @@ namespace Tango.Integration.Operation if (!handler.IsCanceled) { PrintingFailed?.Invoke(this, new PrintingFailedEventArgs(handler, originalJob, ex)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); handler.RaiseFailed(ex); LogRequestFailed(request, ex); } @@ -862,6 +869,7 @@ namespace Tango.Integration.Operation { Status = MachineStatuses.ReadyToDye; PrintingCompleted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); handler.RaiseCompleted(); }); @@ -1020,6 +1028,7 @@ namespace Tango.Integration.Operation if (!handler.IsCanceled) { PrintingFailed?.Invoke(this, new PrintingFailedEventArgs(handler, handler.Job, ex)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, handler.Job)); handler.RaiseFailed(ex); LogRequestFailed(request, ex); } @@ -1034,6 +1043,7 @@ namespace Tango.Integration.Operation { Status = MachineStatuses.ReadyToDye; PrintingCompleted?.Invoke(this, new PrintingEventArgs(handler, handler.Job)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, handler.Job)); handler.RaiseCompleted(); } else @@ -1044,6 +1054,7 @@ namespace Tango.Integration.Operation }, () => { PrintingAborted?.Invoke(this, new PrintingEventArgs(handler, handler.Job)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, handler.Job)); Status = MachineStatuses.ReadyToDye; handler.RaiseCanceled(); }); @@ -1275,6 +1286,7 @@ namespace Tango.Integration.Operation { var result = await SendRequest<AbortJobRequest, AbortJobResponse>(new AbortJobRequest()); PrintingAborted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); handler.RaiseCanceled(); } catch (Exception ex) @@ -1350,6 +1362,7 @@ namespace Tango.Integration.Operation if (!handler.IsCanceled) { PrintingFailed?.Invoke(this, new PrintingFailedEventArgs(handler, originalJob, ex)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); handler.RaiseFailed(ex); LogRequestFailed(request, ex); } @@ -1362,6 +1375,7 @@ namespace Tango.Integration.Operation { Status = MachineStatuses.ReadyToDye; PrintingCompleted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); handler.RaiseCompleted(); }); }); @@ -1532,6 +1546,7 @@ namespace Tango.Integration.Operation { var result = await SendRequest<StubAbortJobRequest, StubAbortJobResponse>(new StubAbortJobRequest()); PrintingAborted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); handler.RaiseCanceled(); } catch (Exception ex) @@ -1569,6 +1584,7 @@ namespace Tango.Integration.Operation if (!handler.IsCanceled) { PrintingFailed?.Invoke(this, new PrintingFailedEventArgs(handler, originalJob, ex)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); handler.RaiseFailed(ex); LogRequestFailed(request, ex); } @@ -1581,6 +1597,7 @@ namespace Tango.Integration.Operation { Status = MachineStatuses.ReadyToDye; PrintingCompleted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); + PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, originalJob)); handler.RaiseCompleted(); }); diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.xaml index 329fef5cb..da8580488 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchAutoComplete.xaml @@ -104,7 +104,7 @@ <components:Ripple RippleBrush="{StaticResource TangoRippleDarkBrush}" RippleFactor="15"> <Grid> <TextBox Foreground="{TemplateBinding Foreground}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="0 0 0 4" CaretBrush="{StaticResource TangoPrimaryAccentBrush}" FocusVisualStyle="{x:Null}" x:Name="PART_TextBox" Text="{Binding RelativeSource={RelativeSource AncestorType=local:TouchAutoComplete},Path=Text,UpdateSourceTrigger=PropertyChanged}" BorderThickness="0" Background="Transparent"></TextBox> - <TextBlock IsHitTestVisible="False" Text="{TemplateBinding Watermark}" Foreground="{StaticResource TangoTextWatermarkBrush}"> + <TextBlock IsHitTestVisible="False" Text="{TemplateBinding Watermark}" Foreground="{StaticResource TangoTextWatermarkBrush}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> <TextBlock.Style> <Style TargetType="TextBlock"> <Setter Property="Visibility" Value="Hidden"></Setter> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.xaml index 4fd2e9f8e..d097aa2bb 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.xaml @@ -38,7 +38,7 @@ <ItemsControl x:Name="PART_ItemsControl" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Notifications}"> <ItemsControl.ItemTemplate> <DataTemplate> - <Border Background="{StaticResource TangoNotificationBackgroundBrush}" BorderBrush="{StaticResource TangoNotificationBorderBrush}" BorderThickness="0 0 0 5"> + <Border Background="{StaticResource TangoNotificationBackgroundBrush}" BorderBrush="{StaticResource TangoNotificationBorderBrush}" BorderThickness="0 0 0 0"> <i:Interaction.Triggers> <i:EventTrigger EventName="PreviewMouseUp"> <i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNotificationBar},Path=NotificationPressedCommand}" /> @@ -53,7 +53,7 @@ </Border> </Border> - <Grid x:Name="PART_NotificationCounterGrid" Canvas.Left="85" Canvas.Top="45" Width="32" Height="32" HorizontalAlignment="Left" VerticalAlignment="Bottom" IsHitTestVisible="False"> + <Grid x:Name="PART_NotificationCounterGrid" Canvas.Left="41" Canvas.Top="19" Width="24" Height="24" HorizontalAlignment="Left" VerticalAlignment="Bottom" IsHitTestVisible="False"> <Grid> <Grid.Style> <Style TargetType="Grid"> @@ -67,7 +67,7 @@ </Grid.Style> <Ellipse Fill="White" StrokeThickness="1" Stroke="{StaticResource TangoPrimaryAccentBrush}"> </Ellipse> - <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNotificationBar},Path=Notifications.Count}"></TextBlock> + <TextBlock HorizontalAlignment="Center" FontSize="12" VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNotificationBar},Path=Notifications.Count}"></TextBlock> </Grid> </Grid> </Canvas> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs index 8dc67aa4c..777e53ed0 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs @@ -74,8 +74,17 @@ namespace Tango.Touch.Controls public int CaretIndex { - get { return _text_box.CaretIndex; } - set { _text_box.CaretIndex = value; } + get + { + return _text_box != null ? _text_box.CaretIndex : 0; + } + set + { + if (_text_box != null) + { + _text_box.CaretIndex = value; + } + } } static TouchTextBox() diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml index 38e03cb0a..26926e43b 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml @@ -44,13 +44,13 @@ <Color x:Key="TangoRedColor">#FF6767</Color> <Color x:Key="TangoSuccessColor">#56da6c</Color> - <Color x:Key="TangoWarningColor">#FF7505</Color> + <Color x:Key="TangoWarningColor">#EE9523</Color> <Color x:Key="TangoErrorColor">#fa1555</Color> <Color x:Key="TangoNotificationBarMaskColor">#96000000</Color> <Color x:Key="TangoNotificationBarBottomBorderColor">Silver</Color> <Color x:Key="TangoNotificationBorderColor">#757373</Color> - <Color x:Key="TangoNotificationBarBackgroundColor">#202020</Color> + <Color x:Key="TangoNotificationBarBackgroundColor">#C3F2F5FA</Color> <!--Brushes--> <SolidColorBrush x:Key="TangoPrimaryBackgroundBrush" Color="{StaticResource TangoPrimaryBackgroundColor}"></SolidColorBrush> @@ -103,8 +103,8 @@ <SolidColorBrush x:Key="TangoNotificationBarBackgroundBrush" Color="{StaticResource TangoNotificationBarBackgroundColor}"></SolidColorBrush> <LinearGradientBrush x:Key="TangoNotificationBackgroundBrush" StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Color="Black"/> - <GradientStop Color="Black" Offset="1"/> + <GradientStop Color="White"/> + <GradientStop Color="White" Offset="1"/> </LinearGradientBrush> <SolidColorBrush x:Key="TangoKeyboardBackground" Color="#CE979797" /> |
