SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
LabViewNavButton.xaml.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Windows;
6 using System.Windows.Controls;
7 using System.Windows.Data;
8 using System.Windows.Documents;
9 using System.Windows.Input;
10 using System.Windows.Media;
11 using System.Windows.Media.Imaging;
12 using System.Windows.Navigation;
13 using System.Windows.Shapes;
14 
15 namespace SeciControls
16 {
20  public partial class LabViewNavButton : UserControl
21  {
22  private Boolean _isLabviewBtnExpanded = false;
23 
24  public event EventHandler OnVIsClicked;
25  public event EventHandler OnAddVIClicked;
26  public event EventHandler OnRemoveVIClicked;
27  public event EventHandler OnConfigureVIClicked;
28  public event EventHandler OnEditTabsClicked;
29  public event EventHandler OnConfigureBlocksClicked;
30  public event EventHandler OnDisplayBlocksClicked;
31 
32  public static DependencyProperty DefaultNameProperty;
33 
35  {
36  DefaultNameProperty = DependencyProperty.Register("DefaultName", typeof(String),
37  typeof(LabViewNavButton));
38  }
39 
40  public String DefaultName
41  {
42  get { return GetValue(DefaultNameProperty).ToString(); }
43  set { SetValue(DefaultNameProperty, value); }
44  }
45 
46  public void SetText(String text)
47  {
48  btnLabview.Content = text;
49  }
50 
52  {
53  InitializeComponent();
54  }
55 
56  public void SetExpansionToDefault()
57  {
59  {
60  btnLabview_Expanded(null, null);
61  }
62  else
63  {
64  btnLabview_Collapsed(null, null);
65  }
66  }
67 
68  public void SetLinkVisability(Boolean show)
69  {
70  if (show)
71  {
72  lnkAddVI.IsEnabled = true;
73  lnkRemoveVI.IsEnabled = true;
74  lnkConfigureVI.IsEnabled = true;
75  lnkEditTabs.IsEnabled = true;
76  }
77  else
78  {
79  lnkAddVI.IsEnabled = false;
80  lnkRemoveVI.IsEnabled = false;
81  lnkConfigureVI.IsEnabled = false;
82  lnkEditTabs.IsEnabled = false;
83  }
84  }
85 
86  private void btnLabview_Collapsed(object sender, RoutedEventArgs e)
87  {
88  if (sender != null)
89  {
90  _isLabviewBtnExpanded = false;
91  }
92 
93  txtAddVI.Visibility = Visibility.Collapsed;
94  txtRemoveVI.Visibility = Visibility.Collapsed;
95  txtConfigureVI.Visibility = Visibility.Collapsed;
96  txtEditTabs.Visibility = Visibility.Collapsed;
97  txtConfigureBlocks.Visibility = Visibility.Collapsed;
98  txtDisplayBlocks.Visibility = Visibility.Collapsed;
99  }
100 
101  private void btnLabview_Expanded(object sender, RoutedEventArgs e)
102  {
103  txtAddVI.Visibility = Visibility.Visible;
104  txtRemoveVI.Visibility = Visibility.Visible;
105  txtConfigureVI.Visibility = Visibility.Visible;
106  txtEditTabs.Visibility = Visibility.Visible;
107  txtConfigureBlocks.Visibility = Visibility.Visible;
108  txtDisplayBlocks.Visibility = Visibility.Visible;
109  _isLabviewBtnExpanded = true;
110  }
111 
112  private void btnLabview_Click(object sender, RoutedEventArgs e)
113  {
114  // setIndicator(sender);
115 
116  if (OnVIsClicked != null)
117  {
118  OnVIsClicked(sender, e);
119  }
120  }
121 
122  private void lnkAddVI_Click(object sender, RoutedEventArgs e)
123  {
124  if (OnAddVIClicked != null)
125  {
126  OnAddVIClicked(sender, e);
127  }
128  }
129 
130  private void lnkRemoveVI_Click(object sender, RoutedEventArgs e)
131  {
132  if (OnRemoveVIClicked != null)
133  {
134  OnRemoveVIClicked(sender, e);
135  }
136  }
137 
138  private void lnkConfigureVI_Click(object sender, RoutedEventArgs e)
139  {
140  if (OnConfigureVIClicked != null)
141  {
142  OnConfigureVIClicked(sender, e);
143  }
144  }
145 
146  private void lnkEditTabs_Click(object sender, RoutedEventArgs e)
147  {
148  if (OnEditTabsClicked != null)
149  {
150  OnEditTabsClicked(sender, e);
151  }
152  }
153 
154  private void lnkConfigureBlocks_Click(object sender, RoutedEventArgs e)
155  {
156  if (OnConfigureBlocksClicked != null)
157  {
158  OnConfigureBlocksClicked(sender, e);
159  }
160  }
161 
162  private void lnkDisplayBlocks_Click(object sender, RoutedEventArgs e)
163  {
164  if (OnDisplayBlocksClicked != null)
165  {
166  OnDisplayBlocksClicked(sender, e);
167  }
168  }
169  }
170 }
void lnkConfigureBlocks_Click(object sender, RoutedEventArgs e)
void lnkRemoveVI_Click(object sender, RoutedEventArgs e)
void btnLabview_Collapsed(object sender, RoutedEventArgs e)
void lnkEditTabs_Click(object sender, RoutedEventArgs e)
void lnkConfigureVI_Click(object sender, RoutedEventArgs e)
void lnkAddVI_Click(object sender, RoutedEventArgs e)
void btnLabview_Expanded(object sender, RoutedEventArgs e)
static DependencyProperty DefaultNameProperty
void lnkDisplayBlocks_Click(object sender, RoutedEventArgs e)
Interaction logic for LabViewNavButton.xaml
void btnLabview_Click(object sender, RoutedEventArgs e)