SlideShare a Scribd company logo
1 of 49
Windows Store app using XAML and
C#: Enterprise Product Development
What beyond POCs ?!

                       Mahmoud Hamed
                       ITWorx

patterns & practices Symposium 2013
Mahmoud   mahmoud.hamed@itworx.com       @mhamedmahmoud



Hamed
                                     http://eg.linkedin.com/in/mah
            dev.mhamed@gmail.com     moudhamedmahmoud
This presentation is based on a presentation
by p&p team at pattern & practices
symposium 2013 with updates to reflect my
own experience
Tips for building a Windows Store app using
XAML and C#: The Kona project




patterns & practices Symposium 2013
Why I need this session can I live
without it ??????!




patterns & practices Symposium 2013
Agenda

         
The Kona Project
Demo Kona Project
Build and Test a Windows Store App Using Team
Foundation Build
A. Build Windows Store App Using Team Foundation Build
http://msdn.microsoft.com/en-us/library/hh691189.aspx

B. Walkthrough: Creating and Running Unit Tests for Windows Store Apps
http://msdn.microsoft.com/en-us/library/hh440545.aspx

C. Validating an app package in automated builds (Windows Store apps)
Windows Store app certification
http://msdn.microsoft.com/en-us/library/windows/apps/hh994667.aspx

D. TFS 2012 Express (5 user per server)
http://www.microsoft.com/visualstudio/eng/products/visual-studio-team-foundation-
server-express#product-express-tfs-requirements
Demo TFS 2012 and Windows Store
Apps
Windows Phone vs Windows Store app

 Windows Phone apps                       Windows Store apps

 Deactivate/Tombstoned/Reactivate         Suspend/Terminate/Resume

 Microsoft Push Notification Service      Windows Push Notification Service
 (MPN)                                    (WNS)
 Windows Phone Marketplace certification Windows Store app certification &
                                         Application Excellence Review (AER)
 App manifest declares capabilities       App manifest declares capabilities
Push Notification requires Windows Store registration
                        •   Make sure to register your app
                            with the Windows Store to get
                            proper credentials (SID &
                            secret key)
                        •   Purely sideloaded apps won’t
                            be able to receive notifications
                            from Windows Notification
                            Service (WNS)
Globalization



         <ToolTip
             x:Uid=“PreviewCartoonizeAppBarButtonToolTip”
             Content=“Preview Cartoonization”
             … />
Globalization
A. Globalizing your app
http://msdn.microsoft.com/en-us/library/windows/apps/hh465006.aspx

B. How to use the Multilingual App Toolkit
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj572370.aspx

C. Application resources and localization sample
http://code.msdn.microsoft.com/windowsapps/Application-resources-and-
cd0c6eaa
Demo Windows Store Apps
Globalization
Logging
Logging Sample for Windows Store Apps (ETW Logging in WinRT)
http://code.msdn.microsoft.com/windowsapps/Logging-Sample-for-
Windows-0b9dffd7

MetroLog Overview
MetroLog is a lightweight logging framework designed for Windows Store
and Windows Phone 8 apps
https://github.com/mbrit/MetroLog
Demo Windows Store Apps Logging
async & await are your friends
1: async Task<int> AccessTheWebAsync()
2: {
3:     HttpClient client = new HttpClient();
4:     Task<string> getStringTask = client.GetStringAsync("http://msdn.microsoft.com");
5:     DoIndependentWork();
6:
7:     string urlContents = await getStringTask;
8:     return urlContents.Length;
9: }
Model-View-ViewModel Pattern
From MVC to MVVM


               DataBinding   Commands   Services
                                        Messages




                                          Events
ViewModel  View




                                   Behaviour
                       Binding




Loose coupling, more flexibility
Behavior is highly Blendable
ViewModel  View (Win8)
No behaviors in Windows 8
 Workaround: Use properties and binding
 PropertyChanged event

                     Binding




                   PropertyChanged
Focus on AttachedBehaviors
•   No Blend Behavior<T>
•   No BindingExpressions
•   Break out your
    AttachedBehavior
    experience and
    ROCK ON!
View services

                        ISelectFilesService


            injection
MVVM Light
Use BindableBase class to provide
INPC
public abstract class BindableBase : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;

    protected bool SetProperty<T>(ref T storage, T value, [CallerMemberName] String propertyName = null)
    {
        if (object.Equals(storage, value)) return false;
        storage = value;
        this.OnPropertyChanged(propertyName);
        return true;
    }
    protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        var eventHandler = this.PropertyChanged;
        if (eventHandler != null)
        {
            eventHandler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
Commanding vs ViewModel Method
Invocation
ICommand:
       void Execute(object)
       bool CanExecute(object)
       event EventHandler CanExecuteChanged
Command Invoker:
       ButtonBase
-----------------------------------------------------
Event -> Action
Use DelegateCommand for controls that
support ICommand
View:
<Button Content=“Go to shopping cart”
 Command="{Binding ShoppingCartNavigationCommand}" />

ViewModel:
ShoppingCartNavigationCommand = new
DelegateCommand(NavigateToShoppingCartPage,
           CanNavigateToShoppingCartPage);

ShoppingCartNavigationCommand.RaiseCanExecuteChanged();
Use AttachedBehaviors and Actions for
the rest
View:
<GridView x:Name="itemGridView“
       ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
       ItemTemplate="{StaticResource KonaRI250x250ItemTemplate}"
       SelectionMode="None“ IsItemClickEnabled="True"
       behaviors:ListViewItemClickedToAction.Action=
              "{Binding CategoryNavigationAction}">

ViewModel:
CategoryNavigationAction = NavigateToCategory;
Use the Kona ViewModelLocator
• Convention based lookup
• Ability to override convention with exceptions to
  rule
• Can leverage container to instantiate
  ViewModels.
Decoupled Eventing
            • Hollywood Parent style UI
              Composition (user control)
            • Child control needs to listen
              to events raised by long
              lived services but no way to
              unhook…

            • Ported Prism
              EventAggregator
Use EventAggregator when
necessary
public SubscriberViewModel(IEventAggregator eventAggregator)
{
    eventAggregator.GetEvent<ShoppingCartUpdatedEvent>()
           .Subscribe(s => UpdateItemCountAsync());
}

public PublisherViewModel(IEventAggregator eventAggregator)
{
    _eventAggregator = eventAggregator;
}

_eventAggregator.GetEvent<ShoppingCartUpdatedEvent>()
           .Publish(string.Empty);
Navigation: View or ViewModel First
View First:
this.Frame.Navigate(typeof(ItemDetailPage), itemId);


ViewModel First:
Var itemDetailPageViewModel = new ItemDetailPageViewModel(…)
                            { ItemId = itemId };
navigationService.Navigate(itemDetailPageViewModel);
Pages and Navigation
Use the LayoutAwarePage class to provide
  navigation, state management, and visual state
  management
Navigation support
         protected virtual void GoHome(object sender, RoutedEventArgs e)
         protected virtual void GoBack(object sender, RoutedEventArgs e)
         protected virtual void GoForward(object sender, RoutedEventArgs e)
Visual state switching
         public void StartLayoutUpdates(object sender, RoutedEventArgs e)
         public void StopLayoutUpdates(object sender, RoutedEventArgs e)
Process lifetime management
         protected override void OnNavigatedTo(NavigationEventArgs e)
         protected override void OnNavigatedFrom(NavigationEventArgs e)
         protected virtual void LoadState(Object navigationParameter,
                                                Dictionary<String, Object> pageState)
         protected virtual void SaveState(Dictionary<String, Object> pageState)
Navigation & Visual State Support
XAML:
<Button Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}"
         Style="{StaticResource BackButtonStyle}"/>


<UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates">
LoadState & SaveState: SuspensionManager
protected override void SaveState(System.Collections.Generic.Dictionary<string, object> pageState)
{
    var virtualizingStackPanel =
                      VisualTreeUtilities.GetVisualChild<VirtualizingStackPanel>(itemGridView);
    if (virtualizingStackPanel != null && pageState != null)
    {
        pageState["virtualizingStackPanelHorizontalOffset"] = virtualizingStackPanel.HorizontalOffset;
    }
}


protected override void LoadState(object navigationParameter,
                                       System.Collections.Generic.Dictionary<string, object> pageState)
{
    if (pageState != null && pageState.ContainsKey("virtualizingStackPanelHorizontalOffset"))
    {
        double.TryParse(pageState["virtualizingStackPanelHorizontalOffset"].ToString(),
                        out virtualizingStackPanelHorizontalOffset);
    }
}
Support visual state for landscape, portrait, fill, and
snap
<VisualStateManager.VisualStateGroups>
   <VisualStateGroup x:Name="ApplicationViewStates">
       <VisualState x:Name="FullScreenLandscape"/>
       <VisualState x:Name="Filled"/>
       <VisualState x:Name="FullScreenPortrait">
            <Storyboard>   ...   </Storyboard>
        </VisualState>
        <VisualState x:Name="Snapped">
            <Storyboard>   ...   </Storyboard>
        </VisualState>
    </VisualStateGroup>
</VisualStateManager.VisualStateGroups>
Typical Validation in
    WPF/Silverlight
•   Implement INotifyDataErrorInfo
•   UI controls bind to errors dictionary if
    NotifyOnValidationError=True

<TextBox Text="{Binding Id, Mode=TwoWay, ValidatesOnExceptions=True,
NotifyOnValidationError=True}"/>
Use Kona BindableValidator
View:
<TextBox
       Text="{Binding Address.FirstName, Mode=TwoWay}"
       behaviors:HighlightFormFieldOnErrors.PropertyErrors="{Binding
Errors[FirstName]}" />


ViewModel:
_bindableValidator = new BindableValidator(_address);


public BindableValidator Errors
{
    get { return _bindableValidator; }
}
Suspend, Resume, and Terminate
15. Use Kona RestorableStateAttribute and MVVM
framework
public class MyViewModel : ViewModel, INavigationAware
{
        private string _name;

       [RestorableState]
         public string Name
       {
           get { return _name; }
           set { SetProperty(ref _name, value); }
       }
}


       Symposium 2013
Unit Testing nicely integrated into VS2012
WP7: Jeff Wilcox's Silverlight Unit Test Framework
• Tests run in emulator or device

Unit Test Library (Windows Store apps)
• Run and debug from IDE
• Can run tests from command line and export as trx format.

<ItemGroup>
      <TestAppPackages Include="$(MSBuildProjectDirectory)..Source***.appx" />
</ItemGroup>

<Target Name="Test">
      <Exec ContinueOnError="true" Command="vstest.console.exe /InIsolation /logger:trx
%(TestAppPackages.Identity)" />
</Target>
File System

 Local Data (SQLite)

 Roaming Data

 Hi Priority Roaming Data

 Password Vault

       Symposium 2013
Final Tips
 Read Windows 8 SDK
   http://msdn.microsoft.com/library/windows/apps/
 Watch Some videos
   Channel 9: Windows Camps
       http://channel9.msdn.com/Events/Windows-Camp
   Channel 9: Windows tag
       http://channel9.msdn.com/Tags/windows+8
   Pluralsight windows 8 series
       http://www.pluralsight.com/training/Courses#windows-8


      Symposium 2013
Thanks!


 http://konaguidance.codeplex.com




      Symposium 2013

More Related Content

What's hot

Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
MVVM & Data Binding Library
MVVM & Data Binding Library MVVM & Data Binding Library
MVVM & Data Binding Library 10Clouds
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish MinutesDan Wahlin
 
Deep dive into Android Data Binding
Deep dive into Android Data BindingDeep dive into Android Data Binding
Deep dive into Android Data BindingRadek Piekarz
 
Data Binding in Action using MVVM pattern
Data Binding in Action using MVVM patternData Binding in Action using MVVM pattern
Data Binding in Action using MVVM patternFabio Collini
 
Fixing Magento Core for Better Performance - Ivan Chepurnyi
Fixing Magento Core for Better Performance - Ivan ChepurnyiFixing Magento Core for Better Performance - Ivan Chepurnyi
Fixing Magento Core for Better Performance - Ivan ChepurnyiMeet Magento Spain
 
ASP.NET MVC 3.0 Validation
ASP.NET MVC 3.0 ValidationASP.NET MVC 3.0 Validation
ASP.NET MVC 3.0 ValidationEyal Vardi
 
Vaadin DevDay 2017 - Data Binding in Vaadin 8
Vaadin DevDay 2017 - Data Binding in Vaadin 8Vaadin DevDay 2017 - Data Binding in Vaadin 8
Vaadin DevDay 2017 - Data Binding in Vaadin 8Peter Lehto
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with VaadinPeter Lehto
 
Techlunch - Dependency Injection with Vaadin
Techlunch - Dependency Injection with VaadinTechlunch - Dependency Injection with Vaadin
Techlunch - Dependency Injection with VaadinPeter Lehto
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todaygerbille
 
Gdg san diego android 11 meetups what's new in android - ui and dev tools
Gdg san diego android 11 meetups  what's new in android  - ui and dev toolsGdg san diego android 11 meetups  what's new in android  - ui and dev tools
Gdg san diego android 11 meetups what's new in android - ui and dev toolsSvetlin Stanchev
 
Best Practices for Magento Debugging
Best Practices for Magento Debugging Best Practices for Magento Debugging
Best Practices for Magento Debugging varien
 
Building Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVIBuilding Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVIJames Shvarts
 
Application Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyApplication Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyRichard Lord
 
ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013Mathias Seguy
 

What's hot (20)

droidparts
droidpartsdroidparts
droidparts
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
MVVM & Data Binding Library
MVVM & Data Binding Library MVVM & Data Binding Library
MVVM & Data Binding Library
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 
Deep dive into Android Data Binding
Deep dive into Android Data BindingDeep dive into Android Data Binding
Deep dive into Android Data Binding
 
Data Binding in Action using MVVM pattern
Data Binding in Action using MVVM patternData Binding in Action using MVVM pattern
Data Binding in Action using MVVM pattern
 
Fixing Magento Core for Better Performance - Ivan Chepurnyi
Fixing Magento Core for Better Performance - Ivan ChepurnyiFixing Magento Core for Better Performance - Ivan Chepurnyi
Fixing Magento Core for Better Performance - Ivan Chepurnyi
 
ASP.NET MVC 3.0 Validation
ASP.NET MVC 3.0 ValidationASP.NET MVC 3.0 Validation
ASP.NET MVC 3.0 Validation
 
Vaadin DevDay 2017 - Data Binding in Vaadin 8
Vaadin DevDay 2017 - Data Binding in Vaadin 8Vaadin DevDay 2017 - Data Binding in Vaadin 8
Vaadin DevDay 2017 - Data Binding in Vaadin 8
 
GWT integration with Vaadin
GWT integration with VaadinGWT integration with Vaadin
GWT integration with Vaadin
 
Magento Indexes
Magento IndexesMagento Indexes
Magento Indexes
 
Techlunch - Dependency Injection with Vaadin
Techlunch - Dependency Injection with VaadinTechlunch - Dependency Injection with Vaadin
Techlunch - Dependency Injection with Vaadin
 
Android 3
Android 3Android 3
Android 3
 
Creating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of todayCreating the interfaces of the future with the APIs of today
Creating the interfaces of the future with the APIs of today
 
Gdg san diego android 11 meetups what's new in android - ui and dev tools
Gdg san diego android 11 meetups  what's new in android  - ui and dev toolsGdg san diego android 11 meetups  what's new in android  - ui and dev tools
Gdg san diego android 11 meetups what's new in android - ui and dev tools
 
Best Practices for Magento Debugging
Best Practices for Magento Debugging Best Practices for Magento Debugging
Best Practices for Magento Debugging
 
Building Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVIBuilding Testable Reactive Apps with MVI
Building Testable Reactive Apps with MVI
 
Application Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The UglyApplication Frameworks - The Good, The Bad & The Ugly
Application Frameworks - The Good, The Bad & The Ugly
 
Sane Async Patterns
Sane Async PatternsSane Async Patterns
Sane Async Patterns
 
ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013ProTips DroidCon Paris 2013
ProTips DroidCon Paris 2013
 

Similar to Windows Store app using XAML and C#: Enterprise Product Development

Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitIMC Institute
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinBarry Gervin
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsSami Ekblad
 
Developing ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Patterngoodfriday
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsHaim Michael
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXIMC Institute
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKBrendan Lim
 
Declarative presentations UIKonf
Declarative presentations UIKonfDeclarative presentations UIKonf
Declarative presentations UIKonfNataliya Patsovska
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
Asp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design PatternAsp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design Patternmaddinapudi
 
Android accessibility for developers and QA
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QATed Drake
 
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
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMohammad Shaker
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015Pushkar Chivate
 
Windows Store apps - Lessons Learned
Windows Store apps - Lessons LearnedWindows Store apps - Lessons Learned
Windows Store apps - Lessons Learnedchribben
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptWalid Ashraf
 
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
 

Similar to Windows Store app using XAML and C#: Enterprise Product Development (20)

Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web ToolkitJava Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
Java Web Programming on Google Cloud Platform [3/3] : Google Web Toolkit
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter LehtoJavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-ons
 
Developing ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Pattern
 
The WebView Role in Hybrid Applications
The WebView Role in Hybrid ApplicationsThe WebView Role in Hybrid Applications
The WebView Role in Hybrid Applications
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
Introduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDKIntroduction to Palm's Mojo SDK
Introduction to Palm's Mojo SDK
 
Declarative presentations UIKonf
Declarative presentations UIKonfDeclarative presentations UIKonf
Declarative presentations UIKonf
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
Asp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design PatternAsp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design Pattern
 
Android accessibility for developers and QA
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QA
 
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)
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015
 
Windows Store apps - Lessons Learned
Windows Store apps - Lessons LearnedWindows Store apps - Lessons Learned
Windows Store apps - Lessons Learned
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
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
 

More from Mahmoud Hamed Mahmoud

SharePoint and .NET Advanced Troubleshooting and Debugging
SharePoint and .NET Advanced Troubleshooting and DebuggingSharePoint and .NET Advanced Troubleshooting and Debugging
SharePoint and .NET Advanced Troubleshooting and DebuggingMahmoud Hamed Mahmoud
 
Exam 70-489 Developing Microsoft SharePoint Server 2013 Advanced Solutions Le...
Exam 70-489 Developing Microsoft SharePoint Server 2013 Advanced Solutions Le...Exam 70-489 Developing Microsoft SharePoint Server 2013 Advanced Solutions Le...
Exam 70-489 Developing Microsoft SharePoint Server 2013 Advanced Solutions Le...Mahmoud Hamed Mahmoud
 
Windows azure infrastructure services and share point 2013 farm case study
Windows azure infrastructure services and share point 2013 farm case studyWindows azure infrastructure services and share point 2013 farm case study
Windows azure infrastructure services and share point 2013 farm case studyMahmoud Hamed Mahmoud
 
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...Mahmoud Hamed Mahmoud
 
What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)Mahmoud Hamed Mahmoud
 

More from Mahmoud Hamed Mahmoud (7)

Build & Ignite Cloud Notes
Build & Ignite Cloud NotesBuild & Ignite Cloud Notes
Build & Ignite Cloud Notes
 
Office 365 Development Overview
Office 365 Development OverviewOffice 365 Development Overview
Office 365 Development Overview
 
SharePoint and .NET Advanced Troubleshooting and Debugging
SharePoint and .NET Advanced Troubleshooting and DebuggingSharePoint and .NET Advanced Troubleshooting and Debugging
SharePoint and .NET Advanced Troubleshooting and Debugging
 
Exam 70-489 Developing Microsoft SharePoint Server 2013 Advanced Solutions Le...
Exam 70-489 Developing Microsoft SharePoint Server 2013 Advanced Solutions Le...Exam 70-489 Developing Microsoft SharePoint Server 2013 Advanced Solutions Le...
Exam 70-489 Developing Microsoft SharePoint Server 2013 Advanced Solutions Le...
 
Windows azure infrastructure services and share point 2013 farm case study
Windows azure infrastructure services and share point 2013 farm case studyWindows azure infrastructure services and share point 2013 farm case study
Windows azure infrastructure services and share point 2013 farm case study
 
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
Exam 70-488 Developing Microsoft SharePoint Server 2013 Core Solutions Learni...
 
What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)What's new in SharePoint Server 2013 (End user - Admin – Developer)
What's new in SharePoint Server 2013 (End user - Admin – Developer)
 

Recently uploaded

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 

Windows Store app using XAML and C#: Enterprise Product Development

  • 1. Windows Store app using XAML and C#: Enterprise Product Development What beyond POCs ?! Mahmoud Hamed ITWorx patterns & practices Symposium 2013
  • 2. Mahmoud mahmoud.hamed@itworx.com @mhamedmahmoud Hamed http://eg.linkedin.com/in/mah dev.mhamed@gmail.com moudhamedmahmoud
  • 3. This presentation is based on a presentation by p&p team at pattern & practices symposium 2013 with updates to reflect my own experience Tips for building a Windows Store app using XAML and C#: The Kona project patterns & practices Symposium 2013
  • 4. Why I need this session can I live without it ??????! patterns & practices Symposium 2013
  • 5. Agenda
  • 8.
  • 9.
  • 10. Build and Test a Windows Store App Using Team Foundation Build A. Build Windows Store App Using Team Foundation Build http://msdn.microsoft.com/en-us/library/hh691189.aspx B. Walkthrough: Creating and Running Unit Tests for Windows Store Apps http://msdn.microsoft.com/en-us/library/hh440545.aspx C. Validating an app package in automated builds (Windows Store apps) Windows Store app certification http://msdn.microsoft.com/en-us/library/windows/apps/hh994667.aspx D. TFS 2012 Express (5 user per server) http://www.microsoft.com/visualstudio/eng/products/visual-studio-team-foundation- server-express#product-express-tfs-requirements
  • 11. Demo TFS 2012 and Windows Store Apps
  • 12. Windows Phone vs Windows Store app Windows Phone apps Windows Store apps Deactivate/Tombstoned/Reactivate Suspend/Terminate/Resume Microsoft Push Notification Service Windows Push Notification Service (MPN) (WNS) Windows Phone Marketplace certification Windows Store app certification & Application Excellence Review (AER) App manifest declares capabilities App manifest declares capabilities
  • 13. Push Notification requires Windows Store registration • Make sure to register your app with the Windows Store to get proper credentials (SID & secret key) • Purely sideloaded apps won’t be able to receive notifications from Windows Notification Service (WNS)
  • 14. Globalization <ToolTip x:Uid=“PreviewCartoonizeAppBarButtonToolTip” Content=“Preview Cartoonization” … />
  • 15. Globalization A. Globalizing your app http://msdn.microsoft.com/en-us/library/windows/apps/hh465006.aspx B. How to use the Multilingual App Toolkit http://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj572370.aspx C. Application resources and localization sample http://code.msdn.microsoft.com/windowsapps/Application-resources-and- cd0c6eaa
  • 16. Demo Windows Store Apps Globalization
  • 17. Logging Logging Sample for Windows Store Apps (ETW Logging in WinRT) http://code.msdn.microsoft.com/windowsapps/Logging-Sample-for- Windows-0b9dffd7 MetroLog Overview MetroLog is a lightweight logging framework designed for Windows Store and Windows Phone 8 apps https://github.com/mbrit/MetroLog
  • 18. Demo Windows Store Apps Logging
  • 19. async & await are your friends 1: async Task<int> AccessTheWebAsync() 2: { 3: HttpClient client = new HttpClient(); 4: Task<string> getStringTask = client.GetStringAsync("http://msdn.microsoft.com"); 5: DoIndependentWork(); 6: 7: string urlContents = await getStringTask; 8: return urlContents.Length; 9: }
  • 21. From MVC to MVVM DataBinding Commands Services Messages Events
  • 22. ViewModel  View Behaviour Binding Loose coupling, more flexibility Behavior is highly Blendable
  • 23. ViewModel  View (Win8) No behaviors in Windows 8  Workaround: Use properties and binding  PropertyChanged event Binding PropertyChanged
  • 24. Focus on AttachedBehaviors • No Blend Behavior<T> • No BindingExpressions • Break out your AttachedBehavior experience and ROCK ON!
  • 25. View services ISelectFilesService injection
  • 27.
  • 28. Use BindableBase class to provide INPC public abstract class BindableBase : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected bool SetProperty<T>(ref T storage, T value, [CallerMemberName] String propertyName = null) { if (object.Equals(storage, value)) return false; storage = value; this.OnPropertyChanged(propertyName); return true; } protected void OnPropertyChanged([CallerMemberName] string propertyName = null) { var eventHandler = this.PropertyChanged; if (eventHandler != null) { eventHandler(this, new PropertyChangedEventArgs(propertyName)); } } }
  • 29. Commanding vs ViewModel Method Invocation ICommand: void Execute(object) bool CanExecute(object) event EventHandler CanExecuteChanged Command Invoker: ButtonBase ----------------------------------------------------- Event -> Action
  • 30. Use DelegateCommand for controls that support ICommand View: <Button Content=“Go to shopping cart” Command="{Binding ShoppingCartNavigationCommand}" /> ViewModel: ShoppingCartNavigationCommand = new DelegateCommand(NavigateToShoppingCartPage, CanNavigateToShoppingCartPage); ShoppingCartNavigationCommand.RaiseCanExecuteChanged();
  • 31. Use AttachedBehaviors and Actions for the rest View: <GridView x:Name="itemGridView“ ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}" ItemTemplate="{StaticResource KonaRI250x250ItemTemplate}" SelectionMode="None“ IsItemClickEnabled="True" behaviors:ListViewItemClickedToAction.Action= "{Binding CategoryNavigationAction}"> ViewModel: CategoryNavigationAction = NavigateToCategory;
  • 32. Use the Kona ViewModelLocator • Convention based lookup • Ability to override convention with exceptions to rule • Can leverage container to instantiate ViewModels.
  • 33. Decoupled Eventing • Hollywood Parent style UI Composition (user control) • Child control needs to listen to events raised by long lived services but no way to unhook… • Ported Prism EventAggregator
  • 34. Use EventAggregator when necessary public SubscriberViewModel(IEventAggregator eventAggregator) { eventAggregator.GetEvent<ShoppingCartUpdatedEvent>() .Subscribe(s => UpdateItemCountAsync()); } public PublisherViewModel(IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; } _eventAggregator.GetEvent<ShoppingCartUpdatedEvent>() .Publish(string.Empty);
  • 35. Navigation: View or ViewModel First View First: this.Frame.Navigate(typeof(ItemDetailPage), itemId); ViewModel First: Var itemDetailPageViewModel = new ItemDetailPageViewModel(…) { ItemId = itemId }; navigationService.Navigate(itemDetailPageViewModel);
  • 36.
  • 38. Use the LayoutAwarePage class to provide navigation, state management, and visual state management Navigation support protected virtual void GoHome(object sender, RoutedEventArgs e) protected virtual void GoBack(object sender, RoutedEventArgs e) protected virtual void GoForward(object sender, RoutedEventArgs e) Visual state switching public void StartLayoutUpdates(object sender, RoutedEventArgs e) public void StopLayoutUpdates(object sender, RoutedEventArgs e) Process lifetime management protected override void OnNavigatedTo(NavigationEventArgs e) protected override void OnNavigatedFrom(NavigationEventArgs e) protected virtual void LoadState(Object navigationParameter, Dictionary<String, Object> pageState) protected virtual void SaveState(Dictionary<String, Object> pageState)
  • 39. Navigation & Visual State Support XAML: <Button Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/> <UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates">
  • 40. LoadState & SaveState: SuspensionManager protected override void SaveState(System.Collections.Generic.Dictionary<string, object> pageState) { var virtualizingStackPanel = VisualTreeUtilities.GetVisualChild<VirtualizingStackPanel>(itemGridView); if (virtualizingStackPanel != null && pageState != null) { pageState["virtualizingStackPanelHorizontalOffset"] = virtualizingStackPanel.HorizontalOffset; } } protected override void LoadState(object navigationParameter, System.Collections.Generic.Dictionary<string, object> pageState) { if (pageState != null && pageState.ContainsKey("virtualizingStackPanelHorizontalOffset")) { double.TryParse(pageState["virtualizingStackPanelHorizontalOffset"].ToString(), out virtualizingStackPanelHorizontalOffset); } }
  • 41. Support visual state for landscape, portrait, fill, and snap <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="ApplicationViewStates"> <VisualState x:Name="FullScreenLandscape"/> <VisualState x:Name="Filled"/> <VisualState x:Name="FullScreenPortrait"> <Storyboard> ... </Storyboard> </VisualState> <VisualState x:Name="Snapped"> <Storyboard> ... </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups>
  • 42. Typical Validation in WPF/Silverlight • Implement INotifyDataErrorInfo • UI controls bind to errors dictionary if NotifyOnValidationError=True <TextBox Text="{Binding Id, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>
  • 43. Use Kona BindableValidator View: <TextBox Text="{Binding Address.FirstName, Mode=TwoWay}" behaviors:HighlightFormFieldOnErrors.PropertyErrors="{Binding Errors[FirstName]}" /> ViewModel: _bindableValidator = new BindableValidator(_address); public BindableValidator Errors { get { return _bindableValidator; } }
  • 44. Suspend, Resume, and Terminate
  • 45. 15. Use Kona RestorableStateAttribute and MVVM framework public class MyViewModel : ViewModel, INavigationAware { private string _name; [RestorableState] public string Name { get { return _name; } set { SetProperty(ref _name, value); } } } Symposium 2013
  • 46. Unit Testing nicely integrated into VS2012 WP7: Jeff Wilcox's Silverlight Unit Test Framework • Tests run in emulator or device Unit Test Library (Windows Store apps) • Run and debug from IDE • Can run tests from command line and export as trx format. <ItemGroup> <TestAppPackages Include="$(MSBuildProjectDirectory)..Source***.appx" /> </ItemGroup> <Target Name="Test"> <Exec ContinueOnError="true" Command="vstest.console.exe /InIsolation /logger:trx %(TestAppPackages.Identity)" /> </Target>
  • 47. File System  Local Data (SQLite)  Roaming Data  Hi Priority Roaming Data  Password Vault Symposium 2013
  • 48. Final Tips  Read Windows 8 SDK  http://msdn.microsoft.com/library/windows/apps/  Watch Some videos  Channel 9: Windows Camps  http://channel9.msdn.com/Events/Windows-Camp  Channel 9: Windows tag  http://channel9.msdn.com/Tags/windows+8  Pluralsight windows 8 series  http://www.pluralsight.com/training/Courses#windows-8 Symposium 2013

Editor's Notes

  1. Line of Business emphasis…
  2. ExplainSideLoaded
  3. Don’t need command enablement….