public AlertDetailsControlViewModel( EmulationAlert alert, AlertDetailsControlClosedEventHandler alertDetailsControlClosed, ISystemProcessClient systemProcessClient) { this.Alert = alert; this.EssentialsSectionProperties = new ObservableCollection <AzureResourceProperty>(new List <AzureResourceProperty>() { new AzureResourceProperty("Subscription id", this.Alert.ResourceIdentifier.SubscriptionId), new AzureResourceProperty("Resource group", this.Alert.ResourceIdentifier.ResourceGroupName), new AzureResourceProperty("Resource type", this.Alert.ResourceIdentifier.ResourceType.ToString()), new AzureResourceProperty("Resource name", this.Alert.ResourceIdentifier.ResourceName) }); List <DisplayableAlertProperty> displayableAlertProperties = this.Alert.ContractsAlert.AlertProperties.OfType <DisplayableAlertProperty>() .Where(prop => this.supportedPropertiesTypes.Contains(prop.Type)) .OrderBy(prop => prop.Order) .ThenBy(prop => prop.PropertyName) .ToList(); this.DisplayableProperties = new ObservableCollection <DisplayableAlertProperty>(displayableAlertProperties); this.CloseControlCommand = new CommandHandler(() => { alertDetailsControlClosed.Invoke(); }); this.systemProcessClient = systemProcessClient; }
public AlertsControlViewModel(IEmulationSmartDetectorRunner smartDetectorRunner, ISystemProcessClient systemProcessClient) { this.SmartDetectorRunner = smartDetectorRunner; this.SelectedAlert = null; this.AlertDetailsControlViewModel = null; this.systemProcessClient = systemProcessClient; this.AlertDetailsControlClosed += () => { this.SelectedAlert = null; }; }