private async void menuitemDeviceGroupDeployments_Click(object sender, RoutedEventArgs e)
        {
            var model = gridDeviceGroups.SelectedItem as DeviceGroupModel;
            List <DeploymentModel> deploymentModels = new List <DeploymentModel>();

            if (model == null)
            {
                return;
            }

            Cursor = Cursors.Wait;
            try
            {
                ModelManager modelManager = ModelManager.GetInstance();
                deploymentModels = await modelManager.GetDeploymentModels(CurrentTenantModel, model);
            }
            finally
            {
                Cursor = null;
            }

            var dialog = new DeploymentsWindow();

            dialog.Owner  = this;
            dialog.Title += $" - {model.Product},{model.DeviceGroup}";
            dialog.CurrentTenantModel     = this.CurrentTenantModel;
            dialog.DeploymentModels       = deploymentModels;
            dialog.SelectDeviceGroupModel = model;


            var dialogResult = dialog.ShowDialog();

            dialog = null;
        }
예제 #2
0
        private async void NotificationChangeDeployment(object sender, EventArgs e)
        {
            ModelManager modelMgr = ModelManager.GetInstance();

            Console.Write("called NotificationChangeDeployment()");

            List <DeploymentModel> deploymentModels = await modelMgr.GetDeploymentModels(CurrentTenantModel, this.SelectDeviceGroupModel);

            this.gridDeployments.ItemsSource = deploymentModels;
            var viewDeployments = CollectionViewSource.GetDefaultView(this.gridDeployments.ItemsSource);

            this.gridDeployments.Columns[0].SortDirection = ListSortDirection.Descending;
            viewDeployments.SortDescriptions.Add(new SortDescription("CurrentDeploymentDate", ListSortDirection.Descending));
            this.gridDeployments.Items.Refresh();
        }