Integrazione PHP e Silverlight 4


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Integrazione PHP e Silverlight 4

  1. 1. PHP e Silverlight 4 Pietro Brambati, Microsoft Twitter: @pietrobr
  2. 2. Agenda Silverlight e Interoperabilità con PHP Costruiamo un’applicazione Silverlight
  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…
  4. 4. Silverlight breve storia Silverlight 4 Aprile 2010 Silverlight 3 Giugno 2009 Silverlight 2 15 ott 2008 Silverlight 1.0 Set 2007
  5. 5. Caricare un' applicazione Silverlight
  6. 6. Caricare il plug-in Test.html
  7. 7. Anatomia di un’applicazione Silverlight 4 e interoperabilità con PHP DEMO
  8. 8. XAML, Controlli, Shapes
  9. 9. Markup = Object Model <TextBlock FontSize="32" Text="Hello world" /> = TextBlock t = new TextBlock(); t.FontSize = 32; t.Text = "Hello world";
  10. 10. XAML Layout Control <Canvas Width="300" Height="300" xmlns="" Attached property xmlns:x=""> <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>
  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
  12. 12. Silverlight Toolkit o Controlli con licenza Open Source (OSI MS-PL) o Aggiornati ogni 6-8 settimane o
  13. 13. Personalizzazione di Controlli Styling e Skinning Styling Skinning
  14. 14. Silverlight Flickr photo viewer Costruire la UI “Styling” DEMO
  15. 15. DataBinding & DataTemplate
  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);
  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>
  18. 18. Networking
  19. 19. Funzionalità di Networking HTTP/S [WebClient HttpWebRequest] WS*/SOAP [via Proxy WCF] REST [WebClient HttpWebRequest] RSS [Syndication API] Sockets Chiamate Cross Domain
  20. 20. Chiamate Cross-Domain <?xml version="1.0"?> 2 formati: <!DOCTYPE cross-domain-policy SYSTEM " 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="”/>" <domain uri=""/> </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>
  21. 21. Trace
  22. 22. DataBinding DataTemplate Networking Skinning DEMO
  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]
  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
  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
  26. 26.