private void OpenVerticalOptionSelecter() { // MaximizeShell(); int arrLength = (ShellViewModel.VerticalOptionData.Length - 3) / 2; string[] options = new string[arrLength]; string[] actions = new string[arrLength]; Array.Copy(ShellViewModel.VerticalOptionData, 3, options, 0, arrLength); Array.Copy(ShellViewModel.VerticalOptionData, 3 + arrLength, actions, 0, arrLength); dynamicCanvas.Dispatcher.Invoke((Action)delegate { verticalOptionSelecter = new VerticalOptionSelecter(options, actions); dynamicCanvas.Children.Add(verticalOptionSelecter); verticalOptionSelecter.Visibility = Visibility.Visible; Canvas.SetLeft(verticalOptionSelecter, Double.Parse(ShellViewModel.VerticalOptionData[1])); Canvas.SetTop(verticalOptionSelecter, Double.Parse(ShellViewModel.VerticalOptionData[2])); }); }
private void CloseVerticalOptionSelecter() { this.Dispatcher.Invoke((Action)delegate { dynamicCanvas.Children.Remove(verticalOptionSelecter); verticalOptionSelecter = null; }); }