﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - Crosslight - Using the binding Provider to call a custom method on view controller</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Using-the-binding-Provider-to-call-a-custom-method-on-view-controller/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Using the binding Provider to call a custom method on view controller</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Using-the-binding-Provider-to-call-a-custom-method-on-view-controller/</link><pubDate>Mon, 16 Jun 2014 08:02:58 GMT</pubDate><dc:creator>yudi</dc:creator><category>custom</category><category>iOS</category><category>bindingprovider</category><category>method</category><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;For such scenario, we can use the &lt;em&gt;Modal Navigation&lt;/em&gt; instead of using pop up. This approach conforms with the standard navigation that is commonly found in modern mobile apps. For more detail, please check the &lt;a href="http://developer.intersoftpt.com/display/crosslight/Standard+Navigation" target="_blank"&gt;Standard Navigation&lt;/a&gt; article.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;&lt;a href="http://git.intersoftpt.com/projects/CROS/repos/samples/browse/MyInventory" target="_blank"&gt;My Inventory&lt;/a&gt; sample is a good place to start.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;this.AddBinding("TableView", BindableProperties.DetailNavigationTargetProperty,  new NavigationTarget(typeof(ItemEditorViewModel), new NavigationParameter(){Animated = false, NavigationMode = NavigationMode.Modal, EnsureNavigationContext = true}), true);&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;The above code can be used as the custom navigation to show Modal Navigation with no animation. The code should be implemented in ItemListBindingProvider.cs. Next, we should do the following:&lt;/span&gt;&lt;/p&gt;
&lt;ol style="color: #1f497d;"&gt;&lt;li&gt;Add the view model for the view controller that will host the image view;&lt;/li&gt;&lt;li&gt;Create the view for the view controller using XIB definition;&lt;/li&gt;&lt;li&gt;Set the outlet for the ImageView using Xcode;&lt;/li&gt;&lt;li&gt;Define a binding provider for the view controller that sets the ImageSourceProperty to the ImageView;&lt;br&gt;this.AddBinding("MyImageView", BindableProperties.ImageSourceProperty, "Item.Image", BindingMode.TwoWay);&lt;br&gt;Don't forget to set the Item property in the view model in the navigated event of the view model.&lt;br&gt;this.Item = parameter.Data as YourItem;&lt;/li&gt;&lt;li&gt;Bind the command property to the image view, so that the command in the view model is triggered.&lt;br&gt;this.AddBinding("ImageView", BindableProperties.CommandProperty, "CloseImageCommand", BindingMode.TwoWay);&lt;br&gt;The CloseImageCommand may contain this definition:&lt;br&gt;//define in view model&lt;br&gt;this.NavigationService.Close();&lt;br&gt;This is to close the modal navigation.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Using the binding Provider to call a custom method on view controller</title><link>http://www.intersoftsolutions.com/Community/Crosslight/Using-the-binding-Provider-to-call-a-custom-method-on-view-controller/</link><pubDate>Sun, 15 Jun 2014 12:17:28 GMT</pubDate><dc:creator>nick5454</dc:creator><category>custom</category><category>iOS</category><category>bindingprovider</category><category>method</category><description>&lt;p&gt;I have a List binding provider and instead of navigating to another page I want tt pop up an image view.&lt;/p&gt;&lt;p&gt;I have a list with thumbnails and I want to add a custom navigation to enlarge the image and catch a click event to hide the image.&lt;/p&gt;&lt;p&gt;How can I using the BindingProvider add a custom binding to call a method that is part of an interface, this was I can customize the method on each platform. Starting with iOS.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;I assume I use a DelegateCommand that the view model provides to the controller. How does the ViewController grab this command?&lt;br&gt;&lt;/p&gt;</description></item></channel></rss>