SlideShare a Scribd company logo
1 of 39
1
2
Denis Voituron
Civil engineer (Mons)
Company founder
Developer: VB3, VB.Net, C#
.Net Software Architect (Trasys)
Blogger
Speaker (DevApps.be)
3
• Introduction
• Getting Started
• Services and DesignServices
• Localization
• Commands
• Messenger
• Unit Tests and TestServices
4
5
6
Pattern
Model
Business Logic
View
Presentation UI
ViewModel
Presentation Logic
Command
Binding
Method call
Event
MVVMMODEL VIEW VIEWMODEL
7
Pattern
Model
Business Logic
View
Presentation UI
ViewModel
Presentation Logic
Command
Binding
Method call
Event
Friend
FirstName
LastName
DateOfBirth
PictureUrl
ObservableObject
FriendPage
<Page DataContext="{Binding ViewModel}">
<TextBlock Text="{Binding FullName}" />
<TextBlock Text="{Binding Age}" />
<Image Source="{Binding Photo}" />
</Page>
FriendViewModel
FullName
Age
Photo
ViewModelBase
8
• Code behind is not always bad,
but can complicate things.
• MVVM is a variation of MVC.
• The goal is to decouple
the View from the Model.
• Easier to maintain.
• Easier to test
• Allow to create design time data.
@LBugnion
9
MVVM Light v5
Toolkit to help MVVM developments
Open Source project
Supported by Microsoft
http://www.mvvmlight.net
10
11
12
Window Dialog Page View
13
public class Friend
{
public int ID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Picture { get; set; }
public string Location { get; set; }
public string Message { get; set; }
}
public class Friend : ObservableObject
{
private string _firstName = String.Empty;
public string FirstName
{
get { return _firstName; }
set
{
Set(() => this.FirstName, ref _firstName, value);
}
}
Model
14
public interface IDataService
{
Task<Friend[]> GetFriendsAsync();
}
public class DataService : IDataService
{
public async Task<Friend[]> GetFriendsAsync()
{
...
}
}
public class DesignDataService : IDataService
{
public async Task<Friend[]> GetFriendsAsync()
{
...
}
}
Model
15
public class MainViewModel
{
public MainViewModel()
{
_dataService = new DataService();
}
}
public class MainViewModel
{
public MainViewModel(IDataService dataservice)
{
_dataService = dataservice;
}
}
DataService for Test, for Production, for Design, …
16
public class ViewModelLocator
{
public ViewModelLocator()
{
// SimpleIoC
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
// Models
if (ViewModelBase.IsInDesignModeStatic)
SimpleIoc.Default.Register<IDataService, DataService>();
else
SimpleIoc.Default.Register<IDataService, DesignDataService>();
// ViewModels
SimpleIoc.Default.Register<ViewModels.MainViewModel>();
}
}
View
Model
<Application xmlns:locator="using:SampleMvvmLight.ViewModels" ... >
<Application.Resources>
<locator:ViewModelLocator x:Key="ViewModelLocator" />
</Application.Resources>
</Application>
17
public abstract class ViewModelBase : GalaSoft.MvvmLight.ViewModelBase
{
// Default constructor used by the Design or Production Mode
public ViewModelBase() : this(ServiceLocator.Current.GetInstance<Models.IDataService>(),
ServiceLocator.Current.GetInstance<IDialogService>(),
ServiceLocator.Current.GetInstance<INavigationService>())
{
if (ViewModelBase.IsInDesignModeStatic) OnLoadedAsync();
}
// Default constructor with all usable services
protected ViewModelBase(IDataService dataservice,
IDialogService dialogService,
INavigationService navigationService)
{
this.DateService = dataservice;
this.DialogService = dialogService;
this.NavigationService = navigationService;
}
}
View
Model
18
Snippet ‘mvvminpcsetlambda’
View
Model
public class MainViewModel : ViewModelBase
{
protected async override Task OnLoadedAsync()
{
this.Friends = await this.DateService.GetFriendsAsync();
}
private Friend[] _friends = null;
public Friend[] Friends
{
get
{
return _friends;
}
set
{
Set(() => Friends, ref _friends, value);
}
}
}
19
private ViewModels.MainViewModel ViewModel
{
get { return ((MainViewModel)Resources["ViewModel"]); }
}
View
<Page xmlns:vm="using:SampleMvvmLight.ViewModels">
<!-- Create a new instance of the associated ViewModel -->
<Page.Resources>
<vm:MainViewModel x:Key="ViewModel" />
</Page.Resources>
<!-- Content -->
<Grid DataContext="{StaticResource ViewModel}">
<ListView Margin="10,33,10,10"
ItemsSource="{Binding Friends}" />
</Grid>
</Page>
20
Rules for views and view models
User controls vs templated controls
@ricosuter
21
View model instantiation
<MySubView DataContext="{Binding MySubViewModel}" />
<MySubView Project="{Binding SelectedProject}" />
public MyView()
{
InitializeComponent();
Loaded += async delegate { await ViewModel.OnLoaded(); };
Unloaded += async delegate { await ViewModel.OnUnloaded(); };
}
22
23
Interface for testing, designing and running
Sample
public interface IDataService
{
Task<Friend[]> GetFriendsAsync();
}
public class DataService : IDataService
{
const string UrlBase = "http://xxx.azurewebsites.net/friends.aspx";
public async Task<Friend[]> GetFriendsAsync()
{
var client = new HttpClient();
string json = await client.GetStringAsync(new Uri(UrlBase));
var result = JsonConvert.DeserializeObject<ListOfFriends>(json);
return result.Data.ToArray();
}
24
SimpleIoc.Default.Register<IDialogService, DialogService>();
await this.DialogService.ShowMessage ("My message", "My title");
await this.DialogService.ShowMessageBox("My message", "My title");
await this.DialogService.ShowError(MyException, ...);
25
private INavigationService CreateNavigationService()
{
var navigationService = new NavigationService();
navigationService.Configure(MAIN_PAGE, typeof(MainPage));
navigationService.Configure(DETAIL_PAGE, typeof(DetailPage));
return navigationService;
}
...
SimpleIoc.Default.Register<INavigationService>(() => CreateNavigationService());
public class NavigationService : INavigationService
{
public void NavigateTo<T>(string pageKey, T parameter)
{
...
}
public void GoBack()
{
...
}
}
26
Navigate to the second page
Retrieve parameters
public class FirstViewModel : ViewModelBase
{
...
this.NavigationService.NavigateTo<string>(ViewModelLocator.DETAIL_PAGE, "ABC");
}
public class SecondViewModel : ViewModelBase
{
public DetailViewModel()
{
this.NavigationRegistering<int>();
}
protected async override Task OnNavigationFrom(object parameter)
{
this.Friend = await this.DateService.GetFriendAsync((int)parameter);
}
}
27
Resource files
• Resw
Need a T4 file
• Resx
Configurable
MyResources.Culture = new CultureInfo("fr");
CultureInfo.CurrentCulture = new CultureInfo("fr");
28
The following prefixes or postfixes are recommended:
(bigger projects, the keys should start with a module name. e.g. ‘Search_ButtonOK’)
*
*
*
*
*
*
*
*
*
* @ricosuter
29
30
Commands are instantiated in constructor.
• Name "xxxCommand"
• "xxxExecute" and "CanXxxExecute"
public MainViewModel()
{
DisplayDetailCommand = new RelayCommand<Friend>
(DisplayDetailExecute, CanDisplayDetailExecute);
}
public RelayCommand<Friend> DisplayDetailCommand { get; private set; }
public void DisplayDetailExecute(Friend parameter)
{
...
}
public bool CanDisplayDetailExecute(Friend parameter)
{
return true;
}
<Button Command="{Binding DisplayDetailCommand}"
CommandParameter="{Binding SelectedFriend}" />
Snippet ‘mvvmrelaymethodcanexecute’
31
32
• It is an "event bus".
• A message distribution system.
• One default instance
(Messenger.Default)
@LBugnion
33
Messenger.Default.Send<string>("Hello World");
Messenger.Default.Register<string>
(
this,
(message) =>
{
...
}
);
Messenger.Default.Unregister<string>(this);
34
35
• TestDataService
• TestDialogService
• TestNavigationService
• TestServiceRegister
public static void Registering()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
SimpleIoc.Default.Register<IDataService, TestDataService>();
SimpleIoc.Default.Register<IDialogService, TestDialogService>();
SimpleIoc.Default.Register<INavigationService, TestNavigationService>();
}
36
• Initialization
• Test
[TestClass]
public class MainViewModelTests
{
[TestInitialize]
public void Initialize()
{
TestServiceRegister.Registering();
}
}
[TestMethod]
public async Task ComputeNumberOfFriends()
{
MainViewModel main = new MainViewModel();
await main.CallOnLoaded();
Assert.AreEqual(3, main.Friends.Length);
}
37
38
•
•
•
•
•
•
•
•
•
39
Ressources
•
•
•
•
•

More Related Content

What's hot

.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET Core
.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET Core.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET Core
.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET CoreNETFest
 
ADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoHasnain Iqbal
 
droidQuery: The Android port of jQuery
droidQuery: The Android port of jQuerydroidQuery: The Android port of jQuery
droidQuery: The Android port of jQueryPhDBrown
 
Talk about html5 security
Talk about html5 securityTalk about html5 security
Talk about html5 securityHuang Toby
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Mahmoud Hamed Mahmoud
 
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...tdc-globalcode
 
Android Jetpack: ViewModel and Testing
Android Jetpack: ViewModel and TestingAndroid Jetpack: ViewModel and Testing
Android Jetpack: ViewModel and TestingYongjun Kim
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testingsmontanari
 
A test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileA test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileGlobalLogic Ukraine
 
01 Introduction - JavaScript Development
01 Introduction - JavaScript Development01 Introduction - JavaScript Development
01 Introduction - JavaScript DevelopmentTommy Vercety
 
MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!Roberto Messora
 
Mvvmintroduction 130725124207-phpapp01
Mvvmintroduction 130725124207-phpapp01Mvvmintroduction 130725124207-phpapp01
Mvvmintroduction 130725124207-phpapp01Nguyen Cuong
 
Deep dive into Android Data Binding
Deep dive into Android Data BindingDeep dive into Android Data Binding
Deep dive into Android Data BindingRadek Piekarz
 
Designing a ui for microservices @ .NET Day Switzerland 2019
Designing a ui for microservices @ .NET Day Switzerland 2019Designing a ui for microservices @ .NET Day Switzerland 2019
Designing a ui for microservices @ .NET Day Switzerland 2019Mauro Servienti
 
Practical Experience Building JavaFX Rich Clients
Practical Experience Building JavaFX Rich ClientsPractical Experience Building JavaFX Rich Clients
Practical Experience Building JavaFX Rich ClientsRichard Bair
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web developmentJohannes Brodwall
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)Michael Kurz
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
 

What's hot (20)

.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET Core
.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET Core.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET Core
.NET Fest 2017. Михаил Щербаков. Механизмы предотвращения атак в ASP.NET Core
 
ADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
 
droidQuery: The Android port of jQuery
droidQuery: The Android port of jQuerydroidQuery: The Android port of jQuery
droidQuery: The Android port of jQuery
 
Talk about html5 security
Talk about html5 securityTalk about html5 security
Talk about html5 security
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
 
Android Jetpack: ViewModel and Testing
Android Jetpack: ViewModel and TestingAndroid Jetpack: ViewModel and Testing
Android Jetpack: ViewModel and Testing
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testing
 
Data binding w Androidzie
Data binding w AndroidzieData binding w Androidzie
Data binding w Androidzie
 
A test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobileA test framework out of the box - Geb for Web and mobile
A test framework out of the box - Geb for Web and mobile
 
01 Introduction - JavaScript Development
01 Introduction - JavaScript Development01 Introduction - JavaScript Development
01 Introduction - JavaScript Development
 
MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!
 
Mvvmintroduction 130725124207-phpapp01
Mvvmintroduction 130725124207-phpapp01Mvvmintroduction 130725124207-phpapp01
Mvvmintroduction 130725124207-phpapp01
 
Deep dive into Android Data Binding
Deep dive into Android Data BindingDeep dive into Android Data Binding
Deep dive into Android Data Binding
 
Designing a ui for microservices @ .NET Day Switzerland 2019
Designing a ui for microservices @ .NET Day Switzerland 2019Designing a ui for microservices @ .NET Day Switzerland 2019
Designing a ui for microservices @ .NET Day Switzerland 2019
 
Practical Experience Building JavaFX Rich Clients
Practical Experience Building JavaFX Rich ClientsPractical Experience Building JavaFX Rich Clients
Practical Experience Building JavaFX Rich Clients
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009
 

Viewers also liked

Architecture et Bonnes pratiques Android #DevoxxFr2016 Part1
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part1Architecture et Bonnes pratiques Android #DevoxxFr2016 Part1
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part1Mathias Seguy
 
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part2
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part2Architecture et Bonnes pratiques Android #DevoxxFr2016 Part2
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part2Mathias Seguy
 
The 2016 Android Developer Toolbox [NANTES]
The 2016 Android Developer Toolbox [NANTES]The 2016 Android Developer Toolbox [NANTES]
The 2016 Android Developer Toolbox [NANTES]Nilhcem
 
Animate Me! if you don't do it for me, do it for Chet - DroidconLondon2015
Animate Me! if you don't do it for me, do it for Chet - DroidconLondon2015Animate Me! if you don't do it for me, do it for Chet - DroidconLondon2015
Animate Me! if you don't do it for me, do it for Chet - DroidconLondon2015Mathias Seguy
 
Microsoft Experieces 2016 - Retour d’expériences sur TFS Online
Microsoft Experieces 2016 - Retour d’expériences sur TFS OnlineMicrosoft Experieces 2016 - Retour d’expériences sur TFS Online
Microsoft Experieces 2016 - Retour d’expériences sur TFS OnlineDenis Voituron
 
Animate Me, if you don't do it for me do it for chet (DroidCon Paris)
Animate Me, if you don't do it for me do it for chet (DroidCon Paris)Animate Me, if you don't do it for me do it for chet (DroidCon Paris)
Animate Me, if you don't do it for me do it for chet (DroidCon Paris)Mathias Seguy
 
Voyage en monde Android. Trucs et astuces tout au long de la route.
Voyage en monde Android. Trucs et astuces tout au long de la route.Voyage en monde Android. Trucs et astuces tout au long de la route.
Voyage en monde Android. Trucs et astuces tout au long de la route.Mathias Seguy
 
Google Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleGoogle Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleMathias Seguy
 
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...Mathias Seguy
 
Mise en place de l'ActionBarCompat dans vos projets Android.
Mise en place de l'ActionBarCompat dans vos projets Android.Mise en place de l'ActionBarCompat dans vos projets Android.
Mise en place de l'ActionBarCompat dans vos projets Android.Mathias Seguy
 
The Business Event Bus
The Business Event BusThe Business Event Bus
The Business Event BusJoris Meijer
 
Android2EE training: Tutorials list of Android projects
Android2EE training: Tutorials list of Android projectsAndroid2EE training: Tutorials list of Android projects
Android2EE training: Tutorials list of Android projectsMathias Seguy
 
Animate me, If you don't do it for me do it for Chet :)
Animate me, If you don't do it for me do it for Chet :)Animate me, If you don't do it for me do it for Chet :)
Animate me, If you don't do it for me do it for Chet :)Mathias Seguy
 
Treatment, Architecture and Threads
Treatment, Architecture and ThreadsTreatment, Architecture and Threads
Treatment, Architecture and ThreadsMathias Seguy
 
Visual Studio 2015: Increase your Productivity
Visual Studio 2015: Increase your ProductivityVisual Studio 2015: Increase your Productivity
Visual Studio 2015: Increase your ProductivityDenis Voituron
 
TDC2016POA | Trilha Arquitetura - CQRS e Event Driven Architecture valem a p...
TDC2016POA | Trilha Arquitetura -  CQRS e Event Driven Architecture valem a p...TDC2016POA | Trilha Arquitetura -  CQRS e Event Driven Architecture valem a p...
TDC2016POA | Trilha Arquitetura - CQRS e Event Driven Architecture valem a p...tdc-globalcode
 
Introduction To Mobile Application Development
Introduction To Mobile Application DevelopmentIntroduction To Mobile Application Development
Introduction To Mobile Application DevelopmentSyed Absar
 

Viewers also liked (20)

Architecture et Bonnes pratiques Android #DevoxxFr2016 Part1
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part1Architecture et Bonnes pratiques Android #DevoxxFr2016 Part1
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part1
 
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part2
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part2Architecture et Bonnes pratiques Android #DevoxxFr2016 Part2
Architecture et Bonnes pratiques Android #DevoxxFr2016 Part2
 
The 2016 Android Developer Toolbox [NANTES]
The 2016 Android Developer Toolbox [NANTES]The 2016 Android Developer Toolbox [NANTES]
The 2016 Android Developer Toolbox [NANTES]
 
Animate Me! if you don't do it for me, do it for Chet - DroidconLondon2015
Animate Me! if you don't do it for me, do it for Chet - DroidconLondon2015Animate Me! if you don't do it for me, do it for Chet - DroidconLondon2015
Animate Me! if you don't do it for me, do it for Chet - DroidconLondon2015
 
Microsoft Experieces 2016 - Retour d’expériences sur TFS Online
Microsoft Experieces 2016 - Retour d’expériences sur TFS OnlineMicrosoft Experieces 2016 - Retour d’expériences sur TFS Online
Microsoft Experieces 2016 - Retour d’expériences sur TFS Online
 
Animate Me, if you don't do it for me do it for chet (DroidCon Paris)
Animate Me, if you don't do it for me do it for chet (DroidCon Paris)Animate Me, if you don't do it for me do it for chet (DroidCon Paris)
Animate Me, if you don't do it for me do it for chet (DroidCon Paris)
 
Voyage en monde Android. Trucs et astuces tout au long de la route.
Voyage en monde Android. Trucs et astuces tout au long de la route.Voyage en monde Android. Trucs et astuces tout au long de la route.
Voyage en monde Android. Trucs et astuces tout au long de la route.
 
Google Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleGoogle Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification Google
 
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
Eclispe daytoulouse combining the power of eclipse with android_fr_1024_768_s...
 
Bonnes pratiques développement android
Bonnes pratiques développement androidBonnes pratiques développement android
Bonnes pratiques développement android
 
Mise en place de l'ActionBarCompat dans vos projets Android.
Mise en place de l'ActionBarCompat dans vos projets Android.Mise en place de l'ActionBarCompat dans vos projets Android.
Mise en place de l'ActionBarCompat dans vos projets Android.
 
The Business Event Bus
The Business Event BusThe Business Event Bus
The Business Event Bus
 
Android2EE training: Tutorials list of Android projects
Android2EE training: Tutorials list of Android projectsAndroid2EE training: Tutorials list of Android projects
Android2EE training: Tutorials list of Android projects
 
Animate me, If you don't do it for me do it for Chet :)
Animate me, If you don't do it for me do it for Chet :)Animate me, If you don't do it for me do it for Chet :)
Animate me, If you don't do it for me do it for Chet :)
 
Treatment, Architecture and Threads
Treatment, Architecture and ThreadsTreatment, Architecture and Threads
Treatment, Architecture and Threads
 
Kafka Utrecht Meetup
Kafka Utrecht MeetupKafka Utrecht Meetup
Kafka Utrecht Meetup
 
Visual Studio 2015: Increase your Productivity
Visual Studio 2015: Increase your ProductivityVisual Studio 2015: Increase your Productivity
Visual Studio 2015: Increase your Productivity
 
TDC2016POA | Trilha Arquitetura - CQRS e Event Driven Architecture valem a p...
TDC2016POA | Trilha Arquitetura -  CQRS e Event Driven Architecture valem a p...TDC2016POA | Trilha Arquitetura -  CQRS e Event Driven Architecture valem a p...
TDC2016POA | Trilha Arquitetura - CQRS e Event Driven Architecture valem a p...
 
ASP.NET Core 1.0 Overview
ASP.NET Core 1.0 OverviewASP.NET Core 1.0 Overview
ASP.NET Core 1.0 Overview
 
Introduction To Mobile Application Development
Introduction To Mobile Application DevelopmentIntroduction To Mobile Application Development
Introduction To Mobile Application Development
 

Similar to Présentation et bonnes pratiques du pattern MVVM - MIC Belgique

Dialogs in Android MVVM (14.11.2019)
Dialogs in Android MVVM (14.11.2019)Dialogs in Android MVVM (14.11.2019)
Dialogs in Android MVVM (14.11.2019)Vladislav Ermolin
 
My way to clean android - Android day salamanca edition
My way to clean android - Android day salamanca editionMy way to clean android - Android day salamanca edition
My way to clean android - Android day salamanca editionChristian Panadero
 
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform....NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...NETFest
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel.NET Conf UY
 
My way to clean android (EN) - Android day salamanca edition
My way to clean android (EN) - Android day salamanca editionMy way to clean android (EN) - Android day salamanca edition
My way to clean android (EN) - Android day salamanca editionChristian Panadero
 
Developing application for Windows Phone 7 in TDD
Developing application for Windows Phone 7 in TDDDeveloping application for Windows Phone 7 in TDD
Developing application for Windows Phone 7 in TDDMichele Capra
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Eyal Vardi
 
Mastering Oracle ADF Bindings
Mastering Oracle ADF BindingsMastering Oracle ADF Bindings
Mastering Oracle ADF BindingsEuegene Fedorenko
 
Test and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 AppTest and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 AppMichele Capra
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...DataLeader.io
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WAREFermin Galan
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Sparkhound Inc.
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsDan Wahlin
 

Similar to Présentation et bonnes pratiques du pattern MVVM - MIC Belgique (20)

MVVM Lights
MVVM LightsMVVM Lights
MVVM Lights
 
Dialogs in Android MVVM (14.11.2019)
Dialogs in Android MVVM (14.11.2019)Dialogs in Android MVVM (14.11.2019)
Dialogs in Android MVVM (14.11.2019)
 
My way to clean android - Android day salamanca edition
My way to clean android - Android day salamanca editionMy way to clean android - Android day salamanca edition
My way to clean android - Android day salamanca edition
 
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform....NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
.NET Fest 2017. Matteo Pagani. Prism and Xamarin Forms: create cross-platform...
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel
 
My way to clean android (EN) - Android day salamanca edition
My way to clean android (EN) - Android day salamanca editionMy way to clean android (EN) - Android day salamanca edition
My way to clean android (EN) - Android day salamanca edition
 
Developing application for Windows Phone 7 in TDD
Developing application for Windows Phone 7 in TDDDeveloping application for Windows Phone 7 in TDD
Developing application for Windows Phone 7 in TDD
 
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
 
Mastering Oracle ADF Bindings
Mastering Oracle ADF BindingsMastering Oracle ADF Bindings
Mastering Oracle ADF Bindings
 
Test and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 AppTest and profile your Windows Phone 8 App
Test and profile your Windows Phone 8 App
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
 
Asp.NET MVC
Asp.NET MVCAsp.NET MVC
Asp.NET MVC
 
Valentine with AngularJS
Valentine with AngularJSValentine with AngularJS
Valentine with AngularJS
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
Knockout.js
Knockout.jsKnockout.js
Knockout.js
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight Applications
 

More from Denis Voituron

DevDay 2021 - Codez comme un ninja
DevDay 2021 - Codez comme un ninjaDevDay 2021 - Codez comme un ninja
DevDay 2021 - Codez comme un ninjaDenis Voituron
 
Azure DevOps Tests Plan
Azure DevOps Tests PlanAzure DevOps Tests Plan
Azure DevOps Tests PlanDenis Voituron
 
.Net passé, présent et futur
.Net passé, présent et futur.Net passé, présent et futur
.Net passé, présent et futurDenis Voituron
 
MIC QRS "JWT, la superstar pour sécuriser vos WebAPI"
MIC QRS "JWT, la superstar pour sécuriser vos WebAPI"MIC QRS "JWT, la superstar pour sécuriser vos WebAPI"
MIC QRS "JWT, la superstar pour sécuriser vos WebAPI"Denis Voituron
 
Azure Pipelines - Et si on arrêtait de mettre en production avec des Disquettes
Azure Pipelines - Et si on arrêtait de mettre en production avec des DisquettesAzure Pipelines - Et si on arrêtait de mettre en production avec des Disquettes
Azure Pipelines - Et si on arrêtait de mettre en production avec des DisquettesDenis Voituron
 
GitHub et Microsoft Azure DevOps - Le mariage parfait
GitHub et Microsoft Azure DevOps - Le mariage parfaitGitHub et Microsoft Azure DevOps - Le mariage parfait
GitHub et Microsoft Azure DevOps - Le mariage parfaitDenis Voituron
 
Les méthodes agiles dans TFS
Les méthodes agiles dans TFSLes méthodes agiles dans TFS
Les méthodes agiles dans TFSDenis Voituron
 
Awareness Oniryx - Mai 2018
Awareness Oniryx - Mai 2018Awareness Oniryx - Mai 2018
Awareness Oniryx - Mai 2018Denis Voituron
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScriptDenis Voituron
 
Procédures CLR pour SQL Server : avantages et inconvénients
Procédures CLR pour SQL Server : avantages et inconvénientsProcédures CLR pour SQL Server : avantages et inconvénients
Procédures CLR pour SQL Server : avantages et inconvénientsDenis Voituron
 
Développer avec un Simple Object Mapping Toolkit pour SQL Server
Développer avec un Simple Object Mapping Toolkit pour SQL ServerDévelopper avec un Simple Object Mapping Toolkit pour SQL Server
Développer avec un Simple Object Mapping Toolkit pour SQL ServerDenis Voituron
 
Les cinq bonnes pratiques des Tests Unitaires dans un projet Agile
Les cinq bonnes pratiques des Tests Unitaires dans un projet AgileLes cinq bonnes pratiques des Tests Unitaires dans un projet Agile
Les cinq bonnes pratiques des Tests Unitaires dans un projet AgileDenis Voituron
 
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping ToolkitDevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping ToolkitDenis Voituron
 
Presentation MIC SummerCamp 2015 WaterStock
Presentation MIC SummerCamp 2015 WaterStockPresentation MIC SummerCamp 2015 WaterStock
Presentation MIC SummerCamp 2015 WaterStockDenis Voituron
 
Visual Studio Online - Outils pour la conception de logiciels - JournéeAgil...
Visual Studio Online - Outils pour la conception de logiciels - JournéeAgil...Visual Studio Online - Outils pour la conception de logiciels - JournéeAgil...
Visual Studio Online - Outils pour la conception de logiciels - JournéeAgil...Denis Voituron
 

More from Denis Voituron (20)

Go lean, Go green
Go lean, Go greenGo lean, Go green
Go lean, Go green
 
DevDay 2021 - Codez comme un ninja
DevDay 2021 - Codez comme un ninjaDevDay 2021 - Codez comme un ninja
DevDay 2021 - Codez comme un ninja
 
Azure DevOps Tests Plan
Azure DevOps Tests PlanAzure DevOps Tests Plan
Azure DevOps Tests Plan
 
.Net passé, présent et futur
.Net passé, présent et futur.Net passé, présent et futur
.Net passé, présent et futur
 
MIC QRS "JWT, la superstar pour sécuriser vos WebAPI"
MIC QRS "JWT, la superstar pour sécuriser vos WebAPI"MIC QRS "JWT, la superstar pour sécuriser vos WebAPI"
MIC QRS "JWT, la superstar pour sécuriser vos WebAPI"
 
Azure Pipelines - Et si on arrêtait de mettre en production avec des Disquettes
Azure Pipelines - Et si on arrêtait de mettre en production avec des DisquettesAzure Pipelines - Et si on arrêtait de mettre en production avec des Disquettes
Azure Pipelines - Et si on arrêtait de mettre en production avec des Disquettes
 
GitHub et Microsoft Azure DevOps - Le mariage parfait
GitHub et Microsoft Azure DevOps - Le mariage parfaitGitHub et Microsoft Azure DevOps - Le mariage parfait
GitHub et Microsoft Azure DevOps - Le mariage parfait
 
Azure for Dev
Azure for DevAzure for Dev
Azure for Dev
 
DevDay 2018 - Blazor
DevDay 2018 - BlazorDevDay 2018 - Blazor
DevDay 2018 - Blazor
 
Les méthodes agiles dans TFS
Les méthodes agiles dans TFSLes méthodes agiles dans TFS
Les méthodes agiles dans TFS
 
Awareness Oniryx - Mai 2018
Awareness Oniryx - Mai 2018Awareness Oniryx - Mai 2018
Awareness Oniryx - Mai 2018
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScript
 
Le futur de .NET
Le futur de .NETLe futur de .NET
Le futur de .NET
 
Procédures CLR pour SQL Server : avantages et inconvénients
Procédures CLR pour SQL Server : avantages et inconvénientsProcédures CLR pour SQL Server : avantages et inconvénients
Procédures CLR pour SQL Server : avantages et inconvénients
 
Développer avec un Simple Object Mapping Toolkit pour SQL Server
Développer avec un Simple Object Mapping Toolkit pour SQL ServerDévelopper avec un Simple Object Mapping Toolkit pour SQL Server
Développer avec un Simple Object Mapping Toolkit pour SQL Server
 
Les cinq bonnes pratiques des Tests Unitaires dans un projet Agile
Les cinq bonnes pratiques des Tests Unitaires dans un projet AgileLes cinq bonnes pratiques des Tests Unitaires dans un projet Agile
Les cinq bonnes pratiques des Tests Unitaires dans un projet Agile
 
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping ToolkitDevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
DevFM #20 : SqlDatabaseCommand, un Simple Object Mapping Toolkit
 
Presentation MIC SummerCamp 2015 WaterStock
Presentation MIC SummerCamp 2015 WaterStockPresentation MIC SummerCamp 2015 WaterStock
Presentation MIC SummerCamp 2015 WaterStock
 
Scrum Guide
Scrum GuideScrum Guide
Scrum Guide
 
Visual Studio Online - Outils pour la conception de logiciels - JournéeAgil...
Visual Studio Online - Outils pour la conception de logiciels - JournéeAgil...Visual Studio Online - Outils pour la conception de logiciels - JournéeAgil...
Visual Studio Online - Outils pour la conception de logiciels - JournéeAgil...
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Présentation et bonnes pratiques du pattern MVVM - MIC Belgique

  • 1. 1
  • 2. 2 Denis Voituron Civil engineer (Mons) Company founder Developer: VB3, VB.Net, C# .Net Software Architect (Trasys) Blogger Speaker (DevApps.be)
  • 3. 3 • Introduction • Getting Started • Services and DesignServices • Localization • Commands • Messenger • Unit Tests and TestServices
  • 4. 4
  • 5. 5
  • 6. 6 Pattern Model Business Logic View Presentation UI ViewModel Presentation Logic Command Binding Method call Event MVVMMODEL VIEW VIEWMODEL
  • 7. 7 Pattern Model Business Logic View Presentation UI ViewModel Presentation Logic Command Binding Method call Event Friend FirstName LastName DateOfBirth PictureUrl ObservableObject FriendPage <Page DataContext="{Binding ViewModel}"> <TextBlock Text="{Binding FullName}" /> <TextBlock Text="{Binding Age}" /> <Image Source="{Binding Photo}" /> </Page> FriendViewModel FullName Age Photo ViewModelBase
  • 8. 8 • Code behind is not always bad, but can complicate things. • MVVM is a variation of MVC. • The goal is to decouple the View from the Model. • Easier to maintain. • Easier to test • Allow to create design time data. @LBugnion
  • 9. 9 MVVM Light v5 Toolkit to help MVVM developments Open Source project Supported by Microsoft http://www.mvvmlight.net
  • 10. 10
  • 11. 11
  • 13. 13 public class Friend { public int ID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Picture { get; set; } public string Location { get; set; } public string Message { get; set; } } public class Friend : ObservableObject { private string _firstName = String.Empty; public string FirstName { get { return _firstName; } set { Set(() => this.FirstName, ref _firstName, value); } } Model
  • 14. 14 public interface IDataService { Task<Friend[]> GetFriendsAsync(); } public class DataService : IDataService { public async Task<Friend[]> GetFriendsAsync() { ... } } public class DesignDataService : IDataService { public async Task<Friend[]> GetFriendsAsync() { ... } } Model
  • 15. 15 public class MainViewModel { public MainViewModel() { _dataService = new DataService(); } } public class MainViewModel { public MainViewModel(IDataService dataservice) { _dataService = dataservice; } } DataService for Test, for Production, for Design, …
  • 16. 16 public class ViewModelLocator { public ViewModelLocator() { // SimpleIoC ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); // Models if (ViewModelBase.IsInDesignModeStatic) SimpleIoc.Default.Register<IDataService, DataService>(); else SimpleIoc.Default.Register<IDataService, DesignDataService>(); // ViewModels SimpleIoc.Default.Register<ViewModels.MainViewModel>(); } } View Model <Application xmlns:locator="using:SampleMvvmLight.ViewModels" ... > <Application.Resources> <locator:ViewModelLocator x:Key="ViewModelLocator" /> </Application.Resources> </Application>
  • 17. 17 public abstract class ViewModelBase : GalaSoft.MvvmLight.ViewModelBase { // Default constructor used by the Design or Production Mode public ViewModelBase() : this(ServiceLocator.Current.GetInstance<Models.IDataService>(), ServiceLocator.Current.GetInstance<IDialogService>(), ServiceLocator.Current.GetInstance<INavigationService>()) { if (ViewModelBase.IsInDesignModeStatic) OnLoadedAsync(); } // Default constructor with all usable services protected ViewModelBase(IDataService dataservice, IDialogService dialogService, INavigationService navigationService) { this.DateService = dataservice; this.DialogService = dialogService; this.NavigationService = navigationService; } } View Model
  • 18. 18 Snippet ‘mvvminpcsetlambda’ View Model public class MainViewModel : ViewModelBase { protected async override Task OnLoadedAsync() { this.Friends = await this.DateService.GetFriendsAsync(); } private Friend[] _friends = null; public Friend[] Friends { get { return _friends; } set { Set(() => Friends, ref _friends, value); } } }
  • 19. 19 private ViewModels.MainViewModel ViewModel { get { return ((MainViewModel)Resources["ViewModel"]); } } View <Page xmlns:vm="using:SampleMvvmLight.ViewModels"> <!-- Create a new instance of the associated ViewModel --> <Page.Resources> <vm:MainViewModel x:Key="ViewModel" /> </Page.Resources> <!-- Content --> <Grid DataContext="{StaticResource ViewModel}"> <ListView Margin="10,33,10,10" ItemsSource="{Binding Friends}" /> </Grid> </Page>
  • 20. 20 Rules for views and view models User controls vs templated controls @ricosuter
  • 21. 21 View model instantiation <MySubView DataContext="{Binding MySubViewModel}" /> <MySubView Project="{Binding SelectedProject}" /> public MyView() { InitializeComponent(); Loaded += async delegate { await ViewModel.OnLoaded(); }; Unloaded += async delegate { await ViewModel.OnUnloaded(); }; }
  • 22. 22
  • 23. 23 Interface for testing, designing and running Sample public interface IDataService { Task<Friend[]> GetFriendsAsync(); } public class DataService : IDataService { const string UrlBase = "http://xxx.azurewebsites.net/friends.aspx"; public async Task<Friend[]> GetFriendsAsync() { var client = new HttpClient(); string json = await client.GetStringAsync(new Uri(UrlBase)); var result = JsonConvert.DeserializeObject<ListOfFriends>(json); return result.Data.ToArray(); }
  • 24. 24 SimpleIoc.Default.Register<IDialogService, DialogService>(); await this.DialogService.ShowMessage ("My message", "My title"); await this.DialogService.ShowMessageBox("My message", "My title"); await this.DialogService.ShowError(MyException, ...);
  • 25. 25 private INavigationService CreateNavigationService() { var navigationService = new NavigationService(); navigationService.Configure(MAIN_PAGE, typeof(MainPage)); navigationService.Configure(DETAIL_PAGE, typeof(DetailPage)); return navigationService; } ... SimpleIoc.Default.Register<INavigationService>(() => CreateNavigationService()); public class NavigationService : INavigationService { public void NavigateTo<T>(string pageKey, T parameter) { ... } public void GoBack() { ... } }
  • 26. 26 Navigate to the second page Retrieve parameters public class FirstViewModel : ViewModelBase { ... this.NavigationService.NavigateTo<string>(ViewModelLocator.DETAIL_PAGE, "ABC"); } public class SecondViewModel : ViewModelBase { public DetailViewModel() { this.NavigationRegistering<int>(); } protected async override Task OnNavigationFrom(object parameter) { this.Friend = await this.DateService.GetFriendAsync((int)parameter); } }
  • 27. 27 Resource files • Resw Need a T4 file • Resx Configurable MyResources.Culture = new CultureInfo("fr"); CultureInfo.CurrentCulture = new CultureInfo("fr");
  • 28. 28 The following prefixes or postfixes are recommended: (bigger projects, the keys should start with a module name. e.g. ‘Search_ButtonOK’) * * * * * * * * * * @ricosuter
  • 29. 29
  • 30. 30 Commands are instantiated in constructor. • Name "xxxCommand" • "xxxExecute" and "CanXxxExecute" public MainViewModel() { DisplayDetailCommand = new RelayCommand<Friend> (DisplayDetailExecute, CanDisplayDetailExecute); } public RelayCommand<Friend> DisplayDetailCommand { get; private set; } public void DisplayDetailExecute(Friend parameter) { ... } public bool CanDisplayDetailExecute(Friend parameter) { return true; } <Button Command="{Binding DisplayDetailCommand}" CommandParameter="{Binding SelectedFriend}" /> Snippet ‘mvvmrelaymethodcanexecute’
  • 31. 31
  • 32. 32 • It is an "event bus". • A message distribution system. • One default instance (Messenger.Default) @LBugnion
  • 34. 34
  • 35. 35 • TestDataService • TestDialogService • TestNavigationService • TestServiceRegister public static void Registering() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); SimpleIoc.Default.Register<IDataService, TestDataService>(); SimpleIoc.Default.Register<IDialogService, TestDialogService>(); SimpleIoc.Default.Register<INavigationService, TestNavigationService>(); }
  • 36. 36 • Initialization • Test [TestClass] public class MainViewModelTests { [TestInitialize] public void Initialize() { TestServiceRegister.Registering(); } } [TestMethod] public async Task ComputeNumberOfFriends() { MainViewModel main = new MainViewModel(); await main.CallOnLoaded(); Assert.AreEqual(3, main.Friends.Length); }
  • 37. 37