{"action":"created","issue":{"url":"https://api.github.com/repos/DotNetAnalyzers/WpfAnalyzers/issues/214","repository_url":"https://api.github.com/repos/DotNetAnalyzers/WpfAnalyzers","labels_url":"https://api.github.com/repos/DotNetAnalyzers/WpfAnalyzers/issues/214/labels{/name}","comments_url":"https://api.github.com/repos/DotNetAnalyzers/WpfAnalyzers/issues/214/comments","events_url":"https://api.github.com/repos/DotNetAnalyzers/WpfAnalyzers/issues/214/events","html_url":"https://github.com/DotNetAnalyzers/WpfAnalyzers/issues/214","id":351949167,"node_id":"MDU6SXNzdWUzNTE5NDkxNjc=","number":214,"title":"WPF0007 exemption for shared validation methods.","user":{"login":"brian-reichle","id":18721383,"node_id":"MDQ6VXNlcjE4NzIxMzgz","avatar_url":"https://avatars3.githubusercontent.com/u/18721383?v=4","gravatar_id":"","url":"https://api.github.com/users/brian-reichle","html_url":"https://github.com/brian-reichle","followers_url":"https://api.github.com/users/brian-reichle/followers","following_url":"https://api.github.com/users/brian-reichle/following{/other_user}","gists_url":"https://api.github.com/users/brian-reichle/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-reichle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-reichle/subscriptions","organizations_url":"https://api.github.com/users/brian-reichle/orgs","repos_url":"https://api.github.com/users/brian-reichle/repos","events_url":"https://api.github.com/users/brian-reichle/events{/privacy}","received_events_url":"https://api.github.com/users/brian-reichle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-20T00:33:52Z","updated_at":"2018-08-20T07:06:42Z","closed_at":"2018-08-20T06:48:52Z","author_association":"NONE","body":"I often have multiple dependency properties with identical, generic, validation requirements and so tend to give them the same validation method, but this makes it impossible to satisfy WPF0007. I would like to suggest that this rule should not complain if the method is used by more than one property or if the method is defined on another class. If you want to prevent sharing these callbacks, then it might be better to have a separate set of rules to prohibit sharing callbacks so that individual projects can decide if they will permit it.\r\n\r\nShould probably give WPF0005 and WPF0006 the same exemptions.\r\n\r\n```csharp\r\n\r\npublic class Foo : Control\r\n{\r\n    public static DependencyProperty BarProperty = DependencyProperty.Register(\r\n        \"Bar\",\r\n        typeof(double),\r\n        typeof(Foo),\r\n        new FrameworkPropertyMetadata(1d),\r\n        CommonValidation.ValidateDoubleIsRealFiniteAndGreaterThanZero);\r\n\r\n    public static DependencyProperty BazProperty = DependencyProperty.Register(\r\n        \"Baz\",\r\n        typeof(double),\r\n        typeof(Foo),\r\n        new FrameworkPropertyMetadata(1d),\r\n        CommonValidation.ValidateDoubleIsRealFiniteAndGreaterThanZero);\r\n\r\n    //...\r\n}\r\n\r\ninternal static class CommonValidation\r\n{\r\n    public static bool ValidateDoubleIsRealFiniteAndGreaterThanZero(object value)\r\n    {\r\n        ...\r\n    }\r\n    // ...\r\n}\r\n"},"comment":{"url":"https://api.github.com/repos/DotNetAnalyzers/WpfAnalyzers/issues/comments/414217757","html_url":"https://github.com/DotNetAnalyzers/WpfAnalyzers/issues/214#issuecomment-414217757","issue_url":"https://api.github.com/repos/DotNetAnalyzers/WpfAnalyzers/issues/214","id":414217757,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDIxNzc1Nw==","user":{"login":"brian-reichle","id":18721383,"node_id":"MDQ6VXNlcjE4NzIxMzgz","avatar_url":"https://avatars3.githubusercontent.com/u/18721383?v=4","gravatar_id":"","url":"https://api.github.com/users/brian-reichle","html_url":"https://github.com/brian-reichle","followers_url":"https://api.github.com/users/brian-reichle/followers","following_url":"https://api.github.com/users/brian-reichle/following{/other_user}","gists_url":"https://api.github.com/users/brian-reichle/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-reichle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-reichle/subscriptions","organizations_url":"https://api.github.com/users/brian-reichle/orgs","repos_url":"https://api.github.com/users/brian-reichle/repos","events_url":"https://api.github.com/users/brian-reichle/events{/privacy}","received_events_url":"https://api.github.com/users/brian-reichle/received_events","type":"User","site_admin":false},"created_at":"2018-08-20T07:06:42Z","updated_at":"2018-08-20T07:06:42Z","author_association":"NONE","body":"That sounds reasonable, if I have a method shared between properties, it will have a name that is distinct from each of them."}}
{"actor":{"display_login":"brian-reichle"}}