1 / 20

Microsoft Silverlight

Microsoft Silverlight. Silverlight. Hannað af Microsoft Með það að markmiði að geta hannað Multimedia rich web application. Keyrir í vafranum líkt og flash og java Átti upphaflega að vera partur af WPF (“Windows Presentation Foundation”) Lítið download, installerinn tekur 4.5 MB.

ulla-sears
Download Presentation

Microsoft Silverlight

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microsoft Silverlight

  2. Silverlight • Hannað af Microsoft • Með það að markmiði að geta hannað Multimedia rich web application. • Keyrir í vafranum líkt og flash og java • Átti upphaflega að vera partur af WPF (“Windows Presentation Foundation”) • Lítið download, installerinn tekur 4.5 MB.

  3. Silverlight • “Cross-Browser” og “Cross-Platform” • Keppir við Flash, JavaFX og Adobe FLEX. • Styður afspilun af öllu helsta margmiðlunarefni (WMV, WMA, MP3, ASF) • Styður Asyncronous samskipti (AJAX) • Styður Internet Explorer 6 SP2 og uppúr, Mozilla Firefox, Safari. • Ekki er stuðningur fyrir Konqueror né Opera þó hann sé planaður.

  4. WPF • Gerir .NET forritum auðveldara að eiga við sjónræna hluta forritsins. • Hefur mikinn stuðning fyrir alla margmiðlun, grafík, ‘animation’ og ‘interactivity’. • Kemur uppsett með Vista.

  5. Silverlight • Upphaflega vinnuheiti Silverlight var WPF/E (Windows Presentation Foundation Everywhere) • Styður öll .NET forritunarmálin, VB, C#, IronPython, Ruby. • XAML fyrir notendaviðmót • Aðgangur að öllum XAML hlutum í kóðanum.

  6. Silverlight • Mælt með að nota Microsoft Expression Blend við hönnun á viðmóti. • Visual Studio og Expression Blend vinna vel saman.

  7. Silverlight • Inniheldur viðbætur við Javascript. • Cross-browser, cross-platform support. • Aðgangur af .NET Framework • Styður Language Intergrated Query(LINQ) • Silverlight og ASP.NET vinna mjög vel saman.

  8. Silverlight elements

  9. LINQ • Language Integrated Query (LINQ), Borið fram “link”. • Forritarinn skrifar fyrirspurnir beint inní kóðann. • Einfaldar samskipti við gagnasöfn töluvert.

  10. LINQ Dæmi • string[] cities = { "London", "Paris", "Berlin", "Moscow", "Dublin", "Barcelona", "New York",   "Endinburgh", "Geneva", "Amsterdam", "Madrid" };   • IEnumerable<string> query = • from c in cities                             • Where c.StartsWith("M")                             • select c;   • foreach (string city in query) • { • Console.WriteLine(city); • }

  11. Annað LINQ dæmi • Northwind db = new Northwind(connectionString); • var q = from o in db.Orders • from c in db.Customers • where o.Quality == "200" && (o.CustomerID == c.CustomerID) • select new { o.DueDate, c.CompanyName, c.ItemID, c.ItemName }; • // q is now an IEnumerable<T>, where T is the anonymous type generated by the compiler • foreach (var t in q) • { • Console.WriteLine("DueDate Type = {0}", t.DueDate.GetType());Console.WriteLine("CompanyName (lowercased) = {0}", t.CompanyName.ToLower()); • Console.WriteLine("ItemID * 2 = {0}", t.ItemID * 2); • }

  12. Uppsetning á Silverlight • Hvað þarf ? • Microsoft Silverlight Runtime • Microsoft Visual Studio 2005 / 2008 • .NET Framework 3.0 • Microsoft Silverlight Tools for visual studio • Microsoft Expression Blend 2 • og fullt af optional forritum. Leiðbeiningar og dæmi á http://silverlight.net/GetStarted/

  13. Halló heimur í Silverlight • <Canvas x:Name="parentCanvas" • xmlns="http://schemas.microsoft.com/client/2007" • xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" • Loaded="Page_Loaded" • x:Class="SilverlightProject1.Page;assembly=ClientBin/SilverlightProject1.dll" • Width="640" • Height="480" • Background="White" • > • <TextBlock x:Name="MyMessage" Text=“Hello World" FontSize="56"></TextBlock> • </Canvas>

  14. Halló Heimur í Silverlight • Höfum aðgang að öllum hlutum XAML skjalsins á codebehind síðunni. • XAML hlutirnir í kóðanum hafa ýmsa eiginleika t.d alla helstu events og stillingar fyrir öll helstu atriði (hæð, breydd o.fl.) • Kóðahlutinn styður mikið af eiginleikum .NET t.d. Threading, etc. • Hver XAML fæll hefur 1 kóðaskrá bakvið sig.

  15. Halló Heimur í Silverlight • using System; • using System.Windows; • ...... • using System.Windows.Media.Animation; • using System.Windows.Shapes; • namespace SilverlightProject1 { • public partial class Page : Canvas • { • public void Page_Loaded(object o, EventArgs e) { • // Required to initialize variables • InitializeComponent(); • MyMessage.MouseLeftButtonDown += new MouseEventHandler(MyMessage_MouseLeftButtonDown); • } • void MyMessage_MouseLeftButtonDown(object sender, MouseEventArgs e) { • SolidColorBrush b = new SolidColorBrush( Color.FromRgb(255, 100, 100) ); • this.Background = b; • MyMessage.Text = "I was pushed ;'(!"; • } } }

  16. XAML dæmi • <DockPanel Width="100%">    <Border DockPanel.Dock="Top" Height="25%" Background="Pink" BorderThickness="2" BorderBrush="Black">          <SimpleText VerticalAlignment="Center" HorizontalAlignment="Center">Top 1</SimpleText>    </Border>            <Border DockPanel.Dock="Top" Height="25%" Background="Pink" BorderThickness="2" BorderBrush="Black">        <SimpleText VerticalAlignment="Center" HorizontalAlignment="Center">Top 2</SimpleText>    </Border>      <Border DockPanel.Dock="Bottom" Height="25%" Background="Cyan" BorderThickness="2" BorderBrush="Black">        <SimpleText VerticalAlignment="Center" HorizontalAlignment="Center">Bottom 1</SimpleText>    </Border>           <Border DockPanel.Dock="Bottom" Height="25%" Background="Cyan" BorderThickness="2" BorderBrush="Black">        <SimpleText VerticalAlignment="Center" HorizontalAlignment="Center">Bottom 2</SimpleText>    </Border>               </DockPanel>

  17. QUEUECARD

More Related