{"action":"created","issue":{"url":"https://api.github.com/repos/MugenMvvmToolkit/MugenMvvmToolkit/issues/36","repository_url":"https://api.github.com/repos/MugenMvvmToolkit/MugenMvvmToolkit","labels_url":"https://api.github.com/repos/MugenMvvmToolkit/MugenMvvmToolkit/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/MugenMvvmToolkit/MugenMvvmToolkit/issues/36/comments","events_url":"https://api.github.com/repos/MugenMvvmToolkit/MugenMvvmToolkit/issues/36/events","html_url":"https://github.com/MugenMvvmToolkit/MugenMvvmToolkit/issues/36","id":302477888,"number":36,"title":"[winform] How do I enable my user control props for binding?","user":{"login":"Thraka","id":2672110,"avatar_url":"https://avatars0.githubusercontent.com/u/2672110?v=4","gravatar_id":"","url":"https://api.github.com/users/Thraka","html_url":"https://github.com/Thraka","followers_url":"https://api.github.com/users/Thraka/followers","following_url":"https://api.github.com/users/Thraka/following{/other_user}","gists_url":"https://api.github.com/users/Thraka/gists{/gist_id}","starred_url":"https://api.github.com/users/Thraka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thraka/subscriptions","organizations_url":"https://api.github.com/users/Thraka/orgs","repos_url":"https://api.github.com/users/Thraka/repos","events_url":"https://api.github.com/users/Thraka/events{/privacy}","received_events_url":"https://api.github.com/users/Thraka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-05T21:52:09Z","updated_at":"2018-03-06T03:27:55Z","closed_at":null,"author_association":"NONE","body":"I have a custom user control that has a property. What do I need to do to make it usable from the binding  within a view? I'm trying to bind the control.prop to my viewmodel.prop but this doesn't seem to work in twoway:\r\n\r\n```csharp\r\n// The bind call in the form\r\nset.Bind(clrBackground, () => clr => clr.Color).To(() => (vm, ctx) => vm.DocumentBackground).TwoWay();\r\n```\r\n\r\n```csharp\r\n// The 'Color' property in the user control.\r\npublic Microsoft.Xna.Framework.Color Color\r\n{\r\n    get => color;\r\n    set\r\n    {\r\n        color = value;\r\n        picColor.BackColor = value.ToDrawingColor();\r\n    }\r\n}\r\n```\r\n\r\nThank you for any help you can provide.\r\n\r\nIt seems like a really nice framework, but it's not well documented and caused me hours of frustration to just understand how things work. It would be nice if the sample project demonstrated simple scenarios that everyone must do to essentially learn how the system works."},"comment":{"url":"https://api.github.com/repos/MugenMvvmToolkit/MugenMvvmToolkit/issues/comments/370650237","html_url":"https://github.com/MugenMvvmToolkit/MugenMvvmToolkit/issues/36#issuecomment-370650237","issue_url":"https://api.github.com/repos/MugenMvvmToolkit/MugenMvvmToolkit/issues/36","id":370650237,"user":{"login":"vvs0205","id":1286104,"avatar_url":"https://avatars1.githubusercontent.com/u/1286104?v=4","gravatar_id":"","url":"https://api.github.com/users/vvs0205","html_url":"https://github.com/vvs0205","followers_url":"https://api.github.com/users/vvs0205/followers","following_url":"https://api.github.com/users/vvs0205/following{/other_user}","gists_url":"https://api.github.com/users/vvs0205/gists{/gist_id}","starred_url":"https://api.github.com/users/vvs0205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvs0205/subscriptions","organizations_url":"https://api.github.com/users/vvs0205/orgs","repos_url":"https://api.github.com/users/vvs0205/repos","events_url":"https://api.github.com/users/vvs0205/events{/privacy}","received_events_url":"https://api.github.com/users/vvs0205/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T03:27:55Z","updated_at":"2018-03-06T03:27:55Z","author_association":"OWNER","body":"Hi there, everything is simple if you want to add support for two way bindings, you just need to notify about Color changes you can add event ColorChanged or implement INotifyPropertyChanged for your control:\r\n```csharp\r\n// The 'Color' property in the user control.\r\npublic Microsoft.Xna.Framework.Color Color\r\n{\r\n    get => color;\r\n    set\r\n    {\r\n        color = value;\r\n        picColor.BackColor = value.ToDrawingColor();\r\n        ColorChanged?.Invoke(this, EventArgs.Empty);\r\n    }\r\n}\r\n\r\npublic event EventHandler ColorChanged;\r\n```"}}
{"actor":{"display_login":"vvs0205"}}