private void CreateViewPanels() { if ((this.PanelSet != null) && (this.PanelSet.Count > 0)) { foreach (UIElement element in this.PanelSet.Values) { this.windowContent.Children.Remove(element); } } this.PanelSet = new Dictionary <MainViewState, UIElement>(); UIElement element2 = new ConnectedPanel(); this.PanelSet[MainViewState.UnconnectedState] = new UnconnectedPanel(); this.PanelSet[MainViewState.FirstConnectPanel] = new FirstConnectPanel(); this.PanelSet[MainViewState.LockedPanel] = new DeviceLockedPanel(); this.PanelSet[MainViewState.PCTab] = element2; this.PanelSet[MainViewState.PhoneTab] = element2; this.PanelSet[MainViewState.WebTab] = element2; foreach (UIElement element3 in this.PanelSet.Values.Distinct <UIElement>()) { if (element3 != null) { element3.Visibility = Visibility.Hidden; this.windowContent.Children.Add(element3); } } }
private void OnDisconnect() { if (this.InvokeRequired) { this.Invoke(new Action(() => { OnDisconnect(); })); return; } ConnectButton.Text = "Connect"; ConnectButton.Enabled = true; IpcDisconnectedPanel.Hide(); DisconnectedPanel.Show(); ConnectedPanel.Hide(); }
private void OnConnect() { if (this.InvokeRequired) { this.Invoke(new Action(() => { OnConnect(); })); return; } IpcDisconnectedPanel.Hide(); ConnectedPanel.Show(); DisconnectedPanel.Hide(); }