private void OnCreate() { var createGuardZoneEventArg = new CreateGKGuardZoneEventArg(); ServiceFactory.Events.GetEvent<CreateGKGuardZoneEvent>().Publish(createGuardZoneEventArg); if (createGuardZoneEventArg.Zone != null) GKPlanExtension.Instance.RewriteItem(IElementZone, createGuardZoneEventArg.Zone); if (!createGuardZoneEventArg.Cancel) Close(true); }
void OnCreateNew() { var createZoneEventArg = new CreateGKGuardZoneEventArg(); ServiceFactory.Events.GetEvent<CreateGKGuardZoneEvent>().Publish(createZoneEventArg); if (createZoneEventArg.Zone != null) { var deviceGuardZone = new GKDeviceGuardZone(); deviceGuardZone.GuardZone = createZoneEventArg.Zone; TargetZones.Add(new DeviceGuardZoneViewModel(deviceGuardZone, Device)); if (TargetZones.Count == 1) { SaveCommand.Execute(); } } }
void OnCreateNew() { var createGuardZoneEventArg = new CreateGKGuardZoneEventArg(); ServiceFactory.Events.GetEvent<CreateGKGuardZoneEvent>().Publish(createGuardZoneEventArg); if (createGuardZoneEventArg.Zone != null) { SourceZones.Add(createGuardZoneEventArg.Zone); SelectedSourceZone = SourceZones.FirstOrDefault(x => x == createGuardZoneEventArg.Zone); } }