source: trunk/CrypPlugins/WorkspaceManager/View/Converter/ViewStateConverter.cs @ 2803

Last change on this file since 2803 was 2803, checked in by kopal, 11 years ago
File size: 1.8 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Data;
6using WorkspaceManager.View.Container;
7using System.Windows;
8using WorkspaceManager.Model;
9
10namespace WorkspaceManager.View.Converter
11{
12    class ViewStateConverter : IValueConverter
13    {
14        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
15        {
16            PluginViewState state = (PluginViewState)value;
17            String caption = (String)parameter;
18            if (caption == "PresentationPanel" && state == PluginViewState.Presentation)
19                return Visibility.Visible;
20
21            //if (caption == "PresentationOption" && state == PluginViewState.Presentation)
22            //    return Visibility.Collapsed;
23            //else if (caption == "PresentationOption" && state != PluginViewState.Presentation)
24            //    return Visibility.Visible;
25
26            if (caption == "SettingsPanel" && state == PluginViewState.Setting)
27                return Visibility.Visible;
28
29            if (caption == "LogPanel" && state == PluginViewState.Log)
30                return Visibility.Visible;
31
32            if (caption == "DataPanel" && state == PluginViewState.Data)
33                return Visibility.Visible;
34
35            if(caption == "OptionPanel" && state != PluginViewState.Min)
36                return Visibility.Visible;
37
38            //if (caption == null && state == PluginViewState.Min)
39            //    return Visibility.Visible;
40
41            return Visibility.Collapsed;
42        }
43
44        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
45        {
46            throw new NotImplementedException();
47        }
48    }
49}
Note: See TracBrowser for help on using the repository browser.