aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-04-22 02:08:25 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-04-22 02:08:25 +0300
commit499e0a03bb41e2330a47ccca83e6e6dfe7c5a634 (patch)
tree5d5d7866e33c1ae8a55cfa67be65848a25be7ab4 /Software/Visual_Studio/Tango.SharedUI
parent97a784b6ce43960bdb92465b08f26d3562a4f202 (diff)
downloadTango-499e0a03bb41e2330a47ccca83e6e6dfe7c5a634.tar.gz
Tango-499e0a03bb41e2330a47ccca83e6e6dfe7c5a634.zip
Scripting.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Converters/EnumToIntConverter.cs23
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj3
2 files changed, 25 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToIntConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToIntConverter.cs
new file mode 100644
index 000000000..43caff16c
--- /dev/null
+++ b/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToIntConverter.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace Tango.SharedUI.Converters
+{
+ public class EnumToIntConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (int)value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return Enum.ToObject(targetType, value);
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
index 546dbf3bb..885e7c9b0 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
+++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj
@@ -107,6 +107,7 @@
<Compile Include="Converters\EmptyStringToNullConverter.cs" />
<Compile Include="Converters\EnumToBooleanConverter.cs" />
<Compile Include="Converters\EnumToDescriptionConverter.cs" />
+ <Compile Include="Converters\EnumToIntConverter.cs" />
<Compile Include="Converters\EnumToItemsSourceConverter.cs" />
<Compile Include="Converters\EnumToVisibilityConverter.cs" />
<Compile Include="Converters\EnumToXamlVectorConverter.cs" />
@@ -250,7 +251,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file