Upload
reese-hyett
View
230
Download
5
Embed Size (px)
Citation preview
Overview
• What is MVVM (And why do I care?)
• Getting Started (What is Caliburn.Micro?)
• Slides are Pointless (Let’s write some code!)
• Hello, World is Boring (Let’s do something real)
• Review / Q&A
Assumptions
• This is an intermediate (200) level presentation
• Working knowledge of C# and .Net needed
• You do NOT need to know what IoC or Convention-over-configuration mean
• You do NOT need to know XAML
• Though it will help
MVVM Explained
• Model-View-ViewModel
• Data is pulled by UI, not pushed to it
• Complete separation between interface and code
Benefits of MVVM
• Testable!
• UI/UX developers can focus on their job
• Cleaner, more maintainable code
What is Caliburn.Micro?
• Fully featured MVVM framework
• Utilizes IoC and convention-over-configuration
• Fully customizable and extremely flexible
• Under 3K LoC (lean and easy to modify)
• Supports WPF, Silverlight, Windows Phone and Windows RT
• Available at http://caliburnmicro.codeplex.com
Why use Caliburn.Micro?
• Don’t reinvent the wheel
• Conventions and Actions
• Built-in support for IoC (typically the MEF)
• Already has support for all major .net environments
Before We Begin
• Sample code and presentation are available online
• We will be starting from scratch
• If you’ve got Visual Studio on your laptop, feel free to follow along
Creating the Project
• Create a new WPF application
• Install Caliburn.Micro from NuGet
• Configure bootstrapper
Wiring It Up
• Create our first View
• Create our first ViewModel
• Demonstrate Data Binding and Actions
Let’s Talk to Netflix
• Anyone know what Odata is?
• Odata is a great idea with a so-so implementation
• Somebody saw SOAP and WSDL and said “What the fuck is this?”
• Think of it as SOAP-but-better (not exactly high praise)
• .Net 3.5 and higher have native support, integrates with LINQ
• Netflix has an Odata endpoint, making our lives easier
Okay, Let’s *ACTUALLY* Talk to Netflix
• Done complaining about Odata
• Add service reference in visual studio
• Create a helper class to handle querying Netflix
• .Net’s Odata support works with LINQ (easy peasy!)
MVVM Review
• Cleaner, more readable code
• Modular, testable
• Separation of UI from code
• Means UI/UX developers don’t need to know jack about programming
• Pull, not push
• Stop creating a ton of controls in code-behind, let the UI handle all that