Integrazione PHP e Silverlight 4

1,824 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,824
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Integrazione PHP e Silverlight 4

  1. 1. PHP e Silverlight 4 Pietro Brambati, Microsoft Blogs.msdn.com/pietrobr pietrobr@microsoft.com Twitter: @pietrobr http://wippy.grusp.org
  2. 2. Agenda Silverlight e Interoperabilità con PHP Costruiamo un’applicazione Silverlight http://wippy.grusp.org
  3. 3. Silverlight Plugin cross-browser e cross-platform Una versione light del runtime del .NET Framework che gira nel browser Installata con il plugin Funzionalità Out-Of-The-Browser Applicazioni di tipo multimediale Video, animazioni… Applicazioni di business Ricco insieme di controlli Accesso a sorgenti dati via Web Services: SOAP, REST… http://wippy.grusp.org
  4. 4. Silverlight breve storia Silverlight 4 Aprile 2010 Silverlight 3 Giugno 2009 Silverlight 2 15 ott 2008 Silverlight 1.0 Set 2007 http://wippy.grusp.org
  5. 5. Caricare un' applicazione Silverlight http://wippy.grusp.org
  6. 6. Caricare il plug-in Test.html http://wippy.grusp.org
  7. 7. Anatomia di un’applicazione Silverlight 4 e interoperabilità con PHP DEMO http://wippy.grusp.org
  8. 8. XAML, Controlli, Shapes http://wippy.grusp.org
  9. 9. Markup = Object Model <TextBlock FontSize="32" Text="Hello world" /> = TextBlock t = new TextBlock(); t.FontSize = 32; t.Text = "Hello world"; http://wippy.grusp.org
  10. 10. XAML Layout Control <Canvas Width="300" Height="300" xmlns="http://schemas.microsoft.com/client/2007" Attached property xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Ellipse Canvas.Left="20" Canvas.Top="20" Height="200" Width="200" Stroke="Black" StrokeThickness="10" Fill="Yellow" /> <Ellipse Canvas.Left="80" Canvas.Top="80" Shapes Height="35" Width="25" Stroke="Black" Fill="Black" /> <Ellipse Canvas.Left="140" Canvas.Top="80" Height="35" Width="25" Stroke="Black" Fill="Black" /> <Path Data="M 70, 150 A 60, 60 0 0 0 170, 150" Stroke="Black" StrokeThickness="15" StrokeStartLineCap="Round" StrokeEndLineCap="Round" /> </Canvas> http://wippy.grusp.org
  11. 11. Controlli in Silverlight 4 Form Controls: Core Controls: SDK Controls (*): TextBox AutoCompleteBox Border Rich Text Box Calendar Image ChildWindow PasswordBox MediaElement DataGrid Button MultiScaleImage DataPager Toggle/Repeat Button ToolTip TabControl ScrollViewer DatePicker CheckBox DescriptionViewer ProgressBar RadioButton Validatio Summary Save/OpenFileDialog DataForm ComboBox PasswordBox TreeView ListBox Popup – … Label Slider Shapes: Navigation Controls: Layout Controls: Ellipse HyperlinkButton StackPanel Rectangle Popup Line Grid / GridSplitter Frame TextBlock Canvas Path http://wippy.grusp.org
  12. 12. Silverlight Toolkit o Controlli con licenza Open Source (OSI MS-PL) o Aggiornati ogni 6-8 settimane o http://www.codeplex.com/Silverlight http://wippy.grusp.org
  13. 13. Personalizzazione di Controlli Styling e Skinning Styling Skinning http://wippy.grusp.org
  14. 14. Silverlight Flickr photo viewer Costruire la UI “Styling” DEMO http://wippy.grusp.org
  15. 15. DataBinding & DataTemplate http://wippy.grusp.org
  16. 16. Collegare la UI ai Dati Databinding o Bidirezionale: dalla UI al modello e viceversa o Funziona con oggetti che implementano IEnume- IQueryable o Array, Collections, Lists etc o Notifica via INotifyPropertyChanged XAML <TextBlock Text="{Binding Points, Mode=OneWay}"/> Binding binding = new Binding("Points"); C# binding.Mode = BindingMode.OneWay; TextBlock tb = new TextBlock(); tb.SetBinding(TextBlock.TextProperty, binding); http://wippy.grusp.org
  17. 17. Layout della UI e Dati DataTemplate class Car { string Image {get;set} DataTemplate string Model {get;set} } <DataTemplate x:Key="carTemplate"> <StackPanel> <Image Source="{Binding Image}" /> <TextBlock TextContent="{Binding Model}" /> </StackPanel> </DataTemplate> http://wippy.grusp.org
  18. 18. Networking http://wippy.grusp.org
  19. 19. Funzionalità di Networking HTTP/S [WebClient HttpWebRequest] WS*/SOAP [via Proxy WCF] REST [WebClient HttpWebRequest] RSS [Syndication API] Sockets Chiamate Cross Domain http://wippy.grusp.org
  20. 20. Chiamate Cross-Domain <?xml version="1.0"?> 2 formati: <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross- Flash policy file domain-policy.dtd"> <cross-domain-policy> Silverlight policy file <allow-access-from domain="*" /> </cross-domain-policy> <?xml version="1.0"?> <access-policy> Cross-domain.xml <cross-domain-access> <policy> <allow-from> <domain uri="http://customers.shop.com”/>" <domain uri="http://partner.com/app.xap"/> </allow-from> <grant-to> <grant path="/sales/serialnumbers.xml" /> <grant path="/partners" include-subpaths="false"/> </grant-to> </policy> clientaccesspolicy.xml </cross-domain-access> </access-policy> http://wippy.grusp.org
  21. 21. Trace http://wippy.grusp.org
  22. 22. DataBinding DataTemplate Networking Skinning DEMO http://wippy.grusp.org
  23. 23. Salviamo lo stato Isolated Storage API Come un cookie Virtual file system AppDataLocalLow (in Vista/7) Specifico per utente A livello di applicazione (http://.. pippo.xap != http://..pluto.xap) IsolatedStorageSettings [KeyValue] IsolatedStorageFile [Files e directory] http://wippy.grusp.org
  24. 24. Cosa NON abbiamo visto OpenFile Dialog Download on demand Splash Screen Dynamic CLR IronRuby, Ironpyton, Managed Jscript Visual State Manager DRM, via PlayReady e WMDRM 10 DeepZoom OOB HW Acceleration, Graphics http://wippy.grusp.org
  25. 25. In Conclusione Una piattaforma completa per le RIA .NET Framework con una ricca BCL Numerosi Controlli out-of-the box Skinning avanzato Stack di Networking Integrazione PHP http://wippy.grusp.org
  26. 26. http://wippy.grusp.org

×