SlideShare una empresa de Scribd logo
1 de 14
.NET 4.5 Infoday, Graz, November 8th 2012



                                                      Rainer Stropek
                                                      software architects gmbh




WPF                                           Mail
                                              Web
                                            Twitter
                                                      rainer@timecockpit.com
                                                      http://www.timecockpit.com
                                                      @rstropek


What’s New in .NET 4.5?
                                                      Saves the day.
Overview
   Ribbon
   Performance improvements
   Data Binding enhancements
    Live shaping
    Binding to static properties
    Delay changes to data source
   Better support for async programming
    Access to collections in non-UI threads
    INotifyDataErrorInfo
    API enhancements for Dispatcher

   For a complete list of all enhancements see MSDN
.NET Infoday, Graz



                              Ribbon
                              System.Windows.Controls.Ribbon
                                (MSDN Link)

                              Use Ribbon for WPF for previous
                                versions of .NET
                                (MS Download Link)




Ribbon
Built-in ribbon in .NET 4.5
.NET Infoday, Graz


<RibbonWindow …>
  <Grid>
                                                                 Ribbon
    <Ribbon …>
      <Ribbon.HelpPaneContent>…</Ribbon.HelpPaneContent>         XAML Code Snippet
      <Ribbon.QuickAccessToolBar>…</Ribbon.QuickAccessToolBar>
      <Ribbon.ApplicationMenu>…</Ribbon.ApplicationMenu>
      <RibbonTab Header="Home" KeyTip="H" >
         <RibbonGroup … Header="Clipboard">
           <RibbonMenuButton
             LargeImageSource="Imagesclipboard.png"
             Label="Paste" KeyTip="V">
           …
         </RibbonGroup>
      </RibbonTab>
    </Ribbon>
  </Grid>
</RibbonWindow>
.NET Infoday, Graz


…
<Window.Resources>
                                                         Perf Improvements
  <CollectionViewSource x:Key="ViewSource">
    <CollectionViewSource.GroupDescriptions>             Enable UI virtualization for
      <PropertyGroupDescription
                                                         grouped data
         PropertyName="Nationality" />                   Reduces time for initial rendering
    </CollectionViewSource.GroupDescriptions>            and scrolling
  </CollectionViewSource>
</Window.Resources>
…
<DataGrid
                                                         Control virtualizing cache using
                                                         new CacheLength and
  ItemsSource="{Binding Source={StaticResource Src}}“
                                                         CacheLengthUnit properties
  VirtualizingPanel.IsVirtualizingWhenGrouping="True">
  <DataGrid.GroupStyle>
    <x:Static Member="GroupStyle.Default"/>
  </DataGrid.GroupStyle>
</DataGrid>
…
.NET Infoday, Graz


 <ListBox VirtualizingPanel.IsVirtualizing="True"
  VirtualizingPanel.ScrollUnit="Pixel">
                                                    Perf Improvements
  <ListBox.Items>
    <sys:String>Item 1</sys:String>                 Enable smooth scrolling in
    <sys:String>Item 2</sys:String>
                                                    virtualizing panel using new
                                                    ScrollUnit attached property
    …
  </ListBox.Items>
  <ListBox.ItemTemplate>
    <DataTemplate>
      <Border Height="100">
         <TextBlock Text="{Binding}" />
      </Border>
    </DataTemplate>
  </ListBox.ItemTemplate>
</ListBox>
.NET Infoday, Graz


…
<CollectionViewSource x:Key="LiveShapingViewSource"
                                                      Live Shaping
  IsLiveSortingRequested="True">
  <CollectionViewSource.SortDescriptions>             Data in grouped/sorted/filtered
    <scm:SortDescription PropertyName="StockValue„
                                                      lists is automatically rearranged.
      Direction="Descending" />
  </CollectionViewSource.SortDescriptions>
</CollectionViewSource>
…
<DataGrid ItemsSource="{Binding Source=
  {StaticResource LiveShapingViewSource}}" />
…
.NET Infoday, Graz


<TextBlock
  Text="{Binding Path=(local:MainWindow.CurrentTickValue)}" />
                                                                 Data Binding
…
private static int currentTickValue;                             Problem: Change notification for
public static int CurrentTickValue {
                                                                 static properties.
                                                                 INotifyPropertyChanged is
  get {
                                                                 no option
    return currentTickValue;
  }                                                              Solution in .NET 4.5: Add a static
  set {                                                          event handler
    currentTickValue = value;
    if (CurrentTickValueChanged != null) {
      CurrentTickValueChanged(null, new EventArgs());
    }
  }
}
public static event EventHandler CurrentTickValueChanged;
…
.NET Infoday, Graz



…                                            Data Binding
<Slider Minimum="0" Maximum="100"
  x:Name="Slider" Width="300“                Use new Delay property to delay
                                             refresh of binding source
  Value="{Binding ElementName=SliderValue,
    Path=Text,
    Delay=1000,
    Mode=OneWayToSource}"/>
<TextBlock x:Name="SliderValue" />
…
.NET Infoday, Graz



                                            Async
                                            Example: Retrieve data from
                                              database or webservice in a
                                              background thread




Access Collections in Background
Threads
Problem: Access only allowed in UI thread
.NET Infoday, Graz


private readonly ObservableCollection<string> strings =
  new ObservableCollection<string>();
                                                            Async
private readonly object stringsSyncObject = new object();
…                                                           Enable modification of collections
                                                            in background threads using
BindingOperations.EnableCollectionSynchronization(
                                                            EnableCollectionSynchronization
   this.strings, this.stringsSyncObject);
…
var timer = new Timer(1000);
timer.Start();
timer.Elapsed += (___, ____) =>
{
   this.strings.Add(DateTime.Now.Ticks.ToString());
};
.NET Infoday, Graz



this.Dispatcher.InvokeAsync(                     Async
  () => /* manipulate UI here */);
                                                 New TPL-compatible API for WPF
                                                 Dispatcher
this.Dispatcher.BeginInvoke(
  new Action(() => /* manipulate UI here */));
.NET Infoday, Graz


<TextBox Text="{Binding Path=ValidationText}" />
…
                                                                Async
public class MyViewModel : …, INotifyDataErrorInfo {
  private async void ValidateAsync() {
                                                                INotifyDataErrorInfo
    var valid = await DoAsyncValidation();
                                                                enables async validation of data
    if (!valid) {                                               Use this mechanism to keep UI
      if (this.ErrorsChanged != null) {                         responsive
         this.ErrorsChanged(this,
           new DataErrorsChangedEventArgs("ValidationText"));
      }
    }
  }
  public event EventHandler<DataErrorsChangedEventArgs>
    ErrorsChanged;
  public IEnumerable GetErrors(string propertyName) {…}
  public bool HasErrors {…}
}
.NET 4.5 Infoday, Graz, November 8th 2012



                                                      Rainer Stropek
                                                      software architects gmbh



                                              Mail    rainer@timecockpit.com

Q&A                                           Web
                                            Twitter
                                                      http://www.timecockpit.com
                                                      @rstropek


Thank You For Coming.
                                                      Saves the day.

Más contenido relacionado

La actualidad más candente

mDevCamp - The Best from Google IO
mDevCamp - The Best from Google IOmDevCamp - The Best from Google IO
mDevCamp - The Best from Google IOondraz
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryAlexandre Morgaut
 
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesVielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesQAware GmbH
 
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)Sirar Salih
 
Multi-threaded CoreData Done Right
Multi-threaded CoreData Done RightMulti-threaded CoreData Done Right
Multi-threaded CoreData Done Rightmorrowa_de
 
Improving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria APIImproving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria APINils Breunese
 
MongoDB + Java + Spring Data
MongoDB + Java + Spring DataMongoDB + Java + Spring Data
MongoDB + Java + Spring DataAnton Sulzhenko
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBTobias Trelle
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETTomas Jansson
 
Data Management 2: Conquering Data Proliferation
Data Management 2: Conquering Data ProliferationData Management 2: Conquering Data Proliferation
Data Management 2: Conquering Data ProliferationMongoDB
 
Java development with MongoDB
Java development with MongoDBJava development with MongoDB
Java development with MongoDBJames Williams
 
Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1Kevin Octavian
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Tobias Trelle
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansCarol McDonald
 
Clustering your Application with Hazelcast
Clustering your Application with HazelcastClustering your Application with Hazelcast
Clustering your Application with HazelcastHazelcast
 
Data Management 3: Bulletproof Data Management
Data Management 3: Bulletproof Data ManagementData Management 3: Bulletproof Data Management
Data Management 3: Bulletproof Data ManagementMongoDB
 
Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Tobias Trelle
 
JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5Payara
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know Norberto Leite
 

La actualidad más candente (20)

mDevCamp - The Best from Google IO
mDevCamp - The Best from Google IOmDevCamp - The Best from Google IO
mDevCamp - The Best from Google IO
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und KubernetesVielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
Vielseitiges In-Memory Computing mit Apache Ignite und Kubernetes
 
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
Azure Table Storage: The Good, the Bad, the Ugly (15 min. lightning talk)
 
Multi-threaded CoreData Done Right
Multi-threaded CoreData Done RightMulti-threaded CoreData Done Right
Multi-threaded CoreData Done Right
 
Improving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria APIImproving Performance and Flexibility of Content Listings Using Criteria API
Improving Performance and Flexibility of Content Listings Using Criteria API
 
MongoDB + Java + Spring Data
MongoDB + Java + Spring DataMongoDB + Java + Spring Data
MongoDB + Java + Spring Data
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NET
 
Data Management 2: Conquering Data Proliferation
Data Management 2: Conquering Data ProliferationData Management 2: Conquering Data Proliferation
Data Management 2: Conquering Data Proliferation
 
Java development with MongoDB
Java development with MongoDBJava development with MongoDB
Java development with MongoDB
 
Bonjour, iCloud
Bonjour, iCloudBonjour, iCloud
Bonjour, iCloud
 
Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1Windows 8 Training Fundamental - 1
Windows 8 Training Fundamental - 1
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with Netbeans
 
Clustering your Application with Hazelcast
Clustering your Application with HazelcastClustering your Application with Hazelcast
Clustering your Application with Hazelcast
 
Data Management 3: Bulletproof Data Management
Data Management 3: Bulletproof Data ManagementData Management 3: Bulletproof Data Management
Data Management 3: Bulletproof Data Management
 
Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Morphia, Spring Data & Co.
Morphia, Spring Data & Co.
 
JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 

Destacado

UI Configuration in CoFX
UI Configuration in CoFXUI Configuration in CoFX
UI Configuration in CoFXRainer Stropek
 
NRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile ProjectsNRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile ProjectsRainer Stropek
 
Workshop: .NET Code Contracts
Workshop: .NET Code ContractsWorkshop: .NET Code Contracts
Workshop: .NET Code ContractsRainer Stropek
 
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...Rainer Stropek
 
SQL Server Reporting Services Training
SQL Server Reporting Services TrainingSQL Server Reporting Services Training
SQL Server Reporting Services TrainingRainer Stropek
 
Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Rainer Stropek
 
C# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project RoslynC# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project RoslynRainer Stropek
 
Catching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows AzureCatching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows AzureRainer Stropek
 
Workshop: Modularization of .NET Applications
Workshop: Modularization of .NET ApplicationsWorkshop: Modularization of .NET Applications
Workshop: Modularization of .NET ApplicationsRainer Stropek
 
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureDeveloping Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureRainer Stropek
 
High Quality C# - Codequality in Practice
High Quality C# - Codequality in PracticeHigh Quality C# - Codequality in Practice
High Quality C# - Codequality in PracticeRainer Stropek
 
BASTA 2013: Custom OData Provider
BASTA 2013: Custom OData ProviderBASTA 2013: Custom OData Provider
BASTA 2013: Custom OData ProviderRainer Stropek
 
Schema presentation
Schema presentationSchema presentation
Schema presentationl.t.j
 
Business Model Generation Patterns
Business Model Generation PatternsBusiness Model Generation Patterns
Business Model Generation PatternsAkiliKing
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesRainer Stropek
 

Destacado (16)

UI Configuration in CoFX
UI Configuration in CoFXUI Configuration in CoFX
UI Configuration in CoFX
 
NRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile ProjectsNRWConf 2013 - Effort Estimation in Agile Projects
NRWConf 2013 - Effort Estimation in Agile Projects
 
Workshop: .NET Code Contracts
Workshop: .NET Code ContractsWorkshop: .NET Code Contracts
Workshop: .NET Code Contracts
 
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
MS TechEd 2013: Continuous Integration with Team Foundation Services and Wind...
 
SQL Server Reporting Services Training
SQL Server Reporting Services TrainingSQL Server Reporting Services Training
SQL Server Reporting Services Training
 
Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#
 
C# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project RoslynC# Scripting with Microsoft's Project Roslyn
C# Scripting with Microsoft's Project Roslyn
 
Catching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows AzureCatching The Long Tail With SaaS + Windows Azure
Catching The Long Tail With SaaS + Windows Azure
 
Workshop: Modularization of .NET Applications
Workshop: Modularization of .NET ApplicationsWorkshop: Modularization of .NET Applications
Workshop: Modularization of .NET Applications
 
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows AzureDeveloping Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
Developing Android and iOS Apps With C#, .NET, Xamarin, Mono, and Windows Azure
 
High Quality C# - Codequality in Practice
High Quality C# - Codequality in PracticeHigh Quality C# - Codequality in Practice
High Quality C# - Codequality in Practice
 
BASTA 2013: Custom OData Provider
BASTA 2013: Custom OData ProviderBASTA 2013: Custom OData Provider
BASTA 2013: Custom OData Provider
 
Portafolio andrés rodriguez
Portafolio andrés rodriguezPortafolio andrés rodriguez
Portafolio andrés rodriguez
 
Schema presentation
Schema presentationSchema presentation
Schema presentation
 
Business Model Generation Patterns
Business Model Generation PatternsBusiness Model Generation Patterns
Business Model Generation Patterns
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
 

Similar a Whats New for WPF in .NET 4.5

Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejugrobbiev
 
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
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJava Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJoshua Long
 
.NET Database Toolkit
.NET Database Toolkit.NET Database Toolkit
.NET Database Toolkitwlscaudill
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
 
An Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle CoherenceAn Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle CoherenceOracle
 
Spring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in HeavenSpring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in HeavenJoshua Long
 
Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Michael Plöd
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...goodfriday
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rulesSrijan Technologies
 
Windows 8 metro applications
Windows 8 metro applicationsWindows 8 metro applications
Windows 8 metro applicationsAlex Golesh
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSuzquiano
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersoazabir
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeMacoscope
 
Retrofit Web Forms with MVC & T4
Retrofit Web Forms with MVC & T4Retrofit Web Forms with MVC & T4
Retrofit Web Forms with MVC & T4soelinn
 
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
Cassandra Day NY 2014: Getting Started with the DataStax C# DriverCassandra Day NY 2014: Getting Started with the DataStax C# Driver
Cassandra Day NY 2014: Getting Started with the DataStax C# DriverDataStax Academy
 
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixOSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixManish Pandit
 

Similar a Whats New for WPF in .NET 4.5 (20)

Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejug
 
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
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Java Configuration Deep Dive with Spring
Java Configuration Deep Dive with SpringJava Configuration Deep Dive with Spring
Java Configuration Deep Dive with Spring
 
.NET Database Toolkit
.NET Database Toolkit.NET Database Toolkit
.NET Database Toolkit
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
An Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle CoherenceAn Engineer's Intro to Oracle Coherence
An Engineer's Intro to Oracle Coherence
 
Spring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in HeavenSpring and Cloud Foundry; a Marriage Made in Heaven
Spring and Cloud Foundry; a Marriage Made in Heaven
 
Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
 
Windows 8 metro applications
Windows 8 metro applicationsWindows 8 metro applications
Windows 8 metro applications
 
Hazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMSHazelcast and MongoDB at Cloud CMS
Hazelcast and MongoDB at Cloud CMS
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, Macoscope
 
Retrofit Web Forms with MVC & T4
Retrofit Web Forms with MVC & T4Retrofit Web Forms with MVC & T4
Retrofit Web Forms with MVC & T4
 
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
Cassandra Day NY 2014: Getting Started with the DataStax C# DriverCassandra Day NY 2014: Getting Started with the DataStax C# Driver
Cassandra Day NY 2014: Getting Started with the DataStax C# Driver
 
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixOSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
 

Último

Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
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
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
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
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
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
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
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
 

Último (20)

Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
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
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
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...
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
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...
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
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
 

Whats New for WPF in .NET 4.5

  • 1. .NET 4.5 Infoday, Graz, November 8th 2012 Rainer Stropek software architects gmbh WPF Mail Web Twitter rainer@timecockpit.com http://www.timecockpit.com @rstropek What’s New in .NET 4.5? Saves the day.
  • 2. Overview  Ribbon  Performance improvements  Data Binding enhancements Live shaping Binding to static properties Delay changes to data source  Better support for async programming Access to collections in non-UI threads INotifyDataErrorInfo API enhancements for Dispatcher  For a complete list of all enhancements see MSDN
  • 3. .NET Infoday, Graz Ribbon System.Windows.Controls.Ribbon (MSDN Link) Use Ribbon for WPF for previous versions of .NET (MS Download Link) Ribbon Built-in ribbon in .NET 4.5
  • 4. .NET Infoday, Graz <RibbonWindow …> <Grid> Ribbon <Ribbon …> <Ribbon.HelpPaneContent>…</Ribbon.HelpPaneContent> XAML Code Snippet <Ribbon.QuickAccessToolBar>…</Ribbon.QuickAccessToolBar> <Ribbon.ApplicationMenu>…</Ribbon.ApplicationMenu> <RibbonTab Header="Home" KeyTip="H" > <RibbonGroup … Header="Clipboard"> <RibbonMenuButton LargeImageSource="Imagesclipboard.png" Label="Paste" KeyTip="V"> … </RibbonGroup> </RibbonTab> </Ribbon> </Grid> </RibbonWindow>
  • 5. .NET Infoday, Graz … <Window.Resources> Perf Improvements <CollectionViewSource x:Key="ViewSource"> <CollectionViewSource.GroupDescriptions> Enable UI virtualization for <PropertyGroupDescription grouped data PropertyName="Nationality" /> Reduces time for initial rendering </CollectionViewSource.GroupDescriptions> and scrolling </CollectionViewSource> </Window.Resources> … <DataGrid Control virtualizing cache using new CacheLength and ItemsSource="{Binding Source={StaticResource Src}}“ CacheLengthUnit properties VirtualizingPanel.IsVirtualizingWhenGrouping="True"> <DataGrid.GroupStyle> <x:Static Member="GroupStyle.Default"/> </DataGrid.GroupStyle> </DataGrid> …
  • 6. .NET Infoday, Graz <ListBox VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.ScrollUnit="Pixel"> Perf Improvements <ListBox.Items> <sys:String>Item 1</sys:String> Enable smooth scrolling in <sys:String>Item 2</sys:String> virtualizing panel using new ScrollUnit attached property … </ListBox.Items> <ListBox.ItemTemplate> <DataTemplate> <Border Height="100"> <TextBlock Text="{Binding}" /> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
  • 7. .NET Infoday, Graz … <CollectionViewSource x:Key="LiveShapingViewSource" Live Shaping IsLiveSortingRequested="True"> <CollectionViewSource.SortDescriptions> Data in grouped/sorted/filtered <scm:SortDescription PropertyName="StockValue„ lists is automatically rearranged. Direction="Descending" /> </CollectionViewSource.SortDescriptions> </CollectionViewSource> … <DataGrid ItemsSource="{Binding Source= {StaticResource LiveShapingViewSource}}" /> …
  • 8. .NET Infoday, Graz <TextBlock Text="{Binding Path=(local:MainWindow.CurrentTickValue)}" /> Data Binding … private static int currentTickValue; Problem: Change notification for public static int CurrentTickValue { static properties. INotifyPropertyChanged is get { no option return currentTickValue; } Solution in .NET 4.5: Add a static set { event handler currentTickValue = value; if (CurrentTickValueChanged != null) { CurrentTickValueChanged(null, new EventArgs()); } } } public static event EventHandler CurrentTickValueChanged; …
  • 9. .NET Infoday, Graz … Data Binding <Slider Minimum="0" Maximum="100" x:Name="Slider" Width="300“ Use new Delay property to delay refresh of binding source Value="{Binding ElementName=SliderValue, Path=Text, Delay=1000, Mode=OneWayToSource}"/> <TextBlock x:Name="SliderValue" /> …
  • 10. .NET Infoday, Graz Async Example: Retrieve data from database or webservice in a background thread Access Collections in Background Threads Problem: Access only allowed in UI thread
  • 11. .NET Infoday, Graz private readonly ObservableCollection<string> strings = new ObservableCollection<string>(); Async private readonly object stringsSyncObject = new object(); … Enable modification of collections in background threads using BindingOperations.EnableCollectionSynchronization( EnableCollectionSynchronization this.strings, this.stringsSyncObject); … var timer = new Timer(1000); timer.Start(); timer.Elapsed += (___, ____) => { this.strings.Add(DateTime.Now.Ticks.ToString()); };
  • 12. .NET Infoday, Graz this.Dispatcher.InvokeAsync( Async () => /* manipulate UI here */); New TPL-compatible API for WPF Dispatcher this.Dispatcher.BeginInvoke( new Action(() => /* manipulate UI here */));
  • 13. .NET Infoday, Graz <TextBox Text="{Binding Path=ValidationText}" /> … Async public class MyViewModel : …, INotifyDataErrorInfo { private async void ValidateAsync() { INotifyDataErrorInfo var valid = await DoAsyncValidation(); enables async validation of data if (!valid) { Use this mechanism to keep UI if (this.ErrorsChanged != null) { responsive this.ErrorsChanged(this, new DataErrorsChangedEventArgs("ValidationText")); } } } public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged; public IEnumerable GetErrors(string propertyName) {…} public bool HasErrors {…} }
  • 14. .NET 4.5 Infoday, Graz, November 8th 2012 Rainer Stropek software architects gmbh Mail rainer@timecockpit.com Q&A Web Twitter http://www.timecockpit.com @rstropek Thank You For Coming. Saves the day.