mvvm avançado para o windows phone 7 wph304 andré carlucci arquiteto de soluções way2 technology
TRANSCRIPT
MVVM avançado para o Windows Phone 7WPH304
André CarlucciArquiteto de SoluçõesWay2 Technology
Mais um acrônimo esquisito?
MVVMMVC? MVP? ASDF?
APPI306: Alexandre Nardi, Jorge Tessinoe Leandro Lopes: 17:20
MVVM
Model – View - ViewModel
OrtogonalidadeTestabilidade
Blendabilidade
Presentation Model (MVVM)
Data Binding
Model View
Controller(ViewModel)
MVVM - DataBinding
DataContext->Titulo
DataContext->Data
DataContext->Descrição
View ViewModel
INotifyPropertyChanged
Aos interessados, novos valores!
Opa, vou me atualizar já!
View ViewModel
demo
Conectando View e ViewModel
Ações de Usuário
Comandos
Mensagem da view para o viewmodelAplicável à
controles “button based”
ICommand interfaceEvent to
Command Frameworks
ICommand
Posso executar?
Hmm... Ok!
Comando.Execute!
NotifyPropertyChanged
Model ViewModel
demo
Mapeando eventos para métodos
Separação de Responsabilidades
O que não fica no ViewModel?
Chamadas para storage
WebServicesNavegação
O que for difícil de testar
demo
Turbinando os ViewModelscom Serviços
Fornecendo dados de design
Pra quê?
Ver os dados em design mode
Facilita a vida do designer
Verificação visual de bindings
Como?
Serviços reais não funcionam no designerUse serviços que fornecem dados “fake”
Service Providers
If (Em Modo Design) Use serviços de design
ElseUse serviços reais
demo
Criando Design Time Data
Comunicação Desacoplada
Message Broker
PublicarMensagem
Mensagem
Mensagem
ViewModel
Messenger
ViewModel
View
Serviço
demo
Utilizando umEvent Aggregator
Conteúdo Relacionadotechnet.microsoft.com/pt-br/query/gg490347
Sudoku
create.msdn.com / Ferramentas e SDK
msdn.microsoft.com/pt-br/windowsphone
www.andrecarlucci.com
msdn.microsoft.com/pt-br/hh230679?ocid=otc-n-br-dca--ted_phone
Palestras RelacionadasAPPI306 | MVC, MVP e MVVM: Uma Comparação
de Padrões Arquiteturais: 18:30
Resource 2
Resource 3
Resource 4
Recursos
Recursos para IT Pros
Recursos para Desenvolvedores
http://technet.microsoft.com/pt-br
http://msdn.microsoft.com/pt-br
Getthefreemobileappforyourphonehttp://gettag.mobi
Getthefreemobileappforyourphonehttp://gettag.mobi
© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
?André Carlucciandrecarlucci.com@andrecarlucci
Não esqueça de preencher sua
avaliação onlinewww.teched.com.br/
avaliacao
Getthefreemobileappforyourphonehttp://gettag.mobi
© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.