Real world Windows Phone development

Slides:



Advertisements
Similar presentations
Module 1: Creating an Application by Using Windows Presentation Foundation Overview of WPF Creating a Simple WPF Application Handling Events and Commands.
Advertisements

Expression Blend 4 – deep dive
MVVM Basics with Caliburn.Micro Presented by Stefan Nuxoll, Lithium PC.
Understanding the MVVM pattern
Developing HTML5 Application using MVVM pattern Pekka Ylenius.
USING THE MODEL-VIEW- VIEWMODEL PATTERN Laurent Bugnion Director, User Experience Integration IdentityMine
Lessons learned from developing a Windows 8 Metro application in C# Frode Nilsen Nilsen Labs Ticki.
CROSS PLATFORM DEVELOPMENT WITH MVVM CROSS By Ken Tucker.
An Introduction to the Model-View-ViewModel Pattern Srsly? Another MV* Pattern? Srsly? Another MV* Pattern?
Dinko Jakovljević Microsoft Student Partner | BambooLab
Essentials of Developing Windows Phone Apps Chinthaka Dissanayake Tech Lead Exilesoft.
An Introduction To Silverlight Gergely Orosz
Laurent Bugnion Senior User Experience Integrator IdentityMine
Cross-Training in Silverlight and Flex Brian Genisio.
Real world Windows Phone development Igor
Building Silverlight Applications Using the MVVM pattern An Introduction by Peter Messenger Senior Developer – Qmastor
© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg.
Agenda Unit Test Framework for the XAML app developer Automated end-user testing using Coded UI Test Q&A.
Hot Tuna CROSS PLATFORM DEVELOPMENT WITH.NET, XAMARIN AND MVVMCROSS.
Developing Mobile Applications using MVVM with Xamarin Forms
@benday #vslive Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
.NET Database Technologies: Introduction to WPF and Entity Framework DataBinding.
Introduction to Silverlight. Slide 2 What is Silverlight? It’s part of a Microsoft Web platform called Rich Internet Applications (RIA) There is a service.
An Introduction to Silverlight Matt Harrington Developer Evangelist, Microsoft October 20, 2011.
Windows Phone 8 Tips & Tricks for Developers Sascha Corti, Microsoft Switzerland Technical Evangelist | techpreacher.corti.com.
Getting Started with Caliburn.Micro and Windows Phone 7 Gary Ewan Park Twitter: Blog:
Object Oriented Software Development 9. Creating Graphical User Interfaces.
Windows Phone MVVM and Unit Testing Step by Step Andy Wigley Windows Phone Development MVP, Mobile Software Consultant APPA Mundi Ltd WPH208.
Nikhil Kothari Software Architect Microsoft Corporation Session Code: WUX312.
Windows 10 UWP MVVM In Depth
04 |Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio Ben Riga
Model View ViewModel Architecture. MVVM Architecture components.
05 | Xamarin Forms, kódosztási technikák Farkas Bálint | Technical Evangelist | Microsoft.
Windows 8 apps and the MVVM pattern SILVERLIGHTSHOW.NET WEBINARS SERIES GILL CLEEREN, October 16 th
Programming with MVVM Miguel A. Castro Architect -
Vladimir Milev New Venture Software Sharing Code between WPF and Universal Apps.
/DEV/TM #1 Building Cross-Platform Apps with Xamarin and MvvmCross Flavius-Radu DEMIAN.
Igor Ralić igrali.com Open source u razvoju Windows Phone aplikacija.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
The cutting edge event for ITPros and Devs December 7-8, 2013 Athens, Greece Fix it once use it everywhere Elias Markelis MCT, Windows Phone Enthusiast.
Windows App Studio Windows App Studio is the tool that makes it fast and easy to build Windows 10 apps. It’s accessible from any device with a browser.
Adam Schultz MVVM and WPF. MVVM Model, View, ViewModel A software architecture designed to separate out User Interface design, Business Logic, and Data.
Xamarin Development with
In Windows 8 Store Applications
MVVM Made Simple with Prism
Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
Ben Riga 02 | Basics of View Models Ben Riga
Build Windows 10 UWP MVVM Apps with Prism
It’s a Knockout! MVVM Style Web Development
XAML User Interface Creation in C#
Unit Testing & Test-Driven Development for Mere Mortals
Introduction to Silverlight
Miguel A. Castro Architect IDesign
Unit Testing & Test-Driven Development for Mere Mortals
Sviluppo mobile con Visual Studio OnLine
Introduction to the MVVM Pattern
.NET and .NET Core Foot View of .NET Pan Wuming 2017.
An introduction to MVVM using WPF NISCHAL S
Tech Ed North America /1/2018 4:27 PM Required Slide
1/10/2019 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.
What’s new for Windows 8 Devs Part 2
Unit Testing & Test-Driven Development for Mere Mortals
Building Metro style apps with XAML with .NET
Microsoft Office 4/3/2019 Deep Dive into native Universal App development with the Office 365 APIs Speaker name Title Microsoft Corporation © 2012 Microsoft.
TechEd /4/2019 3:19 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
XAML Deep Dive for Windows & Windows Phone Apps Jump Start
Architecting Silverlight Applications with MVVM
Dot Net Application PROF. S. LAKSHMANAN, DEPT. OF B. VOC. (SD & SA),
Bringing existing managed code into Metro style apps
An Introduction to the Model-View-ViewModel Pattern
Presentation transcript:

Real world Windows Phone development Igor Kulman igor@kulman.sk @igorkulman

About Igor Kulman Windows Phone and Microsoft Azure developer at Inmite Developing for Windows Phone since 2011 web: http://www.kulman.sk, blog: http://blog.kulman.sk, github: https://github.com/igorkulman

Develop maintanable and testable Windows Phone applications Goal Develop maintanable and testable Windows Phone applications

Agenda Model-View-ViewModel (MVVM) Caliburn.Micro INotifyPropertyChanged (Fody) Nuget Portable Class Libraries (PCL) Testing (MSTest, Moq)

Model-View-ViewModel Design pattern from Microsoft simillar to MVC Separating UI, app logic and business logic Data binding, messaging, commands Typically also DI Popular frameworks: MVVMLight, Caliburn.Micro, PRISM

Model-View-ViewModel Advantages more testable more maintanable easier to do DI Notes View-specific stuff should be still handled in code-behind

Model-View-ViewModel

Bindings Referencing properties from ViewModel or ther componetns in View One-Way, Two-Way

Converters Convert data used in bindings from one format to another Keep your ViewModel "clean" Implement IValueConverter Use as StaticResource

INotifyPropertyChanged Interface telling the UI that a property in ViewModel has changed Necessary for data binding

Fody.PropertyChanged Fody is a il-weaver for .NET Fody.PropertyChanged adds to INotifyPropertyChanged every property so you do not have to https://github.com/Fody/Fody#addins-list

Commands Commands provide a separation between a user interface and logic. A command is an object that implements the ICommand interface. Generally, it is associated with a function in some code. User interface elements bind to commands - when they are activated by the user the command is fired - which calls the associated function. Commands know if they are enabled or not. A function can disable the command object - automatically disabling any user interface elements associated with it.

Commands Implement ICommand Execute - method to execute CanExecute - determines whether the command can execute in its current state Binding in XAML

Messaging Sending messages between ViewModels and Views avoid tight coupling Communication between View and ViewModel when a binding cannot be used (e.g: animations)

Nuget package manager for .NET project open to everyone (my packages) web repository, search Visual Studio and PowerShell integration handling dependencies, upgrades restoring packages at build

Creating a new Windows Phone project with packages from Nuget DEMO Creating a new Windows Phone project with packages from Nuget

Portable Class Libraries Libraries that target more than one .NET Framework platform WP8, WP81, WinRT, Silverlight, XBOX, Support for Mono (Xamarin.iOS / Android) No platform specific stuff (I/O, Settings, etc.)

Portable Class Libraries When to start with PCL more platforms no platform specific stuff Recommendation start with a Windows Phone Class Library convert to PCL later

Adding PCL with business logic to the project DEMO Adding PCL with business logic to the project

Testing the PCL Testing your business logic is a good practice Many testing frameworks: MSTest, NUnit, xUnit Testing async method is not a problem

MSTest built into Visual Studio run from Visual Studio, Resharper, FAKE decorating methods with attributes

Add test project and tests for PCL DEMO Add test project and tests for PCL

Caliburn.Micro mature MVVM framework for WPF, Sliverlight, Windows Phone, Windows 8 based on conventions simple DI container messaging model based on System.Interactivity (Blend support) works with Fody.PropertyChanged

Caliburn.Micro Bootstrapper registered in App.xaml app strating point register ViewModels and Services override things like frame creation

Caliburn.Micro Conventions Views directory with {X}View ViewModels directory with {X}ViewModel Binding button click event to methods by name Binding ListBox item source and selected item by name TextBox two way binding by name

Caliburn.Micro Actions used instead of Commands for iteractions from View can be bound to any event Parameters: $eventArgs, $dataContext, $source, $view, $executionContext, $this

Caliburn.Micro Services INavigationService IEventAggregator

INavigationService No need to register, always available ViewModel first (Multiple) navigation parameters

IEventAggregator No need to register, always available Publishing messages Need to subscribe for handling, implement IHandle<T>

Add Caliburn.Micro to project, implement Views and ViewModels DEMO Add Caliburn.Micro to project, implement Views and ViewModels

Testing the ViewModel Testing ViewModels is "nice to have" Mocking services, testing just the ViewModel Mocking framework: Moq

Moq Mocking an interface Mocking with distinct behaviour

Add tests for ViewModel DEMO Add tests for ViewModel

Do not be one of the boring black pivot apps And design matters! Do not be one of the boring black pivot apps

Resources Demo source code: https://github.com/igorkulman/muni-talk-2014 Fody http://blog.kulman.sk/inotifypropertychanged-the-easy-way-in-windows-phone-and-windows-8/ Caliburn.Micro http://wp.qmatteoq.com/first-steps-with-caliburn-micro-in-windows-phone-8-the-theory/