Download presentation
Presentation is loading. Please wait.
Published byVictoria Ellis Modified over 9 years ago
3
Agenda
4
Windows Phone History WP 7.0 Silverlight WP 7.5 Silverlight WP 8.0 Silverlight WP 8.1 Silverlight WP 8.1 WinRT
5
Why stay on Windows Phone Silverlight?
6
Why Retarget to Windows Phone Silverlight 8.1 2-517: What’s new with Windows Phone Silverlight Apps! (Sam Jarwan, Harini Kannan)
7
Why choose the Windows Runtime? 3-591: Using Visual Studio to build XAML universal apps (Navit Saxena)
8
Introducing the Windows Runtime
9
Windows Runtime
11
Asynchronous Programming async void Button_Click(object sender, EventArgs e) { var service = new WebService(); this.Data = await services.FetchDataAsync(); this.Flag = FlagStates.Green; }
12
Asynchronous Programming Microsoft Virtual Academy: C# Fundamentals (http://aka.ms/CSFun) private async void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); // TODO: Save application state deferral.Complete(); }
14
// create folder // Windows.ApplicationModel.Package.Current.InstalledLocation; var folder = Windows.Storage.ApplicationData.Current.LocalFolder; var subfolder = await folder.CreateFolderAsync("MyFolder", Windows.Storage.CreationCollisionOption.OpenIfExists); // create file var file = await subfolder.CreateFileAsync("MyFile.txt", Windows.Storage.CreationCollisionOption.ReplaceExisting); // write await Windows.Storage.FileIO.WriteTextAsync(file, "Hello Build!"); // read var content = await Windows.Storage.FileIO.ReadTextAsync(file); // email var email = new EmailMessage(); email.Subject = "File is attached"; email.To.Add(new EmailRecipient("dpeusw@live.com")); email.Attachments.Add(new EmailAttachment(file.Name, file)); await EmailManager.ShowComposeNewEmailAsync(email);
15
Windows.Storage.ApplicationData
17
What, no MessageBox? var ok = new UICommand("ok", x => { /* TODO */ }); var cancel = new UICommand("cancel"); var dialog = new MessageDialog("message", "title"); dialog.Commands.Add(ok); dialog.Commands.Add(cancel); await dialog.ShowAsync();
18
If you use Microsoft.Phone.Tasks MarketplaceReviewTaskLaunch URI: zune:reviewapp?appid=app[app ID] MarketplaceSearchTaskLaunch URI: zune:search?publisher=[publisher ID]* WebBrowserTaskWindows.System.Launcher.LaunchUriAsync(Uri) AddressChooserTaskWindows.ApplicationModel.Contacts.ContactPicker PhoneCallTaskWindows.ApplicationModel.Calls.PhoneCallManager SmsComposeTaskWindows.ApplicationModel.Chat.ChatMessageManager
19
If you use Microsoft.Phone.BackgroundAgent 2-518: Background Tasks for Windows Phone (Shawn Henry)
20
If you use Live Tiles 2-253: Get your App Tapped (Matt Hidinger)
21
If you use Navigation & Back button 2-537: Navigation Model for Windows XAML Applications (Roberth Karman) Frame.Navigate(typeof(MapPage), “Seattle, WA”); Windows.Phone.UI.Input.HardwareButtons.BackPressed; var frame = Window.Current.Content as Frame; if (frame != null && frame.CanGoBack) { frame.GoBack(); e.Handled = true; }
22
If you use the Networking API //var client = new System.Net.Http.HttpClient(); var client = new Windows.Web.Http.HttpClient(); var response = await client.GetAsync(new Uri("http://server")); response.EnsureSuccessStatusCode(); var json = await response.Content.ReadAsStringAsync();
23
If you use Localization
24
2-543: Apps Without Borders (Cameron Lerum)
25
If you use Orientation using Windows.UI.ViewManagement; Window.Current.SizeChanged += (s, e) => { var view = ApplicationView.GetForCurrentView(); var orientation = view.Orientation; if (orientation == ApplicationViewOrientation.Landscape) VisualStateManager.GoToState(this, "Landscape", true); else VisualStateManager.GoToState(this, "Portrait", true); };
26
Code/Développement #mstechdays FileOpenPicker private void OpenFile_Click(object sender, RoutedEventArgs e) { FileOpenPicker picker = new FileOpenPicker(); picker.FileTypeFilter.Add(".mp4"); picker.PickSingleFileAndContinue(); }
27
Code/Développement #mstechdays FileOpenPicker Continuation protected override void OnActivated(IActivatedEventArgs e) { switch (e.Kind) { case ActivationKind.PickFileContinuation: var args = e as FileOpenPickerContinuationEventArgs; this.OnContinueFileOpenPicker(args); break; }
29
Code/Développement #mstechdays Share Contract private void ShareButton_Click(object sender, RoutedEventArgs e) { var manager = DataTransferManager.GetForCurrentView(); manager.DataRequested += DataTransferManager_DataRequested; DataTransferManager.ShowShareUI(); }
30
Code/Développement #mstechdays Share Contract private void DataTransferManager_DataRequested( DataTransferManager sender, DataRequestedEventArgs e) { e.Request.Data.Properties.Title = "Share Contract"; e.Request.Data.SetText("Hello World"); }
31
Review
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.