{"action":"closed","issue":{"url":"https://api.github.com/repos/WildGums/Orc.Wizard/issues/14","repository_url":"https://api.github.com/repos/WildGums/Orc.Wizard","labels_url":"https://api.github.com/repos/WildGums/Orc.Wizard/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/WildGums/Orc.Wizard/issues/14/comments","events_url":"https://api.github.com/repos/WildGums/Orc.Wizard/issues/14/events","html_url":"https://github.com/WildGums/Orc.Wizard/issues/14","id":169791166,"number":14,"title":"ViewModel warnings aren't shown","user":{"login":"sindilevich","id":475916,"avatar_url":"https://avatars.githubusercontent.com/u/475916?v=3","gravatar_id":"","url":"https://api.github.com/users/sindilevich","html_url":"https://github.com/sindilevich","followers_url":"https://api.github.com/users/sindilevich/followers","following_url":"https://api.github.com/users/sindilevich/following{/other_user}","gists_url":"https://api.github.com/users/sindilevich/gists{/gist_id}","starred_url":"https://api.github.com/users/sindilevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindilevich/subscriptions","organizations_url":"https://api.github.com/users/sindilevich/orgs","repos_url":"https://api.github.com/users/sindilevich/repos","events_url":"https://api.github.com/users/sindilevich/events{/privacy}","received_events_url":"https://api.github.com/users/sindilevich/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-08-07T11:00:29Z","updated_at":"2016-08-10T07:42:30Z","closed_at":"2016-08-10T07:42:30Z","body":"When adding a business rule/field _warning_ to a ViewModel, it is not displayed in any way in the wizard, _if there are no business rule/field errors_. As an example, a field _error_ would mark the field red and display an errors-and-warnings status bar at the top of the page.\r\n\r\nHandling of the field warning is as follows:\r\n``` C#\r\ninternal class MyWizardPageViewModel : WizardPageViewModelBase<MyWizardPage>\r\n{\r\n\tpublic MyWizardPageViewModel(MyWizardPage wizardPage) : base(wizardPage)\r\n\t{\r\n\t}\r\n\r\n\t[ViewModelToModel]\r\n\t[Range(ushort.MinValue, ushort.MaxValue, ErrorMessageResourceName = nameof(Resources.field_value_out_of_range_validation_error_message), ErrorMessageResourceType = typeof(Resources))]\r\n\tpublic string Port { get; set; }\r\n\r\n\tprotected override void ValidateFields(List<IFieldValidationResult> validationResults)\r\n\t{\r\n\t\tSystem.ComponentModel.DataAnnotations.ValidationResult localPortIsAvailable = NetworkRelatedFieldValidation.LocalPortIsAvailable(Port, new System.ComponentModel.DataAnnotations.ValidationContext(this));\r\n\r\n\t\tif (localPortIsAvailable != System.ComponentModel.DataAnnotations.ValidationResult.Success)\r\n\t\t{\r\n\t\t\tvalidationResults.Add(FieldValidationResult.CreateWarning(() => Port, \"Oh NO!!!\"));\r\n\t\t}\r\n\t}\r\n}\r\n```"}}
{"actor":{"display_login":"sindilevich"}}