Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lap Around WinRT for .NET devs

Lap Around WinRT for .NET devs

Ryan Joy

April 06, 2013
Tweet

More Decks by Ryan Joy

Other Decks in Programming

Transcript

  1. //Easiest is to Add -> New Item -> Search Contract

    in visual Studio // Step 1: Declare the capability in the manifest <Extensions> <Extension Category="windows.search" /> </Extensions> //Step 2 : Handle the events SearchPane.GetForCurrentView().SuggestionsRequested += OnSuggestionsRequested; // in App class protected override void OnSearchActivated(SearchActivatedEventArgs a) { // Do search here }
  2. //Step 1 : Handle the events // implement as many

    data formats as you can void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args) { var request = args.Request; request.Data.Properties.Title = _item.Title; request.Data.Properties.Description = "Recipe directions"; request.Data.SetText(“ingredients”); request.Data.SetBitmap(reference); }