{"action":"created","issue":{"url":"https://api.github.com/repos/fsprojects/FSharp.Desktop.UI/issues/16","labels_url":"https://api.github.com/repos/fsprojects/FSharp.Desktop.UI/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/fsprojects/FSharp.Desktop.UI/issues/16/comments","events_url":"https://api.github.com/repos/fsprojects/FSharp.Desktop.UI/issues/16/events","html_url":"https://github.com/fsprojects/FSharp.Desktop.UI/issues/16","id":91789015,"number":16,"title":"Questions","user":{"login":"Evangelink","id":11340282,"avatar_url":"https://avatars.githubusercontent.com/u/11340282?v=3","gravatar_id":"","url":"https://api.github.com/users/Evangelink","html_url":"https://github.com/Evangelink","followers_url":"https://api.github.com/users/Evangelink/followers","following_url":"https://api.github.com/users/Evangelink/following{/other_user}","gists_url":"https://api.github.com/users/Evangelink/gists{/gist_id}","starred_url":"https://api.github.com/users/Evangelink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Evangelink/subscriptions","organizations_url":"https://api.github.com/users/Evangelink/orgs","repos_url":"https://api.github.com/users/Evangelink/repos","events_url":"https://api.github.com/users/Evangelink/events{/privacy}","received_events_url":"https://api.github.com/users/Evangelink/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-29T12:24:19Z","updated_at":"2015-07-01T05:06:05Z","closed_at":null,"body":"I am currently trying to create some projects using your MVC framework and it seems some of the code you are using in fsharp-wpf-mvc-series are now missing or have changed.\r\n\r\nWhat is the current recommended way to use an existing converter (for example a BoolToVisibility converter)? It seems the only correct way (based on my understanding of your code) is to provide a function that acts as converter and not to use a converter class (IValueConverter).\r\n\r\nI am also wondering how you would handle displaying a message (for example message box but I assume the behavior would be the same) at the end of an operation? For now, I am passing a method (string -> string -> unit) as an argument of my controller and I call this method when needed. Doing so I am able to keep my unit tests quite simple as I can fake my methods. But I am wondering if the problem should not be inverted, meaning that the XamlView implementation should not subscribe to a result of the controller's method to trigger the message box."},"comment":{"url":"https://api.github.com/repos/fsprojects/FSharp.Desktop.UI/issues/comments/117435698","html_url":"https://github.com/fsprojects/FSharp.Desktop.UI/issues/16#issuecomment-117435698","issue_url":"https://api.github.com/repos/fsprojects/FSharp.Desktop.UI/issues/16","id":117435698,"user":{"login":"dmitry-a-morozov","id":3004037,"avatar_url":"https://avatars.githubusercontent.com/u/3004037?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitry-a-morozov","html_url":"https://github.com/dmitry-a-morozov","followers_url":"https://api.github.com/users/dmitry-a-morozov/followers","following_url":"https://api.github.com/users/dmitry-a-morozov/following{/other_user}","gists_url":"https://api.github.com/users/dmitry-a-morozov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitry-a-morozov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitry-a-morozov/subscriptions","organizations_url":"https://api.github.com/users/dmitry-a-morozov/orgs","repos_url":"https://api.github.com/users/dmitry-a-morozov/repos","events_url":"https://api.github.com/users/dmitry-a-morozov/events{/privacy}","received_events_url":"https://api.github.com/users/dmitry-a-morozov/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T05:06:04Z","updated_at":"2015-07-01T05:06:04Z","body":"Hi,\r\nI apologize for delayed response.\r\n1) BoolToVisibility  converter.\r\nTo solve this issue I can bring back pseudo extension method `Apply` \r\nhttps://github.com/dmitry-a-morozov/fsharp-wpf-mvc-series/blob/master/Chapter%2012%20-%20BindingMicroDSL/FSharp.Windows/Binding.fs#L33 \r\n\r\nBut I recommend to avoid 2-way converters for several reasons:\r\n  - Hard to debug & unit tests \r\n  - Exceptions/errors in [ConvertBack](https://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter.convertback.aspx) method are problematic   \r\n  - A converter is bad place to keep presentation logic - it belongs to controller.\r\nSome of my thoughts on the subject is here   \r\nhttps://github.com/dmitry-a-morozov/fsharp-wpf-mvc-series/wiki/Data-Binding.-Growing-Micro-DSL\r\nAlso chapter 7 of  [F# Deep Dives](http://www.manning.com/petricek2/), pages 177-178 have some relevant comments.\r\n\r\nMy suggestion - define property of type [Visibility](https://msdn.microsoft.com/en-us/library/system.windows.visibility.aspx) on a model. Based on it you can have conditional logic in controller or define one-way data bindings that depends on a value if this property.\r\n\r\n2) Message box invocation from inside a controller is tricky topic. It's certainly most underdeveloped part of the library. Please give some time to write down my thoughts and maybe come with some code examples. "}}