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

Last change on this file since 1834 was 1834, checked in by matkovic, 11 years ago
  • Two different intersectPoint implemented
  • presentation now not visible if not available
  • Style changes
  • Icons updated
File size: 1.9 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;
8
9namespace WorkspaceManager.View.Converter
10{
11    class ViewStateConverter : IValueConverter
12    {
13        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
14        {
15            PluginViewState state = (PluginViewState)value;
16            String caption = (String)parameter;
17            if (caption == "PresentationPanel" && state == PluginViewState.Presentation)
18                return Visibility.Visible;
19
20            if (caption == "PresentationOption" && state == PluginViewState.Presentation)
21                return Visibility.Collapsed;
22            else if (caption == "PresentationOption" && state != PluginViewState.Presentation)
23                return Visibility.Visible;
24
25            if (caption == "SettingsPanel" && state == PluginViewState.Setting)
26                return Visibility.Visible;
27
28            if (caption == "LogPanel" && state == PluginViewState.Log)
29                return Visibility.Visible;
30
31            if (caption == "DataPanel" && state == PluginViewState.Data)
32                return Visibility.Visible;
33
34            if(caption == "OptionPanel" && state == PluginViewState.Min)
35                return Visibility.Collapsed;
36            else if(caption == "OptionPanel" && state != PluginViewState.Min)
37                return Visibility.Visible;
38
39            if (caption == null && state == PluginViewState.Min)
40                return Visibility.Visible;
41
42            return Visibility.Collapsed;
43        }
44
45        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
46        {
47            throw new NotImplementedException();
48        }
49    }
50}
Note: See TracBrowser for help on using the repository browser.