tag:blogger.com,1999:blog-13459850.post893540836067033280..comments2023-10-15T08:07:08.589+00:00Comments on Forwards: Tibet BindingUnknownnoreply@blogger.comBlogger6125tag:blogger.com,1999:blog-13459850.post-43567268951768972812013-06-23T06:19:48.341+00:002013-06-23T06:19:48.341+00:00+1 good stuff+1 good stuffChan Yue Wahhttps://www.blogger.com/profile/12342709769917850644noreply@blogger.comtag:blogger.com,1999:blog-13459850.post-71867123945300320112013-06-22T18:54:53.004+00:002013-06-22T18:54:53.004+00:00I agree with Boreslav that it would be great to se...I agree with Boreslav that it would be great to see formatting added. Anonymoushttps://www.blogger.com/profile/08731299017090289625noreply@blogger.comtag:blogger.com,1999:blog-13459850.post-1379248197066360892013-06-21T12:50:52.466+00:002013-06-21T12:50:52.466+00:00MVVM for me is a way to write platform independent...MVVM for me is a way to write platform independent code. Any time I have to place any logic into View, it's duplication of effort between different platforms. For that reason, I avoid logic in views at any cost. The presented example is something that I'd prefer doing in the ViewModel as a readonly property and binding to that property. <br /><br />+1 to asudburyAlexeyhttps://www.blogger.com/profile/02157881752885269787noreply@blogger.comtag:blogger.com,1999:blog-13459850.post-27082315494304041402013-06-21T10:22:11.670+00:002013-06-21T10:22:11.670+00:00Hello!
First of all, I have to say that the bindi...Hello!<br /><br />First of all, I have to say that the binding stuff is really one of the most important things which would be waiting for some improvements in MvvmCross. Despite of my own oppinion that binding generally must not provide very reach functionality (as that would indicate something is not designed well), there are several small things which I am suffering of pretty much.<br /><br />I must completely agree with asudbury. Such way to manage binding (with the sample with strings concatenation) just looks like a little bit model-driven approach replacement. (Especially, if the binding is the same through all the platforms). Plus, it would bring additional complecity into the binding syntax.<br /><br />For me personally, the things which MvvmCross binding lacks the most at the moment are:<br /><br /> - formatting. (for instance, with numbers). That's ok to create some Field "FullName" in viewModel to combine "FirstName" and "LastName", for instance, (as adudbury says) but that does not sound pretty convenient also to create a field "SallaryFormatted" just for databinding. So, in that sense, the old ASP.NET databinding approach looks great for me: Sallary.ToString("{0:0.00}"). For example: .Bind().Format("{0:0.00}s")<br /> Another option here might be adding Attributes to ViewModel properties for simple cases, like [OutputFormat("{0:n}")] or just [OutputFormat("n")].<br /> This thing might be also very useful for developers who uses localization.<br /> <br /> - simple types converting and logical operators (n. 3, 4 and (probably) 5 mentioned by you). "Length(Hello)" is one of the things. But also, something like "Hidden Length(Hello) == 0" or "BackgroundColor IsExists ? UIColor.Green : UIColor.Red" (which is actually, a sample of actually platform/dependent binding, what might be very usefuly). That's pretty unconvenient to create Converters for such tiny situations. Especially, if you want for different views to have a little bit another colors: "BackgroundColor IsExists ? UIColor.White : UIColor.Black" (you should then create BoolToColorUserConverter or BoolToColorUserInVacationConverter etc).<br /> <br /> <br /> ...and I am not sure I fully get if the following really needed though:<br /> - Multi-bindings. It seems dragging responsibility out of ViewModel to view. (This is actually, the same talk about viewModel properties concatenation. As if it exists, then such feature needed of course, if not - then not). But generally that's the thing asudbury mentioning.<br /> <br /> Thanks!Boleslavhttps://www.blogger.com/profile/16507032424028141982noreply@blogger.comtag:blogger.com,1999:blog-13459850.post-84053616175572972942013-06-21T09:38:21.696+00:002013-06-21T09:38:21.696+00:00local:MvxBind="Text Salutation(Counter + Leng...local:MvxBind="Text Salutation(Counter + Length(Hello)) + ' ' + Hello"<br /><br />Reminds some nice features of <a href="http://caliburnmicro.codeplex.com/wikipage?title=Cheat%20Sheet&referringTitle=Documentation" rel="nofollow">Caliburn.Micro</a><br /><br />I'm used this for my WinPhone application.<br />"cal:Message.Attach" with $params was very very easy in usability :)enterpredatorhttps://www.blogger.com/profile/12832160169833165538noreply@blogger.comtag:blogger.com,1999:blog-13459850.post-90760727485283134432013-06-21T06:48:44.099+00:002013-06-21T06:48:44.099+00:00For me when you start doing complex binding statem...For me when you start doing complex binding statements like <br /><br />Text Salutation(Counter + Length(Hello)) + ' ' + Hello"<br /><br />I would prefer it to be a property in the viewmodel (if they are platform independent bindings) <br /><br />This will keep the view(s) as dumb as possible with no logic – that aside it’s really neat and I can see being a useful option certainly seems a more natural way of expressing bindings.<br />asudburyhttps://www.blogger.com/profile/09920958415403894561noreply@blogger.com