{"id":1373,"date":"2010-04-19T13:43:00","date_gmt":"2010-04-19T13:43:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/odatateam\/2010\/04\/19\/introduction-to-databinding-updated\/"},"modified":"2010-04-19T13:43:00","modified_gmt":"2010-04-19T13:43:00","slug":"introduction-to-databinding-updated","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/odata\/introduction-to-databinding-updated\/","title":{"rendered":"Introduction to Databinding (Updated)"},"content":{"rendered":"<p><P>This blog post is an update to an introduction to the data binding capabilities we first added in Data Services v1.5 CTP1. We have taken the feedback received throughout the CTPs and made updates to the final design. Below is an update to the original binding post for CTP1 updated based on that feedback.<\/P>\n<P><B>Introduction to Data Binding<\/B><\/P>\n<P>A new collection type, DataServiceCollection, has been added to the client library which extends ObservableCollection and supports two way binding for client code. It is now possible to auto generate client side types that implement the INotifyPropertyChanged and INotifyCollectionChanged interfaces using the add service reference gesture. <\/P>\n<P>This means that, when data binding has been enabled, any changes made to contents of a DataServiceCollection or the entities in the collection will be reflected on the client context; any subsequent calls to SaveChanges() on that context will then persist those changes on the service. As well, any changes made to the entities in the context, through a subsequent query to the data service, will automatically be reflected on the items in the DataServiceCollection. <\/P>\n<P>This also means that the DataServiceCollection, because it implements the standard binding interfaces, can be bound as the DataSource to most WPF and Silverlight controls.<\/P>\n<P>Here are some examples of different ways to create a DataServiceCollection using the ADO.NET Data Services client library. In all of these examples, the queries are being executed against a service named \u201cnwsvc\u201d that exposes two types: products and suppliers that have a one-to-many relationship.<\/P>\n<P>Example 1: Creating a DataServiceCollection of all products.<\/P>\n<TABLE border=\"1\" cellSpacing=\"0\" cellPadding=\"2\" width=\"589\">\n<TBODY>\n<TR>\n<TD vAlign=\"top\" width=\"587\">\n<P><FONT color=\"#0000ff\">DataServiceCollection&lt;Products&gt; products = <BR>&nbsp;&nbsp;&nbsp; new DataServiceCollection&lt;Products&gt;( <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from p in nwsvc.Products <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select p <BR>&nbsp;&nbsp;&nbsp; );<\/FONT> <\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<P>Example 2: Creating a DataServiceCollection of all products and their associated suppliers.<\/P>\n<TABLE border=\"1\" cellSpacing=\"0\" cellPadding=\"2\" width=\"589\">\n<TBODY>\n<TR>\n<TD vAlign=\"top\" width=\"587\">\n<P><FONT color=\"#0000ff\">DataServiceCollection&lt;Products&gt; products = <BR>&nbsp;&nbsp;&nbsp; new DataServiceCollection&lt;Products&gt;( <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from p in nwsvc.Products.Expand(&#8220;Suppliers&#8221;) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select p <BR>&nbsp;&nbsp;&nbsp;&nbsp; );<\/FONT> <\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<P><B>Walkthrough<\/B><\/P>\n<P>&nbsp;<\/P>\n<P>The following is a walkthrough of using data binding in a WPF application. <\/P>\n<P>To get started, you&#8217;ll want to download all of the required software I use in the walkthrough:&nbsp; <\/P>\n<UL>\n<LI>Visual Studio 2008 SP1 (<A href=\"https:\/\/msdn.microsoft.com\/en-us\/vs2008\/products\/cc268305.aspx\">here<\/A>) <\/LI>\n<LI>ADO.NET Data Services&nbsp; <A>(<\/A><A href=\"https:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=3e3d4eaf-227b-4ad3-ad0d-3613db8aa9df&amp;displaylang=en\">here<\/A><A title=\"_msoanchor_2\" href=\"http:\/\/blogs.msdn.com\/controlpanel\/blogs\/posteditor.aspx?SelectedNavItem=Posts&amp;sectionid=8793&amp;postid=9957214#_msocom_2\" name=\"_msoanchor_2\">[SB2]<\/A> ) <\/LI><\/UL>\n<P><B>Step 1<\/B>: Create an ADO.NET Data Service<\/P>\n<P>Create a new Web Application (named DatabindingDemo):<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image012_2.jpg\"><IMG title=\"clip_image012\" border=\"0\" alt=\"clip_image012\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image012_thumb.jpg\" width=\"403\" height=\"273\"><\/A><\/P>\n<P>Our first data access related task is to generate the Entity Framework-based data access layer to the Northwind database.&nbsp; Right click the ASP.NET project and select &#8216;Add New Item&#8217;, then select &#8216;ADO.NET Entity Data Model&#8217;.&nbsp; Name the new item nw.edmx:<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image014_2.jpg\"><IMG title=\"clip_image014\" border=\"0\" alt=\"clip_image014\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image014_thumb.jpg\" width=\"456\" height=\"276\"><\/A><\/P>\n<P>After clicking \u2018Add\u2019 on the screen above, a wizard will open to walk you through creating the Entity Data Model for the Northwind database. Use the default settings until you get to the point where you choose the database objects to include in the model. For this demo, choose only the Products and Suppliers tables.<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image016_2.jpg\"><IMG title=\"clip_image016\" border=\"0\" alt=\"clip_image016\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image016_thumb.jpg\" width=\"419\" height=\"376\"><\/A><\/P>\n<P>Once you reach the \u2018Choose Your Database Objects\u2019 screen, select the two tables and click \u2018Finish\u2019. This will open the Entity Data Model designer view.&nbsp; This view allows you to customize the auto-generated conceptual data model. To learn more about the mapping capabilities of the Entity Framework, see the MSDN page <A href=\"http:\/\/msdn.microsoft.com\/en-us\/magazine\/cc700331.aspx\">here<\/A>.<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image018_2.jpg\"><IMG title=\"clip_image018\" border=\"0\" alt=\"clip_image018\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image018_thumb.jpg\" width=\"404\" height=\"354\"><\/A><\/P>\n<P>Create an&nbsp; ADO.NET Data Service over this model. To create the data service, right click the ASP.NET project and select &#8216;Add New Item&#8217;.&nbsp; Add an &#8216;ADO.NET Data Service\u2019 item called nw.svc<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/image4.png\"><IMG title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/image4_thumb.png\" width=\"483\" height=\"337\"><\/A> <\/P>\n<P>This will generate a file (nw.svc.cs) which represents the skeleton of a data service. All we need to do now is point the data service at the data model to be exposed as a REST-service and we\u2019ll be set. The snippet below shows the edits you need to do. One thing to note is that a data service is locked down by default, so we need to take explicit steps to open access to it. For this simple application we\u2019ll enable read and write access to the entire model quickly using the call to \u2018SetEntitySetAccessRule\u2019 shown below.<\/P>\n<TABLE border=\"1\" cellSpacing=\"0\" cellPadding=\"2\" width=\"589\">\n<TBODY>\n<TR>\n<TD vAlign=\"top\" width=\"587\"><FONT color=\"#0000ff\">public class nw : DataService&lt; NorthwindEntities &gt; <BR>{ <BR>&nbsp;&nbsp;&nbsp; \/\/ This method is called only once to initialize service-wide policies. <BR>&nbsp;&nbsp;&nbsp; public static void InitializeService(DataServiceConfiguration config) <BR>&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ TODO: set rules to indicate which entity sets and <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/service operations are visible, updatable, etc. <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ Examples: <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; config.SetEntitySetAccessRule(&#8220;*&#8221;, EntitySetRights.All); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; config.SetServiceOperationAccessRule(&#8220;*&#8221;, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServiceOperationRights.All); <BR>&nbsp;&nbsp;&nbsp; } <BR>}<\/FONT><\/TD><\/TR><\/TBODY><\/TABLE>\n<BLOCKQUOTE><\/BLOCKQUOTE>\n<P>The data service is now created. To test this, run the project and navigate to the nw.svc file. You should see a listing as shown below that outlines all the entry points to the data service. If you don\u2019t, <A href=\"http:\/\/blogs.msdn.com\/astoriateam\/archive\/2007\/12\/10\/viewing-data-services-responses-using-atom-serialization-in-internet-explorer.aspx\">tweak your IE settings<\/A> and reload.<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image024_2.jpg\"><IMG title=\"clip_image024\" border=\"0\" alt=\"clip_image024\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image024_thumb.jpg\" width=\"466\" height=\"335\"><\/A><\/P>\n<P><B>Step 2: <\/B>Enable data binding on the client.<\/P>\n<P>By default, the client side types generated by ADO.NET Data Services in Visual Studio 2008 do not implement binding interfaces. To get client side types that do implement the binding interfaces, you have to tell the code generation library that you want client code that has binding enabled. To do this, set an environment variable before starting Visual Studio and then use Add Service Reference (ASR) to generate client proxy code. The environment variable to set is:<\/P>\n<P>set dscodegen_usedsc=1<\/P>\n<P><B>Note<\/B>: The use of this environment variable is further explained by the video embedded in this blog post.<\/P>\n<P><B>Note<\/B>: It is also possible to generate proxy code that have binding enabled using DataSvcUtil.exe with the \/DataServiceCollection and \/Version flags.<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/DataSvcUtil_4.png\"><IMG title=\"DataSvcUtil\" border=\"0\" alt=\"DataSvcUtil\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/DataSvcUtil_thumb_1.png\" width=\"644\" height=\"157\"><\/A> <\/P>\n<P><B><\/B><\/P>\n<P><B>Step 3<\/B>: Create client proxy code with binding enabled.<\/P>\n<P>After setting the environment variable in step 2, open the solution you created in step 1 and create a new WPF project.<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image028_2.jpg\"><IMG title=\"clip_image028\" border=\"0\" alt=\"clip_image028\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image028_thumb.jpg\" width=\"550\" height=\"354\"><\/A><\/P>\n<P>Once you have created a WPF client project, the next step is to generate client side types. To do this, find the DatabindingClient project in the solution explorer, right-click the project and select <I>Add Service Reference.. .<\/I>In the Add Service Reference dialog, click the <I>Discover<\/I> button. The nw.svc service will show up in the <I>Service<\/I> window. Enter NorthwindService as the Namespace value and select OK. This wizard will generate a set of client side types that can be used to interact with the service created in step 1.<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image030_2.jpg\"><IMG title=\"clip_image030\" border=\"0\" alt=\"clip_image030\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image030_thumb.jpg\" width=\"461\" height=\"374\"><\/A><\/P>\n<P>If this step is done correctly, you will see a new NorthwindService node under the Service References Node in the solution explorer. <\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/image_5.png\"><IMG title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/image_thumb.png\" width=\"219\" height=\"191\"><\/A> <\/P>\n<P>The next step is to create a new instance of the ADO.NET Data Services client context and connect to the service created in step 1. To do this, add the following code to the Window1.xaml.cs file to create a connection to the service; making sure to replace the host and port number with the values for your service.<\/P>\n<TABLE border=\"1\" cellSpacing=\"0\" cellPadding=\"2\" width=\"589\">\n<TBODY>\n<TR>\n<TD vAlign=\"top\" width=\"587\">\n<P><FONT color=\"#0000ff\">public partial class Window1 : Window <BR>{ <BR>&nbsp;&nbsp;&nbsp; NorthwindEntities nwsvc = new NorthwindEntities( <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new Uri(&#8220;<\/FONT><A href=\"http:\/\/localhost:60214\/nw.svc%22));\"><FONT color=\"#0000ff\">http:\/\/localhost:60214\/nw.svc&#8221;));<\/FONT><\/A><\/P>\n<P><FONT color=\"#0000ff\">&nbsp;&nbsp;&nbsp; public Window1() <BR>&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeComponent(); <BR>&nbsp;&nbsp;&nbsp; } <BR>}<\/FONT><\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<BLOCKQUOTE><\/BLOCKQUOTE>\n<P>The next step is to create an interface that you can bind the result of a query to. The service you created in step 1 exposes a set of Suppliers and a set of Products from the Northwind database with a one-to-many relationship between them. The XAML code below will create two listviews, one to display the suppliers and another to display the products associated with the current supplier selected in the first view. This type of binding is called master-detail binding. <\/P>\n<P>The code below uses standard WPF binding semantics. The ItemsSource of the supplierView is set to \u201c{Binding}\u201d, this will cause the listview to bind to the collection of items that are supplied as the data context of the supplierView; in this case the collection of items will be a collection of supplier objects. The columns of the supplierView are each bound to a property of the supplier object through the DisplayMemberBinding=&#8221;{Binding Path=SupplierID}&#8221;\/&gt; tag. <\/P>\n<P>The second listview, productsView, is bound to the Products property of the supplier objects by the ItemsSource=&#8221;{Binding Products}&#8221; tag. <\/P>\n<P>By supplying the IsSynchronizedWithCurrentItem=&#8221;True&#8221; tag on the listview, you are taking advantage of the feature WPF has to automatically display the items in the second list view (products) that are associated with the currently selected item in the first list view (suppliers).<\/P>\n<P>Paste the following code snippet into the window1.xaml file:<\/P>\n<P>&nbsp;<\/P>\n<DIV id=\"codeSnippetWrapper\">\n<DIV id=\"codeSnippet\"><PRE><SPAN id=\"lnum1\">   1:<\/SPAN> <SPAN>&lt;<\/SPAN><SPAN>Grid<\/SPAN> <SPAN>Name<\/SPAN><SPAN>=&#8221;productViewGrid&#8221;<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum2\">   2:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>ListView<\/SPAN> <SPAN>ItemsSource<\/SPAN><SPAN>=&#8221;{Binding}&#8221;<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;25,11,33,145&#8243;<\/SPAN> <SPAN>Name<\/SPAN><SPAN>=&#8221;supplierView&#8221;<\/SPAN> <SPAN>IsSynchronizedWithCurrentItem<\/SPAN><SPAN>=&#8221;True&#8221;<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum3\">   3:<\/SPAN>         <SPAN>&lt;<\/SPAN><SPAN>ListView.View<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum4\">   4:<\/SPAN>             <SPAN>&lt;<\/SPAN><SPAN>GridView<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum5\">   5:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;ID&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding Path=SupplierID}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum6\">   6:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;Name&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding Path=CompanyName}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum7\">   7:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;Address&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding Path=Address}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum8\">   8:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;City&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding Path=City}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum9\">   9:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;Region&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding Path=Region}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum10\">  10:<\/SPAN>             <SPAN>&lt;\/<\/SPAN><SPAN>GridView<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum11\">  11:<\/SPAN>         <SPAN>&lt;\/<\/SPAN><SPAN>ListView.View<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum12\">  12:<\/SPAN>     <SPAN>&lt;\/<\/SPAN><SPAN>ListView<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum13\">  13:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>ListView<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;25,0,33,12&#8243;<\/SPAN> <SPAN>Name<\/SPAN><SPAN>=&#8221;productsView&#8221;<\/SPAN> <SPAN>ItemsSource<\/SPAN><SPAN>=&#8221;{Binding Products}&#8221;<\/SPAN> <SPAN>IsSynchronizedWithCurrentItem<\/SPAN><SPAN>=&#8221;True&#8221;<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;117&#8243;<\/SPAN> <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Bottom&#8221;<\/SPAN> <SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum14\">  14:<\/SPAN>         <SPAN>&lt;<\/SPAN><SPAN>ListView.View<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum15\">  15:<\/SPAN>             <SPAN>&lt;<\/SPAN><SPAN>GridView<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum16\">  16:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;ID&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding ProductID}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum17\">  17:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;Name&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding ProductName}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum18\">  18:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;QuantityPerUnit&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding QuantityPerUnit}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum19\">  19:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;Price&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding UnitPrice}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum20\">  20:<\/SPAN>                 <SPAN>&lt;<\/SPAN><SPAN>GridViewColumn<\/SPAN> <SPAN>Header<\/SPAN><SPAN>=&#8221;InStock&#8221;<\/SPAN> <SPAN>DisplayMemberBinding<\/SPAN><SPAN>=&#8221;{Binding UnitsInStock}&#8221;<\/SPAN><SPAN>\/&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum21\">  21:<\/SPAN>             <SPAN>&lt;\/<\/SPAN><SPAN>GridView<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum22\">  22:<\/SPAN>         <SPAN>&lt;\/<\/SPAN><SPAN>ListView.View<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum23\">  23:<\/SPAN>     <SPAN>&lt;\/<\/SPAN><SPAN>ListView<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum24\">  24:<\/SPAN> <SPAN>&lt;\/<\/SPAN><SPAN>Grid<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><\/DIV><\/DIV>\n<P>Edit the following attributes of your window: Height=&#8221;400&#8243; Width=&#8221;600&#8243; to properly display the controls.<\/P>\n<P>This will create a WPF interface that looks like this:<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image036_2.jpg\"><IMG title=\"clip_image036\" border=\"0\" alt=\"clip_image036\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image036_thumb.jpg\" width=\"404\" height=\"266\"><\/A><\/P>\n<P>The final step to enable binding to these WPF controls is to set the DataContext of the grid in the window you just created to the result of a query for suppliers from the service created in step 1. This is done by executing a standard ADO.NET Data Services query on the context for the set of suppliers and then loading the result of the query into a DataServiceCollection. To do this, add the following code to the constructor for the window:<\/P>\n<TABLE border=\"1\" cellSpacing=\"0\" cellPadding=\"2\" width=\"589\">\n<TBODY>\n<TR>\n<TD vAlign=\"top\" width=\"587\">\n<P><FONT color=\"#0000ff\">public Window1() <BR>{ <BR>&nbsp;&nbsp;&nbsp; InitializeComponent(); <BR>&nbsp;&nbsp;&nbsp; this.productViewGrid.DataContext = <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new DataServiceCollection&lt;Suppliers&gt;( <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nwsvc.Suppliers.Expand(&#8220;Products&#8221;) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ); <BR>}<\/FONT><\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<BLOCKQUOTE>\n<P>Once this is complete, compile the project and run it. The result should be:<\/P><\/BLOCKQUOTE>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image040_2.jpg\"><IMG title=\"clip_image040\" border=\"0\" alt=\"clip_image040\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image040_thumb.jpg\" width=\"244\" height=\"162\"><\/A><\/P>\n<P><B>Step 4: Two-way Binding<\/B><\/P>\n<P>Up to this point in the walkthrough, you have set up a service, created a WPF client and bound the result of a query to the service to a pair of listview controls in the client. This type of binding you have done so far has all been one-way binding. The DataServiceCollection you used at the end of step 3 also supports two-way binding. This means that any changes made to the collection or items in the collection will propagate to the service when a call to SaveChanges() is made on the context. <\/P>\n<P>This final step will walk you through adding buttons that will add items to the collection of products and take advantage of two-way binding to have those changes propagate to the service and the backing northwind database.<\/P>\n<P>To start, add the following XAML code to the window1.xaml file to create buttons to that will add a product from the list of products and save the changes to the service.<\/P>\n<DIV id=\"codeSnippetWrapper\">\n<DIV id=\"codeSnippet\"><PRE><SPAN id=\"lnum1\">   1:<\/SPAN> <SPAN>&lt;<\/SPAN><SPAN>Button<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;24&#8243;<\/SPAN> <SPAN>HorizontalAlignment<\/SPAN><SPAN>=&#8221;Right&#8221;<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;0,0,89,4&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum2\">   2:<\/SPAN>     <SPAN>Name<\/SPAN><SPAN>=&#8221;addButton&#8221;<\/SPAN> <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Bottom&#8221;<\/SPAN> <SPAN>Width<\/SPAN><SPAN>=&#8221;28&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum3\">   3:<\/SPAN>     <SPAN>Click<\/SPAN><SPAN>=&#8221;addButton_Click&#8221;<\/SPAN><SPAN>&gt;<\/SPAN>+<SPAN>&lt;\/<\/SPAN><SPAN>Button<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><PRE><SPAN id=\"lnum4\">   4:<\/SPAN> <SPAN>&lt;<\/SPAN><SPAN>Button<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;24&#8243;<\/SPAN> <SPAN>HorizontalAlignment<\/SPAN><SPAN>=&#8221;Right&#8221;<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;0,0,33,4&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum5\">   5:<\/SPAN>     <SPAN>Name<\/SPAN><SPAN>=&#8221;saveButton&#8221;<\/SPAN> <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Bottom&#8221;<\/SPAN> <SPAN>Width<\/SPAN><SPAN>=&#8221;50&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum6\">   6:<\/SPAN>     <SPAN>Click<\/SPAN><SPAN>=&#8221;saveButton_Click&#8221;<\/SPAN><SPAN>&gt;<\/SPAN>Save<SPAN>&lt;\/<\/SPAN><SPAN>Button<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><\/DIV><\/DIV>\n<P>The next step is to handle the click events on the new buttons and add the currently select product in the list. The first thing we will need is a new product window to input the property values of a new product when one is created. To do this, create a new WPF window in your client project called ProductWindow.<\/P>\n<P><A href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/image_26.png\"><IMG title=\"image\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/image_thumb_11.png\" width=\"445\" height=\"311\"><\/A><\/P>\n<P>After creating the window, we need to set up the product window to bind to a single instance of the product class. To configure binding in the product window, you will use the same WPF binding method you used for the supplier window, except this window will bind to a single object and not a collection of objects. Add the following XAML code into the ProductWindow.xaml:<\/P>\n<DIV id=\"codeSnippetWrapper\">\n<DIV id=\"codeSnippet\"><PRE><SPAN id=\"lnum1\">   1:<\/SPAN> <SPAN>&lt;<\/SPAN><SPAN>Grid<\/SPAN> <SPAN>x:Name<\/SPAN><SPAN>=&#8221;productGrid&#8221;<\/SPAN><SPAN>&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum2\">   2:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>Grid.ColumnDefinitions<\/SPAN><SPAN>&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum3\">   3:<\/SPAN>         <SPAN>&lt;<\/SPAN><SPAN>ColumnDefinition<\/SPAN> <SPAN>Width<\/SPAN><SPAN>=&#8221;171*&#8221;<\/SPAN> <SPAN>\/&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum4\">   4:<\/SPAN>         <SPAN>&lt;<\/SPAN><SPAN>ColumnDefinition<\/SPAN> <SPAN>Width<\/SPAN><SPAN>=&#8221;159*&#8221;<\/SPAN> <SPAN>\/&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum5\">   5:<\/SPAN>     <SPAN>&lt;\/<\/SPAN><SPAN>Grid.ColumnDefinitions<\/SPAN><SPAN>&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum6\">   6:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>Label<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;26&#8243;<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;12,17,68,0&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum7\">   7:<\/SPAN>         <SPAN>Name<\/SPAN><SPAN>=&#8221;nameLabel&#8221;<\/SPAN> <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Top&#8221;<\/SPAN><SPAN>&gt;<\/SPAN>Name:<SPAN>&lt;\/<\/SPAN><SPAN>Label<\/SPAN><SPAN>&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum8\">   8:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>Label<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;12,49,6,0&#8243;<\/SPAN> <SPAN>Name<\/SPAN><SPAN>=&#8221;quantityLabel&#8221;<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;26&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum9\">   9:<\/SPAN>         <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Top&#8221;<\/SPAN><SPAN>&gt;<\/SPAN>Quantity Per Unit:<SPAN>&lt;\/<\/SPAN><SPAN>Label<\/SPAN><SPAN>&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum10\">  10:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>Label<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;12,78,68,64&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum11\">  11:<\/SPAN>         <SPAN>Name<\/SPAN><SPAN>=&#8221;priceLabel&#8221;<\/SPAN><SPAN>&gt;<\/SPAN>Price:<SPAN>&lt;\/<\/SPAN><SPAN>Label<\/SPAN><SPAN>&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum12\">  12:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>Label<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;26&#8243;<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;12,0,68,35&#8243;<\/SPAN> <SPAN>Name<\/SPAN><SPAN>=&#8221;inStockLabel&#8221;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum13\">  13:<\/SPAN>         <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Bottom&#8221;<\/SPAN><SPAN>&gt;<\/SPAN>InStock:<SPAN>&lt;\/<\/SPAN><SPAN>Label<\/SPAN><SPAN>&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum14\">  14:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>TextBox<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;23&#8243;<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;0,23,28.018,0&#8243;<\/SPAN> <SPAN>Name<\/SPAN><SPAN>=&#8221;nameTextBox&#8221;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum15\">  15:<\/SPAN>         <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Top&#8221;<\/SPAN> <SPAN>Text<\/SPAN><SPAN>=&#8221;{Binding ProductName}&#8221;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum16\">  16:<\/SPAN>         <SPAN>Grid<\/SPAN>.<SPAN>Column<\/SPAN><SPAN>=&#8221;1&#8243;<\/SPAN> <SPAN>\/&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum17\">  17:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>TextBox<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;0,52,28.018,0&#8243;<\/SPAN> <SPAN>Name<\/SPAN><SPAN>=&#8221;quantityTextBox&#8221;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum18\">  18:<\/SPAN>         <SPAN>Text<\/SPAN><SPAN>=&#8221;{Binding QuantityPerUnit}&#8221;<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;23&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum19\">  19:<\/SPAN>         <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Top&#8221;<\/SPAN> <SPAN>Grid<\/SPAN>.<SPAN>Column<\/SPAN><SPAN>=&#8221;1&#8243;<\/SPAN> <SPAN>\/&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum20\">  20:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>TextBox<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;0,81,28.018,64&#8243;<\/SPAN> <SPAN>Name<\/SPAN><SPAN>=&#8221;priceTextBox&#8221;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum21\">  21:<\/SPAN>         <SPAN>Text<\/SPAN><SPAN>=&#8221;{Binding UnitPrice}&#8221;<\/SPAN> <SPAN>Grid<\/SPAN>.<SPAN>Column<\/SPAN><SPAN>=&#8221;1&#8243;<\/SPAN> <SPAN>\/&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum22\">  22:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>TextBox<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;23&#8243;<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;0,0,28.018,35&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum23\">  23:<\/SPAN>         <SPAN>Name<\/SPAN><SPAN>=&#8221;inStockTextBox&#8221;<\/SPAN> <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Bottom&#8221;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum24\">  24:<\/SPAN>         <SPAN>Text<\/SPAN><SPAN>=&#8221;{Binding UnitsInStock}&#8221;<\/SPAN> <SPAN>Grid<\/SPAN>.<SPAN>Column<\/SPAN><SPAN>=&#8221;1&#8243;<\/SPAN> <SPAN>\/&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum25\">  25:<\/SPAN>     <SPAN>&lt;<\/SPAN><SPAN>Button<\/SPAN> <SPAN>Height<\/SPAN><SPAN>=&#8221;23&#8243;<\/SPAN> <SPAN>Margin<\/SPAN><SPAN>=&#8221;19.018,0,61,6&#8243;<\/SPAN> <SPAN>Name<\/SPAN><SPAN>=&#8221;okButton&#8221;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum26\">  26:<\/SPAN>         <SPAN>VerticalAlignment<\/SPAN><SPAN>=&#8221;Bottom&#8221;<\/SPAN> <SPAN>Grid<\/SPAN>.<SPAN>Column<\/SPAN><SPAN>=&#8221;1&#8243;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum27\">  27:<\/SPAN>         <SPAN>Click<\/SPAN><SPAN>=&#8221;okButton_Click&#8221;<\/SPAN><SPAN>&gt;<\/SPAN>OK<SPAN>&lt;\/<\/SPAN><SPAN>Button<\/SPAN><SPAN>&gt;<\/SPAN> <\/PRE><!--CRLF--><PRE><SPAN id=\"lnum28\">  28:<\/SPAN> <SPAN>&lt;\/<\/SPAN><SPAN>Grid<\/SPAN><SPAN>&gt;<\/SPAN><\/PRE><!--CRLF--><\/DIV><\/DIV>\n<P>Set the height of the product window to 206 and the width to 296. Next add the following code to the ProductWindow.xaml.cs file to set the data context to a single product and handle the ok button click event. The click event will add the newly created product to the current suppliers list of products.<\/P>\n<TABLE border=\"1\" cellSpacing=\"0\" cellPadding=\"2\" width=\"589\">\n<TBODY>\n<TR>\n<TD vAlign=\"top\" width=\"587\">\n<P><FONT color=\"#0000ff\">public partial class ProductWindow : Window <BR>{ <BR>&nbsp;&nbsp;&nbsp; Suppliers curSupplier; <BR>&nbsp;&nbsp;&nbsp; Products newProduct; <BR>&nbsp;&nbsp;&nbsp; public ProductWindow(Products p, Suppliers s) <BR>&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeComponent(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.productGrid.DataContext = p; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curSupplier = s; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newProduct = p; <BR>&nbsp;&nbsp;&nbsp; } <BR>&nbsp;&nbsp;&nbsp; private void okButton_Click(object sender, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RoutedEventArgs e) <BR>&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curSupplier.Products.Add(newProduct); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.Close(); <BR>&nbsp;&nbsp;&nbsp; } <BR>}<\/FONT><\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<P>The final step is to handle the add and save button click events in the supplier window. Add the following code to the Window1.xaml.cs file.<\/P>\n<P>Add the following code to the addButton_Click event to create a new product when the add button is selected. The code creates a new Product and creates a new product window for the user to input the property values for the new <A>product<\/A> . <\/P>\n<TABLE border=\"1\" cellSpacing=\"0\" cellPadding=\"2\" width=\"589\">\n<TBODY>\n<TR>\n<TD vAlign=\"top\" width=\"587\">\n<P><FONT color=\"#0000ff\">private void addButton_Click(object sender, RoutedEventArgs e) <BR>{ <BR>&nbsp;&nbsp;&nbsp; Suppliers supplier = this.supplierView.SelectedItem as Suppliers; <BR>&nbsp;&nbsp;&nbsp; Products product = new Products(); <BR>&nbsp;&nbsp;&nbsp; ProductWindow win = new ProductWindow(product, supplier); <BR>&nbsp;&nbsp;&nbsp; win.Show(); <BR>}<\/FONT><\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<P>Add the following code to handle the save button click. This button calls SaveChanges on the context which will cause any operations that have been performed on the context to be sent to the service.<\/P>\n<TABLE border=\"1\" cellSpacing=\"0\" cellPadding=\"2\" width=\"589\">\n<TBODY>\n<TR>\n<TD vAlign=\"top\" width=\"587\">\n<P><FONT color=\"#0000ff\">private void saveButton_Click(object sender, RoutedEventArgs e) <BR>{ <BR>&nbsp;&nbsp;&nbsp; nwsvc.SaveChanges(); <BR>}<\/FONT><\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<P>Your project is now complete. You can run the form and use the buttons to add items from the collection of products. When you make a change you then click the save button to persist the changes to the service.<\/P>\n<P><SPAN><SPAN><FONT size=\"3\"><STRONG><FONT size=\"2\" face=\"Arial\">More Information<\/FONT><\/STRONG><\/FONT><\/SPAN><\/SPAN><\/P>\n<UL>\n<LI><SPAN><SPAN><FONT face=\"Arial\">Binding Data to Controls: <FONT color=\"#0000ff\" size=\"3\" face=\"Calibri\"><A href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ee373844(VS.100).aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ee373844(VS.100).aspx<\/A><\/FONT><\/FONT><\/SPAN><\/SPAN><\/LI>\n<LI><SPAN><SPAN><FONT face=\"Arial\">Another Binding How To: <FONT color=\"#0000ff\" size=\"3\" face=\"Calibri\"><A href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ee373846(v=VS.100).aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ee373846(v=VS.100).aspx<\/A><\/FONT><\/FONT><\/SPAN><\/SPAN><\/LI>\n<LI><SPAN><SPAN><FONT face=\"Arial\">How To Customize Binding Behaviors: <FONT color=\"#0000ff\" size=\"3\" face=\"Calibri\"><A href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ee373842(v=VS.100).aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ee373842(v=VS.100).aspx<\/A><\/FONT><\/FONT><\/SPAN><\/SPAN><\/LI>\n<LI><SPAN><SPAN><FONT face=\"Arial\">Silverlight Binding: <FONT color=\"#0000ff\" size=\"3\" face=\"Calibri\"><A href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ee681614(v=VS.95).aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ee681614(v=VS.95).aspx<\/A><\/FONT><\/FONT><\/SPAN><\/SPAN><\/LI><\/UL>\n<P class=\"MsoListParagraph\"><SPAN><SPAN><FONT size=\"3\"><\/FONT><\/SPAN><\/SPAN><\/P>\n<P>\n<P><B>Providing Feedback<\/B><B><\/B><\/P>\n<P>The forum intended for questions on all current versions of ADO.NET Data Services is available at: <A href=\"http:\/\/social.msdn.microsoft.com\/Forums\/en-US\/adodotnetdataservices\/threads\/\">(http:\/\/social.msdn.microsoft.com\/Forums\/en-US\/adodotnetdataservices\/threads\/<\/A> )<\/P>\n<P>I look forward to hearing your feedback.<\/P>\n<P>Shayne Burgess<\/P>\n<P>Program Manager, Data Services<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post is an update to an introduction to the data binding capabilities we first added in Data Services v1.5 CTP1. We have taken the feedback received throughout the CTPs and made updates to the final design. Below is an update to the original binding post for CTP1 updated based on that feedback. Introduction [&hellip;]<\/p>\n","protected":false},"author":512,"featured_media":3253,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1373","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-odata"],"acf":[],"blog_post_summary":"<p>This blog post is an update to an introduction to the data binding capabilities we first added in Data Services v1.5 CTP1. We have taken the feedback received throughout the CTPs and made updates to the final design. Below is an update to the original binding post for CTP1 updated based on that feedback. Introduction [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/1373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/users\/512"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/comments?post=1373"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/1373\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media\/3253"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media?parent=1373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/categories?post=1373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/tags?post=1373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}