#win8acad : Building Metro Style Apps with XAML for .NET Developers

852 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
852
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
41
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

#win8acad : Building Metro Style Apps with XAML for .NET Developers

  1. 1. DllImport "avicap32.dll" "capCreateCaptureWindow"static extern int string int int int int int int int DllImport "avicap32.dll"static extern bool int MarshalAs UnmanagedType ref string int MarshalAs UnmanagedType ref string int// more and more of the same
  2. 2. using Windows.Media.Capture;var new CameraCaptureUI new Sizevar await CameraCaptureUIModeif var new BitmapImage await FileAccessMode
  3. 3. demo
  4. 4. demo
  5. 5. var new CameraCaptureUI new Sizevar await CameraCaptureUIModeif var new BitmapImage await FileAccessMode
  6. 6. var DataTransferManager.GetForCurrentView new TypedEventHandler<DataTransferManager DataRequestedEventArgsvoid if null "No Image Taken" else
  7. 7. try{ var new CameraCaptureUI new Sizecatch (Exception e){ //Exception handling code} ComException
  8. 8. var picker = new FileOpenPicker();picker.FileTypeFilter.Add("*");var files = await picker.PickMultipleFilesAsync();foreach (var file in files){ lbFiles.Items.Add(file.FileName);} PickMultipleFilesOperation PickMultipleFilesAsync(); public sealed class PickMultipleFilesOperation : IAsyncOperation<IReadOnlyList<StorageFile>>, IAsyncInfo
  9. 9. var picker = new FileOpenPicker();picker.FileTypeFilter.Add("*");var files = await picker.PickMultipleFilesAsync();foreach (StorageFile file in files){ lbFiles.Items.Add(file.FileName);} System.Collections.Generic.IReadOnlyList <Windows.Storage.StorageFile>
  10. 10. var picker = new FileOpenPicker();picker.FileTypeFilter.Add("*");var files = await picker.PickMultipleFilesAsync();foreach (StorageFile file in files){ lbFiles.Items.Add(file.FileName);} System.Collections.Generic.IReadOnlyList Windows.Foundation.Collections.IVectorView <Windows.Storage.StorageFile> <Windows.Storage.StorageFile>
  11. 11. FileOpenPicker picker = new FileOpenPicker();picker.FileTypeFilter.Add("*");StorageFile file = await picker.PickSingleFileAsync();Windows.Storage.Streams.IInputStream inputStream = await file.OpenForReadAsync();System.IO.Stream stream = inputStream.AsStream();System.IO.StreamReader reader = new StreamReader(stream);string contents = reader.ReadToEnd();
  12. 12. internal async void ProtectBytes(byte[] data, BinaryWriter output){ DataProtectionProvider dpp = new DataProtectionProvider(); IBuffer result = await dpp.ProtectAsync(data.AsBuffer()); byte[] protectedData; int start = 0; if (result.TryGetUnderlyingData(out protectedData, out start)) output.Write(protectedData); else throw new InvalidOperationException();}
  13. 13. ComVisible(true), Guid("06D7901C-9045-4241-B8A0-39A1AC0F8618")]public interface IWindowsApiSample{ string HelloWorld();}[ComVisible(true), [ClassInterface(ClassInterfaceType.None)][ComDefaultInterface(typeof(IWindowsApiSample))]public class WindowsApiSample : IWindowsApiSample{ public string HelloWorld() { return "Hello, World!"; }}
  14. 14. public sealed class MyClassLibrary{ public string HelloWorld() { return "Hello, World!"; }}
  15. 15. demo
  16. 16. var var
  17. 17. demo
  18. 18. demo

×