public CloudHostedMachinePage() { InitializeComponent(); DataContext = new CloudHostedViewModel(); Carousel.RotationSpeed = Convert.ToInt32(Properties.Settings.Default.RotationSpeed); Carousel.SelectionChanged += _carouselRDPTerminals_SelectionChanged; CloudHostedViewModel viewModel = DataContext as CloudHostedViewModel; count = viewModel.NumberOfMachines; if (count > 1) { max = count / 2; min = max * -1; } }
private void StopInstance_Click(object sender, RoutedEventArgs e) { using (new WaitCursor()) { CloudHostedViewModel viewModel = DataContext as CloudHostedViewModel; if (viewModel == null) { return; } if (viewModel.SelectedRDPTerminal != null) { var item = viewModel.SelectedRDPTerminal; MainWindow mainWindow = Application.Current.MainWindow as MainWindow; mainWindow.StartStopRDPSession(item.EnvironmentId, VMAction.Stop); } } }
public EditRDPPropterties(CloudHostedViewModel viewModel) : this() { DataContext = viewModel as CloudHostedViewModel; this.Loaded += new RoutedEventHandler(EditRDPProperties_Loaded); }