markus / KCOM / Common / Converter / PDFVisibleConverter.cs @ 87542f92
이력 | 보기 | 이력해설 | 다운로드 (1022 Bytes)
1 | 787a4489 | KangIngu | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Globalization; |
||
4 | using System.Linq; |
||
5 | using System.Text; |
||
6 | using System.Windows; |
||
7 | using System.Windows.Data; |
||
8 | |||
9 | namespace KCOM.Common.Converter |
||
10 | { |
||
11 | public class PDFVisibleConverter : IValueConverter |
||
12 | { |
||
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) |
||
14 | { |
||
15 | if (value != null) |
||
16 | { |
||
17 | if (value is string) |
||
18 | { |
||
19 | if (value.ToString().ToLower().Contains(".pdf")) |
||
20 | { |
||
21 | return Visibility.Visible; |
||
22 | } |
||
23 | else |
||
24 | { |
||
25 | return Visibility.Collapsed; |
||
26 | } |
||
27 | } |
||
28 | } |
||
29 | return Visibility.Collapsed; |
||
30 | } |
||
31 | |||
32 | |||
33 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) |
||
34 | { |
||
35 | throw new NotSupportedException(); |
||
36 | } |
||
37 | } |
||
38 | } |