aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2017-12-15 03:34:09 +0200
committerRoy <roy.mail.net@gmail.com>2017-12-15 03:34:09 +0200
commit27fe2f3f63191ecefbb00f16acf2b8b089a30d83 (patch)
treed861255d3c0596b321c213b1ed64225bfed434dd /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common
parentad35c9c2df0001157ea13312382f3cdfdad67f06 (diff)
downloadTango-27fe2f3f63191ecefbb00f16acf2b8b089a30d83.tar.gz
Tango-27fe2f3f63191ecefbb00f16acf2b8b089a30d83.zip
Added Login.
Implemented message boxes through notification provider. Implemented VM auto validation using data annotation.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs17
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj1
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs18
4 files changed, 35 insertions, 3 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml
index 3896347fe..b248a4aec 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/MdiContainerControl.xaml
@@ -7,7 +7,7 @@
xmlns:local="clr-namespace:Tango.MachineStudio.Common.Controls"
xmlns:converters="clr-namespace:Tango.MachineStudio.Common.Converters"
mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300" Background="White">
+ d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<converters:PointToMarginConverter x:Key="PointToMarginConverter"></converters:PointToMarginConverter>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs
index e14df21ba..9e13713d0 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs
@@ -5,13 +5,26 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
+using System.Windows.Media;
namespace Tango.MachineStudio.Common.Notifications
{
public interface INotificationProvider
{
- bool ShowDialog<T>(PackIconKind icon, String title, object context) where T : FrameworkElement;
+ bool? ShowModalWindow(Window window);
- bool ShowDialog(PackIconKind icon, String title, FrameworkElement content, object context);
+ bool ShowModalWindow<T>(PackIconKind icon, String title, object context) where T : FrameworkElement;
+
+ bool ShowModalWindow(PackIconKind icon, String title, FrameworkElement content, object context);
+
+ bool? ShowDialog(PackIconKind icon, Brush iconColor, String message, bool hasCancel);
+
+ void ShowInfo(String message);
+
+ void ShowWarnning(String message);
+
+ void ShowError(String message);
+
+ bool ShowQuestion(String message);
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj
index c94e6fbdc..23d0f7b76 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj
@@ -53,6 +53,7 @@
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="ValidationRules\Required.cs" />
<Page Include="Controls\MdiContainerControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs
new file mode 100644
index 000000000..84f274965
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/ValidationRules/Required.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+
+namespace Tango.MachineStudio.Common.ValidationRules
+{
+ public class Required : ValidationRule
+ {
+ public override ValidationResult Validate(object value, CultureInfo cultureInfo)
+ {
+ return new ValidationResult(!String.IsNullOrWhiteSpace(value.ToStringSafe()), "Required");
+ }
+ }
+}