{"id":1669,"date":"2020-11-05T11:00:03","date_gmt":"2020-11-05T11:00:03","guid":{"rendered":"https:\/\/serkanseker.com\/?p=1669"},"modified":"2021-02-22T07:38:37","modified_gmt":"2021-02-22T07:38:37","slug":"xamarin-forms-data-binding-context","status":"publish","type":"post","link":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/","title":{"rendered":"Xamarin.Forms Data Binding Context"},"content":{"rendered":"\n<p>In Xamarin applications, we sometimes see that the views move in a connected way or a UI element is updated dynamically. We can also do this in our own applications. How Does? Of course with Data Binding.<\/p>\n\n\n\n<p>You can dynamically receive or send data from the user by binding a data or view to the view. For example, you can bind the data in a List to the ListView and then update this data through the ListView. Thus, you will develop an interactive application with the user. It is possible to do this with Data Bindings.<\/p>\n\n\n\n<p>In this article, you will learn the basics of Data Binding, data flow and binding examples.<\/p>\n\n\n\n<p>So let&#8217;s get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-data-binding\">What is Data Binding?<\/h2>\n\n\n\n<p>Data Bindings bind between views and data in <a href=\"https:\/\/dotnet.microsoft.com\/apps\/xamarin\" target=\"_blank\" rel=\"noreferrer noopener\">Xamarin <\/a>applications. In other words, when changes occur in the data after the binding process, the views change. Or, when the appearance changes, the data can also change.<\/p>\n\n\n\n<p>For instance,<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Let&#8217;s say there is a slider and BoxView in the application. You can connect this slider with BoxView and change the opacity of BoxView when you slide the slider.<\/li><li>Or, you can connect an existing List in the ModelView class to the ListView and view the data in a list. You can even make changes to this data by running commands on the ListView.<\/li><\/ul>\n\n\n\n<p>Let&#8217;s examine the basic concepts of Data Bindings.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/11\/Data-Binding-Diagram.jpg\" alt=\"Data Binding Diagram\" class=\"wp-image-1691\"\/><figcaption>Data Binding Diagram<\/figcaption><\/figure><\/div>\n\n\n\n<p>Data Bindings basically consist of four main components: <strong>target object<\/strong>, <strong>target property<\/strong>, <strong>binding source<\/strong> and <strong>path<\/strong>. And each bind contains these components.<\/p>\n\n\n\n<p>Let&#8217;s assume that we connect the <strong>Students.Name<\/strong> property to the <strong>Text <\/strong>property of a <strong>Label<\/strong>. In this case, the target object is the Label, the target property is the Text property, the value used is Name, and the source is Student object.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Data Binding Modes<\/h2>\n\n\n\n<p>Binding doesn&#8217;t just have to be from the source to the destination. Binding can be target-to-source or two-ways, depending on how the application works. You can change the Binding.Mode according to whether you want the user to change the data in the application. Thus, you will provide a better user experience.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/11\/Data-Binding-Dataflow.jpg\" alt=\"Data Binding Dataflow\" class=\"wp-image-1695\"\/><figcaption>Data Binding Dataflow<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">OneWay Binding<\/h3>\n\n\n\n<p><strong>OneWay <\/strong>binding is updating the target property of changes in the source. But changes to the target don&#8217;t update the source. It is more convenient to use it for binding read-only data. If there is no change in the destination, it is necessary to connect OneWay instead of TwoWay. Thus, the application is less burdened.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">TwoWay Binding<\/h3>\n\n\n\n<p>With <strong>TwoWay <\/strong>binding , it updates one variant on the source or target with another. TwoWay binding is more appropriate if the user editable view is to be binded to the resource. UI components such as CheckBox, RadioButton should be connected in this way.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OneWayToSource Binding<\/h3>\n\n\n\n<p>As the name suggests, the change in target is to update the source. OneWay is the opposite of tying.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OneTime Binding<\/h3>\n\n\n\n<p>It is appropriate to use in cases where the resource value does not change, ie if the data is static. <strong>OneTime <\/strong>binding allows the source to initialize the target. It does not reflect later changes on the target. This is a simple type of OneWay binding.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">View To View Data Binding<\/h2>\n\n\n\n<p>In Xamarin.Forms apps, you can bind one view element to another view element. Thus, the change in one view affects the other. <a href=\"https:\/\/serkanseker.com\/mvvm-pattern-xamarin-forms\/\" target=\"_blank\" rel=\"noreferrer noopener\">MVVM <\/a>pattern is not used in view-to-view binding. So there is no need to create Model and ViewModel classes. Just connect View components together.<\/p>\n\n\n\n<p>In the example I will show now, we will connect the BoxView and the slider and observe the changes. Also, we will bind a Label to the slider and change the Text property according to the value of the slider.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;\n&lt;ContentPage xmlns=&quot;http:\/\/xamarin.com\/schemas\/2014\/forms&quot;\n             xmlns:x=&quot;http:\/\/schemas.microsoft.com\/winfx\/2009\/xaml&quot;\n             x:Class=&quot;Blog.Views.BasicDataBindingPage&quot;&gt;\n    &lt;ContentPage.Content&gt;\n        &lt;StackLayout&gt;\n            &lt;Grid  HorizontalOptions=&quot;CenterAndExpand&quot; VerticalOptions=&quot;CenterAndExpand&quot;&gt;\n                &lt;Grid.RowDefinitions&gt;\n                    &lt;RowDefinition Height=&quot;*&quot; \/&gt;\n                    &lt;RowDefinition Height=&quot;Auto&quot; \/&gt;\n                    &lt;RowDefinition Height=&quot;Auto&quot; \/&gt;\n                    &lt;RowDefinition Height=&quot;Auto&quot; \/&gt;\n                    &lt;RowDefinition Height=&quot;Auto&quot; \/&gt;\n                &lt;\/Grid.RowDefinitions&gt;\n\n                &lt;Grid.ColumnDefinitions&gt;\n                    &lt;ColumnDefinition Width=&quot;*&quot; \/&gt;\n                    &lt;ColumnDefinition Width=&quot;Auto&quot; \/&gt;\n                &lt;\/Grid.ColumnDefinitions&gt;\n\n                &lt;BoxView x:Name=&quot;boxview&quot;\n                         BackgroundColor=&quot;Gray&quot;\n                         HeightRequest=&quot;200&quot;\n                         HorizontalOptions=&quot;Center&quot;\n                         VerticalOptions=&quot;CenterAndExpand&quot; \/&gt;\n                &lt;Slider x:Name=&quot;opacitySlider&quot;\n                        Grid.Row=&quot;1&quot; Grid.Column=&quot;0&quot;\n                        Maximum=&quot;1&quot;\n                        BindingContext=&quot;{x:Reference boxview}&quot;\n                        Value=&quot;{Binding Opacity, Mode=TwoWay}&quot;\n                        MaximumTrackColor=&quot;Gray&quot;\n                        MinimumTrackColor=&quot;Gray&quot;\/&gt;\n                &lt;Label BindingContext=&quot;{x:Reference opacitySlider}&quot;\n                       Text=&quot;{Binding Value, StringFormat=&#039;Scale = {0:F1}&#039;}&quot;\n                       Grid.Row=&quot;1&quot; Grid.Column=&quot;1&quot;\n                       VerticalTextAlignment=&quot;Center&quot;\/&gt;\n                &lt;Slider x:Name=&quot;rotationSlider&quot;\n                        Grid.Row=&quot;2&quot; Grid.Column=&quot;0&quot;\n                        Maximum=&quot;360&quot;\n                        BindingContext=&quot;{x:Reference boxview}&quot;\n                        Value=&quot;{Binding Rotation, Mode=OneWayToSource}&quot;\n                        MaximumTrackColor=&quot;Gray&quot;\n                        MinimumTrackColor=&quot;Gray&quot;\/&gt;\n                &lt;Label BindingContext=&quot;{x:Reference rotationSlider}&quot;\n                       Text=&quot;{Binding Value, StringFormat=&#039;Rotation = {0:F0}&#039;}&quot;\n                       Grid.Row=&quot;2&quot; Grid.Column=&quot;1&quot;\n                       VerticalTextAlignment=&quot;Center&quot;\n \/&gt;\n            &lt;\/Grid&gt;\n        &lt;\/StackLayout&gt;\n    &lt;\/ContentPage.Content&gt;\n&lt;\/ContentPage&gt;<\/code><\/pre>\n\n\n\n<p>Here I binded BoxView&#8217;s <strong>x:Name<\/strong> value to Slider&#8217;s BindingContex value with <strong>x:Reference<\/strong>. I also binded the Slider&#8217;s Value property to the BoxView&#8217;s opacity. At the Label, I connected the Slider with <strong>x:Reference<\/strong> and print the value of the Text property with the StringFormat.<\/p>\n\n\n\n<p>The binding mode of the Slider view named opacitySlider is TwoWay. Because I wanted the value of the Opacity property to be set to 1 instead of 0. If the mode was set to OneWayToSource rather than TwoWay, the Opacity value would initially be 0. So BoxView wouldn&#8217;t appear.<\/p>\n\n\n\n<p>The screen output is as follows:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/11\/View-To-View-Data-Binding.gif\" alt=\"View To View Data Binding\" class=\"wp-image-1712\" width=\"295\" height=\"640\"\/><figcaption>View To View Data Binding<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Data Binding to ListView with ObservableCollection<\/h2>\n\n\n\n<p>In the previous example, I binded one view to another view. Now I will show how to connect a ObservableCollection defined in ViewModel class to ListView. Binding data to the ListView will help you understand the Data Bindings topic better. You will often see the ListView structure in many applications anyway.<\/p>\n\n\n\n<p>In this example I will bind a ObservableCollection holding student information to the view. I need a Model and ViewModel class. Thus, I will apply the MVVM pattern to the project. Since the layers of the projects developed with the MVVM pattern are developed separately from each other, it fully applies the Seperation of Concers principle. That&#8217;s why you can see the MVVM architecture in many Xamarin.Forms projects.<\/p>\n\n\n\n<p>First add a <strong>Model <\/strong>folder to the project. Then create a class within this folder called Student. Create Number, Name, Surname variables in this class.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-csharp\">    public class Student\n    {\n        public int Number { get; set; }\n        public string Name { get; set; }\n        public string Surname { get; set; }\n    }<\/code><\/pre>\n\n\n\n<p>Now add a folder named <strong>ViewModel <\/strong>to the project and create a class named StudentViewModel in this folder. In the MVVM pattern, ViewModel provides the bind between View and Model. In this class, create an ObservableCollection collection where data is processed as follows.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-csharp\">    public class StudentViewModel\n    {\n        private ObservableCollection&lt;Student&gt; studentList;\n        public ObservableCollection&lt;Student&gt; StudentList\n        {\n            get { return studentList; }\n            set\n            {\n                studentList = value;\n            }\n        }\n        public StudentViewModel()\n        {\n            StudentList=GetStudents();\n        }\n        private ObservableCollection&lt;Student&gt; GetStudents()\n        {\n            return new ObservableCollection&lt;Student&gt;\n            {\n                new Student{Number=1, Name=&quot;Alex&quot;,Surname=&quot;Doe&quot;},\n                new Student{Number=2, Name=&quot;Susan&quot;,Surname=&quot;Cox&quot;},\n                new Student{Number=3, Name=&quot;Natalia&quot;,Surname=&quot;Weston&quot;},\n                new Student{Number=4, Name=&quot;David&quot;,Surname=&quot;Hahn&quot;}\n            };\n        }\n    }<\/code><\/pre>\n\n\n\n<p>Finally, add a folder named <strong>View <\/strong>to the project and create a ContentPage named StudentPage within that folder. Then declare ContenPage&#8217;s BindingContext as below.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">    &lt;ContentPage.BindingContext&gt;\n        &lt;bc:StudentViewModel\/&gt;\n    &lt;\/ContentPage.BindingContext&gt;\n    &lt;ContentPage.Content&gt;\n        &lt;StackLayout&gt;\n            &lt;ListView ItemsSource=&quot;{Binding StudentList}&quot;&gt;\n                &lt;ListView.ItemTemplate&gt;\n                    &lt;DataTemplate&gt;\n                        &lt;ViewCell&gt;\n                            &lt;StackLayout Orientation=&quot;Horizontal&quot;&gt;\n                                &lt;Label Text=&quot;{Binding Number}&quot; FontSize=&quot;20&quot; FontAttributes=&quot;Bold&quot; TextColor=&quot;Gray&quot; \/&gt;\n                                &lt;Label Text=&quot;{Binding Name}&quot; FontSize=&quot;20&quot; \/&gt;\n                                &lt;Label Text=&quot;{Binding Surname}&quot; FontSize=&quot;20&quot; \/&gt;\n                            &lt;\/StackLayout&gt;\n                        &lt;\/ViewCell&gt;\n                    &lt;\/DataTemplate&gt;\n                &lt;\/ListView.ItemTemplate&gt;\n            &lt;\/ListView&gt;\n        &lt;\/StackLayout&gt;\n    &lt;\/ContentPage.Content&gt;\n&lt;\/ContentPage&gt;<\/code><\/pre>\n\n\n\n<p>Here I binded StudentList&#8217;s to ListView&#8217;s ItemSource property. Thus, I declare that the source of ListView is the ObservableCollection collection named StudentList of the ViewModel class. In addition, I make the Text properties of the Labels in the ViewCell appear in the ListView by binding the StudentList&#8217;s properties.<\/p>\n\n\n\n<p>Our screen output will look like this:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/11\/Data-Binding-to-ListView-with-ObservableCollection-473x1024.jpg\" alt=\"Data Binding to ListView with ObservableCollection\" class=\"wp-image-1705\" width=\"237\" height=\"512\"\/><figcaption>Data Binding to ListView with ObservableCollection<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Data Binding Command<\/h2>\n\n\n\n<p>In Xamarin.Forms applications, we want to interact with view components such as button, ImageView. It is possible to interact with the Clicked handler of views on the code side of the XAML file. However, since there is no Clicked handler in the MVVM model, interactions are provided with the Command interface.<\/p>\n\n\n\n<p>I want to interact with my StudentList example above through the Command interface and delete the last element in the list. For this, first inherit the ViewModel class from the INotifyPropertyChanged interface. Then implement this interface.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-csharp\">   public class StudentViewModel : INotifyPropertyChanged\n    {\n        public event PropertyChangedEventHandler PropertyChanged;\n        protected void OnPropertyChanged(string propertyName)\n        {\n            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n        }\n        private ObservableCollection&lt;Student&gt; studentList;\n        public ObservableCollection&lt;Student&gt; StudentList\n        {\n            get { return studentList; }\n            set\n            {\n                studentList = value;\n                OnPropertyChanged(&quot;Student&quot;);\n            }\n        }\n        public StudentViewModel()\n        {\n            StudentList = GetStudents();\n        }\n        private ObservableCollection&lt;Student&gt; GetStudents()\n        {\n            return new ObservableCollection&lt;Student&gt;\n            {\n                new Student{Number=1, Name=&quot;Alex&quot;,Surname=&quot;Doe&quot;},\n                new Student{Number=2, Name=&quot;Susan&quot;,Surname=&quot;Cox&quot;},\n                new Student{Number=3, Name=&quot;Natalia&quot;,Surname=&quot;Weston&quot;},\n                new Student{Number=4, Name=&quot;David&quot;,Surname=&quot;Hahn&quot;}\n            };\n        }\n        public ICommand DeleteCommand =&gt; new Command(Delete);\n        private async void Delete()\n        {\n            StudentList.RemoveAt(StudentList.Count-1);\n        }\n    }<\/code><\/pre>\n\n\n\n<p>With the OnPropertyChanged (&#8220;Student&#8221;) method, I notify the view when there is a change in StudentList. Thus, when an element is deleted, the ListView component is updated.<\/p>\n\n\n\n<p>Also notice how I use Command. I use the ICommand interface to add a command to the ViewModel and define the command method as above. Now let&#8217;s see how I binded this command to View.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">    &lt;ContentPage.BindingContext&gt;\n        &lt;bc:StudentViewModel\/&gt;\n    &lt;\/ContentPage.BindingContext&gt;\n    &lt;ContentPage.Content&gt;\n        &lt;StackLayout&gt;\n            &lt;ListView ItemsSource=&quot;{Binding StudentList}&quot;&gt;\n                &lt;ListView.ItemTemplate&gt;\n                    &lt;DataTemplate&gt;\n                        &lt;ViewCell&gt;\n                            &lt;StackLayout Orientation=&quot;Horizontal&quot;&gt;\n                                &lt;Label Text=&quot;{Binding Number}&quot; FontSize=&quot;20&quot; FontAttributes=&quot;Bold&quot; TextColor=&quot;Gray&quot; \/&gt;\n                                &lt;Label Text=&quot;{Binding Name}&quot; FontSize=&quot;20&quot; \/&gt;\n                                &lt;Label Text=&quot;{Binding Surname}&quot; FontSize=&quot;20&quot; \/&gt;\n                            &lt;\/StackLayout&gt;\n                        &lt;\/ViewCell&gt;\n                    &lt;\/DataTemplate&gt;\n                &lt;\/ListView.ItemTemplate&gt;\n            &lt;\/ListView&gt;\n            &lt;Button Text=&quot;DELETE LAST ITEM&quot; Command=&quot;{Binding DeleteCommand}&quot;\/&gt;\n        &lt;\/StackLayout&gt;\n    &lt;\/ContentPage.Content&gt;<\/code><\/pre>\n\n\n\n<p>I added a Button after ListView and connected the Command property with DeleteCommand in ViewModel. That is all. Now, every time we click the button, the last element of StudentList will be deleted and the ListView will be updated.<\/p>\n\n\n\n<p>Our screen output will look like this:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/serkanseker.com\/wp-content\/uploads\/2020\/11\/Data-Binding-Command.gif\" alt=\"Data Binding Command\" class=\"wp-image-1704\" width=\"236\" height=\"512\"\/><figcaption>Data Binding Command<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>To sum up, Data Bindings binds source and target objects. In Xamarin.Forms applications, we use it to bind views or to bind views to ViewModel. When an application interacts with the user, it offers a better experience.<\/p>\n\n\n\n<p>In this article, I explained Data Contexts, binding modes, connecting View and ViewModel, and Command with examples. And also, to better understand this topic, you should understand the MVVM pattern well. I hope it was useful.<\/p>\n\n\n\n<p>If you\u2019re still not sure what to do, or if you got any errors, then I suggest you use the comment section below and let me know! I am here to help!<\/p>\n\n\n\n<p><strong>Also, share this blog post on social media and help more people learn.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Links<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/serkanseker.com\/mvvm-pattern-xamarin-forms\/\">MVVM Pattern in Xamarin.Forms Apps<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In Xamarin applications, we sometimes see that the views move in a connected way or a UI element is updated dynamically. We can also do this in our own applications. How Does? Of course with Data Binding.<\/p>\n","protected":false},"author":1,"featured_media":213,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[21,39],"tags":[263,33,42,4,5],"class_list":["post-1669","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-xamarin","category-xamarin-forms","tag-data-binding","tag-listview","tag-mvvm","tag-xamarin","tag-xamarin-forms"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Xamarin.Forms Data Binding Context - Serkan Seker TR<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Xamarin.Forms Data Binding Context - Serkan Seker TR\" \/>\n<meta property=\"og:description\" content=\"In Xamarin applications, we sometimes see that the views move in a connected way or a UI element is updated dynamically. We can also do this in our own applications. How Does? Of course with Data Binding.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/\" \/>\n<meta property=\"og:site_name\" content=\"Serkan Seker TR\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-05T11:00:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-22T07:38:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1\" \/>\n\t<meta property=\"og:image:height\" content=\"1\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"serkanadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"serkanadmin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/\"},\"author\":{\"name\":\"serkanadmin\",\"@id\":\"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5\"},\"headline\":\"Xamarin.Forms Data Binding Context\",\"datePublished\":\"2020-11-05T11:00:03+00:00\",\"dateModified\":\"2021-02-22T07:38:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/\"},\"wordCount\":1354,\"commentCount\":1,\"image\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg\",\"keywords\":[\"Data Binding\",\"ListView\",\"MVVM\",\"xamarin\",\"xamarin.forms\"],\"articleSection\":[\"Xamarin\",\"Xamarin.Forms\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/\",\"url\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/\",\"name\":\"Xamarin.Forms Data Binding Context - Serkan Seker TR\",\"isPartOf\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg\",\"datePublished\":\"2020-11-05T11:00:03+00:00\",\"dateModified\":\"2021-02-22T07:38:37+00:00\",\"author\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5\"},\"breadcrumb\":{\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#primaryimage\",\"url\":\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg\",\"contentUrl\":\"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/serkanseker.com\/tr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Xamarin.Forms Data Binding Context\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/serkanseker.com\/tr\/#website\",\"url\":\"https:\/\/serkanseker.com\/tr\/\",\"name\":\"Serkan Seker TR\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/serkanseker.com\/tr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5\",\"name\":\"serkanadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/93ddc1f96117bf468976afe93a077eda77de96bcdb48dc749903598a546786a3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/93ddc1f96117bf468976afe93a077eda77de96bcdb48dc749903598a546786a3?s=96&d=mm&r=g\",\"caption\":\"serkanadmin\"},\"sameAs\":[\"https:\/\/serkanseker.com\"],\"url\":\"https:\/\/serkanseker.com\/tr\/author\/serkanadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Xamarin.Forms Data Binding Context - Serkan Seker TR","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Xamarin.Forms Data Binding Context - Serkan Seker TR","og_description":"In Xamarin applications, we sometimes see that the views move in a connected way or a UI element is updated dynamically. We can also do this in our own applications. How Does? Of course with Data Binding.","og_url":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/","og_site_name":"Serkan Seker TR","article_published_time":"2020-11-05T11:00:03+00:00","article_modified_time":"2021-02-22T07:38:37+00:00","og_image":[{"url":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg","width":1,"height":1,"type":"image\/jpeg"}],"author":"serkanadmin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"serkanadmin","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#article","isPartOf":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/"},"author":{"name":"serkanadmin","@id":"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5"},"headline":"Xamarin.Forms Data Binding Context","datePublished":"2020-11-05T11:00:03+00:00","dateModified":"2021-02-22T07:38:37+00:00","mainEntityOfPage":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/"},"wordCount":1354,"commentCount":1,"image":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#primaryimage"},"thumbnailUrl":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg","keywords":["Data Binding","ListView","MVVM","xamarin","xamarin.forms"],"articleSection":["Xamarin","Xamarin.Forms"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/","url":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/","name":"Xamarin.Forms Data Binding Context - Serkan Seker TR","isPartOf":{"@id":"https:\/\/serkanseker.com\/tr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#primaryimage"},"image":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#primaryimage"},"thumbnailUrl":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg","datePublished":"2020-11-05T11:00:03+00:00","dateModified":"2021-02-22T07:38:37+00:00","author":{"@id":"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5"},"breadcrumb":{"@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#primaryimage","url":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg","contentUrl":"https:\/\/serkanseker.com\/tr\/wp-content\/uploads\/2020\/12\/Xamarin.Forms-Data-Binding-Context.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/serkanseker.com\/tr\/xamarin-forms-data-binding-context\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/serkanseker.com\/tr\/"},{"@type":"ListItem","position":2,"name":"Xamarin.Forms Data Binding Context"}]},{"@type":"WebSite","@id":"https:\/\/serkanseker.com\/tr\/#website","url":"https:\/\/serkanseker.com\/tr\/","name":"Serkan Seker TR","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/serkanseker.com\/tr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/841fcc69b248e08e52c4190963caeaf5","name":"serkanadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/serkanseker.com\/tr\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/93ddc1f96117bf468976afe93a077eda77de96bcdb48dc749903598a546786a3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93ddc1f96117bf468976afe93a077eda77de96bcdb48dc749903598a546786a3?s=96&d=mm&r=g","caption":"serkanadmin"},"sameAs":["https:\/\/serkanseker.com"],"url":"https:\/\/serkanseker.com\/tr\/author\/serkanadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/posts\/1669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/comments?post=1669"}],"version-history":[{"count":0,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/posts\/1669\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/media\/213"}],"wp:attachment":[{"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/media?parent=1669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/categories?post=1669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serkanseker.com\/tr\/wp-json\/wp\/v2\/tags?post=1669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}