Oct 9th 2014
Coding 101 38
C#: Building an App 2/4
In the last episode, we talked about using APIs to access information on Google's Servers. -- If we were to put this in the context of the MVVM model. (Model View View Model), we worked on the Model. -- Our code allowed the model to access external data and bring it into the program. ** Today, we need to play with the ViewModel -- The part of the program that's going to put that external data into a format that is useful and determine WHAT data will be useful to the "View" MVVM Rehashed! * This is how the "MVVM" (Model View ViewModel) pattern works The "Model" * An object that contains all the data and information that we have to use. * It can also contain the API's that are necessary to GET the data and information that we have to use. * In a App... the "Model" is our bridge to the outside world The "ViewModel" * This is the "interface" between the Model and the View * This is the piece that introduces "Presentation Separation" -- It gets to decide which data from the model is place in the View -- It gets to decide which input from the view (from the user) is pushed back to the Model The "View" is the UI: It's the later that the User interacts with. -- Some call it the "presentation" -- The View can tak the data and information contained within the "Model" object and organize it in order to make it more presentable to the user ** In MVVM, the "View" is 'active' -- That means that is "aware" of the "Model" -- It can change and reorganize depending on the data that is in the "Model" Let's talk about "Data Binding" * In it's most simple form, "data binding" is programming to establish some sort of connection between the UI and the "Business Logic" or data * We "BIND" because we want the UI to change depending on what's happening with the Data. ** In our example... we want the UI to represent the data that is being pulled and prepared
Get in Touch With Us!
* Subscribe and get Coding 101 automatically at TWiT.tv! * Follow PadreSJ and Snubs on Twitter. * Watch the show live and join the chatroom every Thursday at 1:30pm PST. * Email us at Padre@twit.tv and Shannon@twit.tv. * Join our Google+ Community! * Check out our transcripts. Bandwidth for Coding 101 is provided by Cachefly.