diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-05 18:54:19 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-05 18:54:19 +0300 |
| commit | 9c78856e51418bebe66095fecf4c39d9b225e961 (patch) | |
| tree | a0e2b7354a4805448acf229168dae56b6f3b1cd6 /Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications | |
| parent | b1b9ec165cc318caed1fc9b5919a03029b6cb29e (diff) | |
| download | Tango-9c78856e51418bebe66095fecf4c39d9b225e961.tar.gz Tango-9c78856e51418bebe66095fecf4c39d9b225e961.zip | |
Working on PPC !
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications')
3 files changed, 79 insertions, 77 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 7f97f2a49..dbaafa6bb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -6,109 +6,44 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Media; -using FontAwesome.WPF; using Tango.PPC.Common.Notifications; +using Tango.Core; namespace Tango.PPC.UI.Notifications { - public class DefaultNotificationProvider : INotificationProvider + public class DefaultNotificationProvider : ExtendedObject, INotificationProvider { - public ObservableCollection<TaskItem> TaskItems + private MessageBoxVM _currentMessageBox; + public MessageBoxVM CurrentMessageBox { - get - { - throw new NotImplementedException(); - } + get { return _currentMessageBox; } + private set { _currentMessageBox = value; RaisePropertyChangedAuto(); } } - public TaskItem CurrentTaskItem + public bool HasMessageBox { get { - throw new NotImplementedException(); + return CurrentMessageBox != null; } } - public bool HasTaskItems - { - get - { - throw new NotImplementedException(); - } - } - - public void PopTaskItem(TaskItem taskItem) - { - throw new NotImplementedException(); - } - - public void PushTaskItem(TaskItem taskItem) - { - throw new NotImplementedException(); - } - - public TaskItem PushTaskItem(string message) - { - throw new NotImplementedException(); - } - - public void ShowError(string message) - { - throw new NotImplementedException(); - } - - public void ShowInfo(string message) - { - throw new NotImplementedException(); - } - - public bool? ShowMessageBox(FontAwesomeIcon icon, Brush iconColor, string message, bool hasCancel) - { - throw new NotImplementedException(); - } - - public void ShowModalDialog<View, VM>(Action<VM> onAccept, Action onCancel) - where View : FrameworkElement - where VM : DialogViewVM - { - throw new NotImplementedException(); - } - - public void ShowModalDialog<VM>(Action<VM> onAccept, Action onCancel) where VM : DialogViewVM - { - throw new NotImplementedException(); - } - - public void ShowModalDialog<VM, View>(VM vm, Action<VM> onAccept, Action onCancel) - where VM : DialogViewVM - where View : FrameworkElement - { - throw new NotImplementedException(); - } - - public void ShowModalDialog<VM, View>(VM vm, View view, Action<VM> onAccept, Action onCancel) - where VM : DialogViewVM - where View : FrameworkElement - { - throw new NotImplementedException(); - } - - public void ShowModalDialog<VM>(Action<VM> onAccept) where VM : DialogViewVM + public Task ShowError(string message) { throw new NotImplementedException(); } - public bool ShowQuestion(string message) + public Task ShowInfo(string message) { throw new NotImplementedException(); } - public string ShowTextInput(string message, string hint, string defaultResponse = null) + public Task ShowWarning(string message) { throw new NotImplementedException(); } - public void ShowWarning(string message) + public Task<bool> ShowQuestion(string message) { throw new NotImplementedException(); } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml new file mode 100644 index 000000000..a699902b8 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml @@ -0,0 +1,38 @@ +<UserControl x:Class="Tango.PanelPC.UI.Notifications.MessageBox" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:fa="http://schemas.fontawesome.io/icons/" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:vm="clr-namespace:Tango.PPC.Common.Notifications;assembly=Tango.PPC.Common" + xmlns:local="clr-namespace:Tango.PanelPC.UI.Notifications" + mc:Ignorable="d" + d:DesignHeight="200" d:DesignWidth="500" d:DataContext="{d:DesignInstance vm:MessageBoxVM,IsDesignTimeCreatable=False}"> + <Grid> + <Border Background="{StaticResource TangoPrimaryBackgroundBrush}" CornerRadius="10" Margin="10" Padding="10"> + <Border.Effect> + <DropShadowEffect BlurRadius="10" /> + </Border.Effect> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="17*"/> + <ColumnDefinition Width="75*"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="1*" /> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + + <Image Source="{Binding Icon,FallbackValue='/Images/MessageBox Icons/information.png'}" Margin="10" /> + <TextBlock x:Name="lbMessage" Grid.Column="1" TextWrapping="Wrap" VerticalAlignment="Center" Margin="10,50,10,55" Height="16"></TextBlock> + + <UniformGrid Grid.Column="1" Grid.Row="1" HorizontalAlignment="Right" Rows="1" Width="220"> + <touch:TouchButton x:Name="btnCancel" Margin="2" Style="{StaticResource TangoFlatButtonTextOnly}">CANCEL</touch:TouchButton> + <touch:TouchButton x:Name="btnOK" Margin="2" Style="{StaticResource TangoFlatButtonTextOnly}">OK</touch:TouchButton> + </UniformGrid> + </Grid> + </Border> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml.cs new file mode 100644 index 000000000..a13cfe81f --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/MessageBox.xaml.cs @@ -0,0 +1,29 @@ +using FontAwesome.WPF; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PanelPC.UI.Notifications +{ + /// <summary> + /// Interaction logic for MessageBox.xaml + /// </summary> + public partial class MessageBox : UserControl + { + public MessageBox() + { + InitializeComponent(); + } + } +} |
