SlideShare a Scribd company logo
Braintree
http://www.nrumyantsev.com/




    
    
    





2
3









4
Model                View




            Controller




5
Model                  View

                           DataBinding


            Presentation
               Model
            (ViewModel)



6
7






8
<DataTemplate x:Key="MapTemplate">
           <my:Pushpin Location="{Binding Location}" />
</DataTemplate>

...

<my:Map Name="map1"
        Height="494"
        HorizontalAlignment="Left"
        Margin="20,6,0,0"
        VerticalAlignment="Top"
        Width="444"
        Center="{Binding MapCenter, Mode=TwoWay}"
        ZoomLevel="{Binding MapZoomLevel, Mode=TwoWay}">
        <my:MapItemsControl x:Name="ListOfItems"
                  ItemTemplate="{StaticResource MapTemplate}"
                  ItemsSource="{Binding LocationDataCollection}">
        </my:MapItemsControl>
 </my:Map>




  9


     



     <StackPanel Orientation="Horizontal" Height="22">
             <Label Width="50"> Options: </Label>
             <Button x:Name="Search" Width="100"
                     Command="{Binding SearchCommand}" >Search</Button>
     </StackPanel>




10
public class SearchCommand : ICommand
   {
       private ViewModel viewModel;

         public SearchCommand(ViewModel viewModelInstance)
         {
             viewModel = viewModelInstance;
         }

         #region ICommand Members
         public bool CanExecute(object parameter)
         {
             return true;
         }

         public event EventHandler CanExecuteChanged
         {
             add { CommandManager.RequerySuggested += value; }
             remove { CommandManager.RequerySuggested -= value; }
         }

         public void Execute(object parameter)
         {
             viewModel.Search();
         }
         #endregion
11   }









      http://unity.codeplex.com
12   




     IUnityContainer Container = new UnityContainer();

     if (ViewModelBase.IsInDesignModeStatic)
     {
             Container.RegisterType<IDataService,Design.DesignDataService>();
     }
     else
     {
             Container.RegisterType<IDataService, DataService>();
     }

     Container.RegisterType<MainViewModel>
             (new ContainerControlledLifetimeManager());

13
14
15





     
     
     




16




     <phone:PhoneApplicationPage
       x:Class="MvvmLiteRTM.MainPage"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:vm="clr-namespace:MvvmLiteRTM.ViewModel"
       DataContext="{Binding Main, Source={StaticResource Locator}}"
       shell:SystemTray.IsVisible="True“>




17





     <Button Content=“ZoomIn" Height="72" Name=“ZoomInButton">
        <i:Interaction.Triggers>
             <i:EventTrigger EventName="Click">
               <cmd:EventToCommand Command="{Binding ZoomInCommand}"/>
             </i:EventTrigger>
        </i:Interaction.Triggers>
     </Button>




18






         RelayCommand ZoomOutCommand = new RelayCommand(
                 () =>
                 {
                         MapZoomLevel--;
                 }
         );




    19
View


       View
                          Messages       ViewModel


     ViewModel
                                       View

                 Messages
                 + callback

                                     ViewModel

20





         private void SendMessageWithCallback()
         {
            Messenger.Default.Send(new NotificationMessageAction<string>(
                         "Hello, call me back",
                         SendMessageCallback));
         }

         private void SendMessageCallback(string message)
         {
                 ...
         }

    21
private NotificationMessageAction<string> _lastMessage;

     public void MessageRecipient()
     {
             Messenger.Default.Register<NotificationMessageAction<string>>(
                     this,
                     m =>
                     {
                         MessageTextBox.Text = m.Notification;
                         _lastMessage = m;

                          // Execute callback with parameter
                          _lastMessage.Execute(MessageTextBox.Text);
                    });
     }



22

     http://ultralightmvvm.codeplex.com/

     http://mvvmlight.codeplex.com/

     http://catel.codeplex.com/

     http://caliburnmicro.codeplex.com/


23
     http://www.japf.fr/silverlight/mvvm/index.html
24


     
     
     

     
     


     
     
25

     

     



     
     




26
View                   Feature




     View Model               IFeature




                  Injection




27








28
29

     









30


      http://create.msdn.com
      http://silverlight.codeplex.com/

      Model-View-ViewModel (MVVM) Explained
      WPF Apps With The Model-View-ViewModel Design Pattern - Josh
       Smith
      http://nrumyantsev.com/
      me@nrumyantsev.com


31

More Related Content

What's hot

The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210
Mahmoud Samir Fayed
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency InjectionAnton Kril
 
Calculadora
CalculadoraCalculadora
Calculadora
CBTa 120
 
Awesome State Management for React and Other Virtual-Dom Libraries
Awesome State Management for React and Other Virtual-Dom LibrariesAwesome State Management for React and Other Virtual-Dom Libraries
Awesome State Management for React and Other Virtual-Dom Libraries
FITC
 
Mobile Web 5.0
Mobile Web 5.0Mobile Web 5.0
Mobile Web 5.0
Michael Galpin
 
Magento2&amp;java script (2)
Magento2&amp;java script (2)Magento2&amp;java script (2)
Magento2&amp;java script (2)
EvgeniyKapelko1
 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
Eugene Zharkov
 
Knockout.js Overview
Knockout.js OverviewKnockout.js Overview
Knockout.js Overview민태 김
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testing
smontanari
 
Cycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveCycle.js: Functional and Reactive
Cycle.js: Functional and Reactive
Eugene Zharkov
 
Final tagless and cats mtl
Final tagless and cats mtl Final tagless and cats mtl
Final tagless and cats mtl
Alexander Zaidel
 
Aplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnetAplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnet
Diaz Alfahrezy
 
Everyday's JS
Everyday's JSEveryday's JS
Everyday's JS
Adib Mehedi
 
Windows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows AzureWindows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows AzureVitor Ciaramella
 
Command-Oriented Architecture
Command-Oriented ArchitectureCommand-Oriented Architecture
Command-Oriented Architecture
Luiz Messias
 
2018年のXamarinの概要と活用方法
2018年のXamarinの概要と活用方法2018年のXamarinの概要と活用方法
2018年のXamarinの概要と活用方法
Yoshito Tabuchi
 

What's hot (20)

The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202The Ring programming language version 1.8 book - Part 12 of 202
The Ring programming language version 1.8 book - Part 12 of 202
 
The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210The Ring programming language version 1.9 book - Part 14 of 210
The Ring programming language version 1.9 book - Part 14 of 210
 
Quanlycanbo
QuanlycanboQuanlycanbo
Quanlycanbo
 
Magento Dependency Injection
Magento Dependency InjectionMagento Dependency Injection
Magento Dependency Injection
 
Calculadora
CalculadoraCalculadora
Calculadora
 
Awesome State Management for React and Other Virtual-Dom Libraries
Awesome State Management for React and Other Virtual-Dom LibrariesAwesome State Management for React and Other Virtual-Dom Libraries
Awesome State Management for React and Other Virtual-Dom Libraries
 
Mobile Web 5.0
Mobile Web 5.0Mobile Web 5.0
Mobile Web 5.0
 
Magento2&amp;java script (2)
Magento2&amp;java script (2)Magento2&amp;java script (2)
Magento2&amp;java script (2)
 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
 
Knockout.js Overview
Knockout.js OverviewKnockout.js Overview
Knockout.js Overview
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testing
 
Cycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveCycle.js: Functional and Reactive
Cycle.js: Functional and Reactive
 
jQuery secrets
jQuery secretsjQuery secrets
jQuery secrets
 
Final tagless and cats mtl
Final tagless and cats mtl Final tagless and cats mtl
Final tagless and cats mtl
 
Aplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnetAplikasi rawat-inap-vbnet
Aplikasi rawat-inap-vbnet
 
Coding website
Coding websiteCoding website
Coding website
 
Everyday's JS
Everyday's JSEveryday's JS
Everyday's JS
 
Windows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows AzureWindows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows Azure
 
Command-Oriented Architecture
Command-Oriented ArchitectureCommand-Oriented Architecture
Command-Oriented Architecture
 
2018年のXamarinの概要と活用方法
2018年のXamarinの概要と活用方法2018年のXamarinの概要と活用方法
2018年のXamarinの概要と活用方法
 

Viewers also liked

Palestra de Dado Schneider
 Palestra de Dado Schneider  Palestra de Dado Schneider
Palestra de Dado Schneider
Jessica Harlley
 
Digital Storytelling
Digital StorytellingDigital Storytelling
Digital Storytelling
5397stealth
 
analisis financiero
 analisis financiero analisis financiero
analisis financiero
Kevin Prado Rivera
 
Planificacion educativa
Planificacion educativaPlanificacion educativa
Planificacion educativa
Juan Marin
 
Preparing the 4 h message for captiol hill
Preparing the 4 h message for captiol hillPreparing the 4 h message for captiol hill
Preparing the 4 h message for captiol hillLindsey Jewell
 
Sociedades humanas. ob
Sociedades humanas. obSociedades humanas. ob
Sociedades humanas. ob
Odilia Betancourt
 
Pze x4 p_en
Pze x4 p_enPze x4 p_en
Pze x4 p_en
paulomarena
 
2012 collegiate facilitators & ylt
2012 collegiate facilitators & ylt2012 collegiate facilitators & ylt
2012 collegiate facilitators & yltLindsey Jewell
 
Chaperone webinar.pptx
Chaperone webinar.pptxChaperone webinar.pptx
Chaperone webinar.pptxLindsey Jewell
 
bio battery ppt
bio battery pptbio battery ppt
bio battery ppt
Kotte Sruthi
 

Viewers also liked (18)

Palestra de Dado Schneider
 Palestra de Dado Schneider  Palestra de Dado Schneider
Palestra de Dado Schneider
 
Digital Storytelling
Digital StorytellingDigital Storytelling
Digital Storytelling
 
analisis financiero
 analisis financiero analisis financiero
analisis financiero
 
Planificacion educativa
Planificacion educativaPlanificacion educativa
Planificacion educativa
 
Preparing the 4 h message for captiol hill
Preparing the 4 h message for captiol hillPreparing the 4 h message for captiol hill
Preparing the 4 h message for captiol hill
 
Sociedades humanas. ob
Sociedades humanas. obSociedades humanas. ob
Sociedades humanas. ob
 
Show Photos
Show PhotosShow Photos
Show Photos
 
Touring dc
Touring dcTouring dc
Touring dc
 
Realmadrid
RealmadridRealmadrid
Realmadrid
 
Southpark
SouthparkSouthpark
Southpark
 
Southpark
SouthparkSouthpark
Southpark
 
Style Seeker App
Style Seeker AppStyle Seeker App
Style Seeker App
 
Pze x4 p_en
Pze x4 p_enPze x4 p_en
Pze x4 p_en
 
Park model
Park modelPark model
Park model
 
2012 collegiate facilitators & ylt
2012 collegiate facilitators & ylt2012 collegiate facilitators & ylt
2012 collegiate facilitators & ylt
 
Chaperone webinar.pptx
Chaperone webinar.pptxChaperone webinar.pptx
Chaperone webinar.pptx
 
Adult orientation
Adult orientationAdult orientation
Adult orientation
 
bio battery ppt
bio battery pptbio battery ppt
bio battery ppt
 

Similar to Применение шаблона проектирования MVVM при разработке архитектуры Windows Phone 7 приложений

Synapse india reviews sharing chapter 23 – asp.net-part2
Synapse india reviews sharing  chapter 23 – asp.net-part2Synapse india reviews sharing  chapter 23 – asp.net-part2
Synapse india reviews sharing chapter 23 – asp.net-part2
Synapseindiappsdevelopment
 
Mastering Oracle ADF Bindings
Mastering Oracle ADF BindingsMastering Oracle ADF Bindings
Mastering Oracle ADF Bindings
Euegene Fedorenko
 
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinGet the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Xamarin
 
JavaScript Refactoring
JavaScript RefactoringJavaScript Refactoring
JavaScript Refactoring
Krzysztof Szafranek
 
Synapse india dotnet development web approch
Synapse india dotnet development web approchSynapse india dotnet development web approch
Synapse india dotnet development web approch
Synapseindiappsdevelopment
 
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
GlobalLogic Ukraine
 
Taking Apache Camel For a Ride
Taking Apache Camel For a RideTaking Apache Camel For a Ride
Taking Apache Camel For a RideBruce Snyder
 
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
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
Alfredo Morresi
 
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
Ali Parmaksiz
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
GeeksLab Odessa
 
OL4JSF - Latinoware 2010
OL4JSF - Latinoware 2010OL4JSF - Latinoware 2010
OL4JSF - Latinoware 2010
Robert Anderson
 
Daniel Jalkut - dotSwift 2019
Daniel Jalkut - dotSwift 2019Daniel Jalkut - dotSwift 2019
Daniel Jalkut - dotSwift 2019
DanielJalkut
 
[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern
NAVER Engineering
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
Sébastien Gruhier
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice Ninja
DroidConTLV
 

Similar to Применение шаблона проектирования MVVM при разработке архитектуры Windows Phone 7 приложений (20)

Synapse india reviews sharing chapter 23 – asp.net-part2
Synapse india reviews sharing  chapter 23 – asp.net-part2Synapse india reviews sharing  chapter 23 – asp.net-part2
Synapse india reviews sharing chapter 23 – asp.net-part2
 
Mastering Oracle ADF Bindings
Mastering Oracle ADF BindingsMastering Oracle ADF Bindings
Mastering Oracle ADF Bindings
 
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for XamarinGet the Most Out of iOS 11 with Visual Studio Tools for Xamarin
Get the Most Out of iOS 11 with Visual Studio Tools for Xamarin
 
JavaScript Refactoring
JavaScript RefactoringJavaScript Refactoring
JavaScript Refactoring
 
Synapse india dotnet development web approch
Synapse india dotnet development web approchSynapse india dotnet development web approch
Synapse india dotnet development web approch
 
Mate
MateMate
Mate
 
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
 
Taking Apache Camel For a Ride
Taking Apache Camel For a RideTaking Apache Camel For a Ride
Taking Apache Camel For a Ride
 
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)
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
 
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo A GWT Application with MVP Pattern Deploying to CloudFoundry using  Spring Roo
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
 
Django quickstart
Django quickstartDjango quickstart
Django quickstart
 
Unit testing with mock libs
Unit testing with mock libsUnit testing with mock libs
Unit testing with mock libs
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
 
OL4JSF - Latinoware 2010
OL4JSF - Latinoware 2010OL4JSF - Latinoware 2010
OL4JSF - Latinoware 2010
 
Daniel Jalkut - dotSwift 2019
Daniel Jalkut - dotSwift 2019Daniel Jalkut - dotSwift 2019
Daniel Jalkut - dotSwift 2019
 
[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice Ninja
 
Eclipse Tricks
Eclipse TricksEclipse Tricks
Eclipse Tricks
 

Recently uploaded

zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 

Recently uploaded (20)

zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 

Применение шаблона проектирования MVVM при разработке архитектуры Windows Phone 7 приложений

  • 2.          2
  • 3. 3
  • 5. Model View Controller 5
  • 6. Model View DataBinding Presentation Model (ViewModel) 6
  • 7. 7
  • 9. <DataTemplate x:Key="MapTemplate"> <my:Pushpin Location="{Binding Location}" /> </DataTemplate> ... <my:Map Name="map1" Height="494" HorizontalAlignment="Left" Margin="20,6,0,0" VerticalAlignment="Top" Width="444" Center="{Binding MapCenter, Mode=TwoWay}" ZoomLevel="{Binding MapZoomLevel, Mode=TwoWay}"> <my:MapItemsControl x:Name="ListOfItems" ItemTemplate="{StaticResource MapTemplate}" ItemsSource="{Binding LocationDataCollection}"> </my:MapItemsControl> </my:Map> 9
  • 10.    <StackPanel Orientation="Horizontal" Height="22"> <Label Width="50"> Options: </Label> <Button x:Name="Search" Width="100" Command="{Binding SearchCommand}" >Search</Button> </StackPanel> 10
  • 11. public class SearchCommand : ICommand { private ViewModel viewModel; public SearchCommand(ViewModel viewModelInstance) { viewModel = viewModelInstance; } #region ICommand Members public bool CanExecute(object parameter) { return true; } public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove { CommandManager.RequerySuggested -= value; } } public void Execute(object parameter) { viewModel.Search(); } #endregion 11 }
  • 12.      http://unity.codeplex.com 12 
  • 13. IUnityContainer Container = new UnityContainer(); if (ViewModelBase.IsInDesignModeStatic) { Container.RegisterType<IDataService,Design.DesignDataService>(); } else { Container.RegisterType<IDataService, DataService>(); } Container.RegisterType<MainViewModel> (new ContainerControlledLifetimeManager()); 13
  • 14. 14
  • 15. 15
  • 16.       16
  • 17.   <phone:PhoneApplicationPage x:Class="MvvmLiteRTM.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:vm="clr-namespace:MvvmLiteRTM.ViewModel" DataContext="{Binding Main, Source={StaticResource Locator}}" shell:SystemTray.IsVisible="True“> 17
  • 18.   <Button Content=“ZoomIn" Height="72" Name=“ZoomInButton"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <cmd:EventToCommand Command="{Binding ZoomInCommand}"/> </i:EventTrigger> </i:Interaction.Triggers> </Button> 18
  • 19.   RelayCommand ZoomOutCommand = new RelayCommand( () => { MapZoomLevel--; } ); 19
  • 20. View View Messages ViewModel ViewModel View Messages + callback ViewModel 20
  • 21.   private void SendMessageWithCallback() { Messenger.Default.Send(new NotificationMessageAction<string>( "Hello, call me back", SendMessageCallback)); } private void SendMessageCallback(string message) { ... } 21
  • 22. private NotificationMessageAction<string> _lastMessage; public void MessageRecipient() { Messenger.Default.Register<NotificationMessageAction<string>>( this, m => { MessageTextBox.Text = m.Notification; _lastMessage = m; // Execute callback with parameter _lastMessage.Execute(MessageTextBox.Text); }); } 22
  • 23. http://ultralightmvvm.codeplex.com/  http://mvvmlight.codeplex.com/  http://catel.codeplex.com/  http://caliburnmicro.codeplex.com/  23 http://www.japf.fr/silverlight/mvvm/index.html
  • 24. 24
  • 25.          25
  • 26.      26
  • 27. View Feature View Model IFeature Injection 27
  • 29. 29
  • 30.       30
  • 31.    http://create.msdn.com  http://silverlight.codeplex.com/   Model-View-ViewModel (MVVM) Explained  WPF Apps With The Model-View-ViewModel Design Pattern - Josh Smith  http://nrumyantsev.com/  me@nrumyantsev.com 31

Editor's Notes

  1. -Does not have a presenter, has a controller-Request first comes to controller, binds the model with the view-Logic is stored in controller
  2. -State and Logic stored in Presenter-Presenter is an abstraction of view, Presenter unaware of view-View is aware of Presenter, however isolated from Model
  3. -State and Logic stored in Presenter-Presenter is an abstraction of view, Presenter unaware of view-View is aware of Presenter, however isolated from Model-Uses WPF and Silverlight bindings-A very loose coupling between view and viewmodel, very easy to write unit tests-Growing in popularity (several toolkits MVVM Light, Prism, Caliburn)-Used internally at Microsoft during Expression Blend creation
  4. -CanExecute determines if the command can be invoked on the current command target-Execute determines the command action to be performed-CanExecuteChanged event is raised when the command manager detects a change in the command source
  5. -Uses the System.Windows.Interactivity namespace
  6. -Avoid having to write separate class for commands, and implementing Icommand-lamba expression as an action
  7. -allows you to send messages between view models-possible to open up filtered channels (to target types/interfaces)
  8. -the sender sends a string message with a parameter of type NotificationMessageAction&lt;string&gt;-the callback parameter is a string
  9. -The recipient registers to receive a message of type NotificationMessageAction-The Notification property of the NotificationMessageAction type contains the string message-The recipient executes the sender’s callback with a string parameter
  10. -CheckBeginInvokeOnUI excepts Action parameter-Also contains UIThreadDispatrcher property in case you need to do other work on the UI thread.