diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-04-29 20:32:19 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-04-29 20:32:19 +0300 |
| commit | b7cb85c57561a28b5df6b21fcfe066e8d0384d2f (patch) | |
| tree | 3a73ef1898b2b1713e76440f43647d1104fd1893 /Software/Visual_Studio/Tango.SharedUI | |
| parent | 25b6658dbb640edc46254489435103c06fadd814 (diff) | |
| download | Tango-b7cb85c57561a28b5df6b21fcfe066e8d0384d2f.tar.gz Tango-b7cb85c57561a28b5df6b21fcfe066e8d0384d2f.zip | |
Events.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Converters/IsEqualToVisibilityConverter.cs | 31 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj | 3 |
2 files changed, 33 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/IsEqualToVisibilityConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/IsEqualToVisibilityConverter.cs new file mode 100644 index 000000000..846e0505f --- /dev/null +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/IsEqualToVisibilityConverter.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace Tango.SharedUI.Converters +{ + public class IsEqualToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + return value.Equals(System.Convert.ChangeType(parameter, value.GetType())) ? Visibility.Visible : Visibility.Collapsed; + } + catch + { + return Visibility.Collapsed; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj index 885e7c9b0..e4c10153c 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj +++ b/Software/Visual_Studio/Tango.SharedUI/Tango.SharedUI.csproj @@ -113,6 +113,7 @@ <Compile Include="Converters\EnumToXamlVectorConverter.cs" /> <Compile Include="Converters\FilePathToFileNameConverter.cs" /> <Compile Include="Converters\IsEqualConverter.cs" /> + <Compile Include="Converters\IsEqualToVisibilityConverter.cs" /> <Compile Include="Converters\IsNotConverter.cs" /> <Compile Include="Converters\IsNullToVisibilityConverter.cs" /> <Compile Include="Converters\IsSegmentGradientConverter.cs" /> @@ -251,7 +252,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file |
