MVVM avançado para o Windows Phone 7 WPH304 André Carlucci Arquiteto de Soluções Way2 Technology Mais um acrônimo esquisito? MVVM MVC? MVP? ASDF? APPI306: Alexandre Nardi, Jorge Tessino e Leandro Lopes: 17:20 MVVM Model – View - ViewModel Ortogonalidade Testabilidade Blendabilidade Presentation Model (MVVM) Data Binding MVVM - DataBinding DataContext->Titulo DataContext->Data DataContext->Descrição INotifyPropertyChanged Aos interessados, novos valores! Opa, vou me atualizar já! Conectando View e ViewModel Ações de Usuário Comandos Mensagem da view para o viewmodel Aplicável à controles “button based” ICommand interface Event to Command Frameworks ICommand Posso executar? Hmm... Ok! Comando.Execute! NotifyPropertyChanged Mapeando eventos para métodos Separação de Responsabilidades O que não fica no ViewModel? Chamadas para storage WebServices Navegação O que for difícil de testar Turbinando os ViewModels com 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 designer Use serviços que fornecem dados “fake” Service Providers If (Em Modo Design) Use serviços de design Else Use serviços reais Criando Design Time Data Comunicação Desacoplada Message Broker Mensagem Publicar Mensagem Mensagem Utilizando um Event Aggregator Conteúdo Relacionado technet.microsoft.com/pt-br/query/gg490347 Sudoku create.msdn.com / Ferramentas e SDK msdn.microsoft.com/pt-br/windowsphone msdn.microsoft.com/pt-br/hh230679?ocid=otc-n-br-dca-ted_phone www.andrecarlucci.com Palestras Relacionadas APPI306 | MVC, MVP e MVVM: Uma Comparação de Padrões Arquiteturais: 18:30 Resource 2 Resource 3 Resource 4 Get the free mobile app for your phone http:/ / gettag.mobi http://technet.microsoft.com/pt-br Get the free mobile app for your phone http:/ / gettag.mobi http://msdn.microsoft.com/pt-br André Carlucci andrecarlucci.com @andrecarlucci © 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. Não esqueça de preencher sua avaliação online www.teched.com.br/avaliacao Get the free mobile app for your phone http:/ / 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.