Silverlight を使用したデータアプリケーション開発手順

Similar documents
DEMO1 まずはやってみよう アクティビティをダブルクリック 作成 - プロジェクト C# => Workflow CodeActivity をぽとぺ シーケンシャルと ステートマシン それぞれのコ ンソールアプリ あとライブラリがある びっくりマークは足りていないあかし プロパティをみると判別で

XAML の勉強上要! WPF アプリケーションは作れます

Visual Studio Do-It-Yourself 第 9 回ユーザーコントロール 第 6 回のリソースから第 8 回のテンプレートで さまざまな方法でコントロールをカスタマズできるこ とを学びました 今回のテーマであるユーザーコントロールは 既存の一つのコントロールをカスタマ ズするのではな

WPF アプリケーションの 多言語切替

WPF アプリケーションの 多言語切替

Sparkline for WPF

PowerPoint プレゼンテーション

WPF Bindingの威力

PowerPoint プレゼンテーション

WPF アプリケーションの 多言語切替

XAML Do-It-Yourself シリーズ 第 7 回テンプレート -1-

PowerPoint プレゼンテーション

Microsoft認定資格問題集(70-483_demo)

目次 はじめに... 3 システムの必要条件... 3 サンプルアプリケーションの作成... 3 手順 手順 手順 手順 手順 手順 終わりに... 23

XAML Do-It-Yourself シリーズ 第 1 回 XAML 概要 -1-

XAML Do-It-Yourself 第 3 回ベントとトリガー XML Do-It-Yourself 第 3 回目は ベント処理とトリガーについて学習します Windows フォームゕプリケーションでは たとえば ボタンが押された というベントに対応する処理 ( ベントハンドラー ) を記述する

IT / KPI IT WF(XOML),BPEL WSDL XSD IT XSD WSDL BPEL XOML XML

.NET_3.5 Technical Briefing ソースコード説明 担当者の Demo 実施時の環境 注意 Visual Studio 2008β2 日本語版および Microsoft Silverlight Tools Alpha for Visual Studio 2008 Beta 2

わさわさとWPF

d_appendixB-asp10appdev.indd

XAML Do-It-Yourself シリーズ 第 11 回 2D グラフゖックス -1-

HOW DO I WebBrowser コントロールで HTML5 を 使用するには ここでは以下の手順で説明します Video 要素を使用する Silverlight と JavaScript の間でやり取りする Canvas 要素を使用する Video 要素を使用する 1. Visual Stu

Chart3D for WPF/Silverlight

SharpShooter Reports.WPF 基本的な使い方 Last modified on: November 15, 2012 本ドキュメント内のスクリーンショットは英語表記ですが SharpShooter Reports JP( 日本語版 ) では日本語で表示されます

著 作 権 このドキュメントに 記 載 されている 情 報 は このドキュメントの 発 行 時 点 におけるマクロソフトの 見 解 を 反 映 したものです マクロソフトは 市 場 の 変 化 に 対 応 する 必 要 があるため このドキュメントの 内 容 に 関 する 責 任 を 問 われないも

Carousel for WPF/Silverlight

XML Consortium 2009/5/8 XML Consortium Enterprise2.0 アプリを支えるクラウド基盤としての Windows Azure XML コンソーシアム Web 2.0 部会 日立ソフト宮崎昭世 Microsoft MVP for Development Pl

Microsoft Word - Android_SQLite講座_画面800×1280

スライド 1

Oracle JDeveloper 10g ADF Creation Date: Jul 07, 2004 Last Update: Jul 08, 2004 Version 1.0

MVP for VB が語る C# 入門

PowerPoint プレゼンテーション

BarCode for WPF

Microsoft PowerPoint - Windows Presentation Foundation (WPF) 3.5 の新機能

~ ユーザーインターフェイスの自動テスト ~

Oracle Lite Tutorial

2007 Microsoft Corporation. All rights reserved. 本書に記載した情報は 本書各項目に関する発行日現在の Microsoft の見解を表明するものです Microsoft は絶えず変化する市場に対応しなければならないため ここに記載した情報に対していかな

著作権 このドキュメントに記載されている情報は このドキュメントの発行時点におけるマクロソフトの見解を反映したものです マクロソフトは市場の変化に対応する必要があるため このドキュメントの内容に関する責任を問われないものとします また 発行日以降に発表される情報の正確性を保証できません このホワトペ

Visual Studio Do-It-Yourself シリーズ 第 18 回 ASP.NET MVC

Exam : 1z0-882 日本語 (JPN) Title : Oracle Certified Professional, MySQL 5.6 Developer Vendor : Oracle Version : DEMO 1 / 4 Get Latest & Valid 1z0-882-JP

intra-mart Accel Platform — イベントナビゲータ 開発ガイド   初版  

著作権 このドキュメントに記載されている情報は このドキュメントの発行時点におけるマクロソフトの見解を反映したものです マクロソフトは市場の変化に対応する必要があるため このドキュメントの内容に関する責任を問われないものとします また 発行日以降に発表される情報の正確性を保証できません このホワトペ

OutlookBar for WPF/Silverlight

Seasar.NET入門

PowerPoint プレゼンテーション

PDFViewer for WPF/Silverlight

Extended Library for UWP

C# の現在・過去・未来

Microsoft Visual Studio 2010 Professional Data Sheet

XAMLDo-It-Yourself 第 2 回. レゕウト 今回は XAML でウゖンドウにパネルやボタン メニューなどの基本的なコントロールを配置する方法を 学びます ここでは 次のことを学習します XAML におけるレゕウトの基本 主要なパネルとその記述方法 XAML (WPF) で利用可能な

Actual4Test Actual4test - actual test exam dumps-pass for IT exams

Microsoft Word - PHP_SQLServer2012

intra-mart Accel Platform — イベントナビゲータ 開発ガイド   初版   None

untitled

ハンズオンラボ ADO.NET Data Services の概要 ラボバージョン : 最終更新日 : 2010 年 2 月 9 日 ページ 1

Abstract Kinect for Windows RGB Kinect for Windows v Kinect for Windows v2

// このクラスの有効期間中の各呼び出しに使用される キャッシュされた Socket オブジェクト Socket socket = null; // 非同期処理が完了したことを通知するために信号を送るオブジェクト static ManualResetEvent clientdone = new Ma

DataSource for Entity Framework for WPF/Silverlight

10-C.._241_266_.Z

PowerPoint プレゼンテーション

Web フォームアプリケーション開発基礎

PLEASE READ (hidden slide)

( 目次 ) 1. はじめに 開発環境の準備 仮想ディレクトリーの作成 ASP.NET のWeb アプリケーション開発環境準備 データベースの作成 データベースの追加 テーブルの作成

Microsoft Word - Android_SQLite講座_画面800×1280

WPFの初歩の初歩

Whitepaper - Why CM7

IBM Cloud Social Visual Guidelines

DockControl for WPF/Silverlight

问题集 ITEXAMPASS 1 年で無料進級することに提供する

目次 はじめに... 2 このスタートゕップガドについて... 2 ArcGIS API for Microsoft Silverlight とは... 2 ArcGIS API for Microsoft Silverlight の開発環境... 3 Web マッピングアプリケーションの開発...

Microsoft認定資格問題集DEMO(70-459_Part2)

データアダプタ概要

WCF と IIS を使用して OData プロデューサーを作成する

YKToolkit.Controls 取扱説明書 Ver YKSoftware

intra-mart Accel Platform — IM-Repository拡張プログラミングガイド   初版  

HTTP 404 への対処

Oracle9i JDeveloperによるWebサービスの構築

ExtendedLibrary for WPF/Silverlight

Visual Studio Do-It-Yourself シリーズ 第 1 回 Windows ゕプリケーション開発の概要 -1-

目次 はじめに... 3 システムの必要条件... 4 ライセンス認証... 4 アクティベーション... 6 開発... 7 手順 1. アプリケーションの作成... 7 手順 2. データソースの作成と代入... 7 手順 3. テンプレートの作成 手順 4. レポートビューアの追加

00vb10-CONT-deitel.indd

SpringSecurity

新しいイテレーション型開発

ASP.NET 2.0 Provider Model 概要

BarCode for UWP

LightSwitch で申請システム Windows ストアアプリで受付システムを構築してみた 情報政策グループ技術職員金森浩治 1. はじめに総合情報基盤センターでは 仮想サーバホスティングサービスや ソフトウェアライセンス貸与といった さまざまなエンドユーザ向けサービスを行っている 上記のよう

INFRAGISTICS WPF 18.1 サービスリリースノート 2019 年 4 月 Infragistics WPF で実現する高度な BI ときれいなデスクトップ UI Infragistics WPF コントロールは 広範な機能を提供し 最小限の開発工数でアプリケーションの作成を可能にしま

intra-mart WebPlatform/AppFramework

wpf #wpf

Copyright 2006 KDDI Corporation. All Rights Reserved page1

内容 Visual Studio サーバーエクスプローラで学ぶ SQL とデータベース操作... 1 サーバーエクスプローラ... 4 データ接続... 4 データベース操作のサブメニューコンテキスト... 5 データベースのプロパティ... 6 SQL Server... 6 Microsoft

sp2-2.indd

Microsoft PowerPoint - hmoriya-REMIX2006-Print-New [互換モード]

CSS Nite × MS

Prep4Cram Latest IT Exam Prep Training and Certification cram

(OnePoint) ( URL Web Copyright 2005 Microsoft Corporation. All rights reserved. Microsoft Windows Visual Basic Visual Studio Microsoft Corporation

Oracle Lite Tutorial

xaml #xaml

TestDesign for Web

tkk0408nari

Transcription:

マクロソフト株式会社デベロッパーエバンジェリスト小高太郎 ( こだかたろう ) taro.kodaka@microsoft.com http://blogs.msdn.com/tarok/ 2009 Microsoft Corporation. All rights reserved. 2009 Microsoft Corporation. All rights reserved.

2 ゕジェンダ ントロダクション まずはサンプルシステムの説明を ポント解説 データサービス実装 データバンド データの追加削除 ( オプション ) EDMを利用したWCFサービス呼び出しによるストゕドプロシージャ実行とトランザクションの実装

3 2009 Microsoft Corporation. All rights reserved.

サンプルゕプリケーション データ処理を伴う Silverlight 3 ゕプリケーション ADO.NET Entity Framework ADO.NET Data Services WCF SQL Server 2008 Visual Studio のみで作成可能 見た目の考慮は最小限 Expression Blend 未使用 Silverlight を用いた業務ゕプリケーションを構築する場合の典型例として提示 今回は Web ショッピングサト

開発環境 Visual Studio 2008 Service Pack1 Visual Studio 2008 SP1 用 Microsoft Silverlight 3 Tools Silverlight Toolkit Microsoft SQL Server 2008 (Express 以上のエデゖション )

Silverlightを使用した Webショッピングサ ト概略図 エラーハンドルの実装 同時実行制御の実装 複数レコードの更新処理の実装 Web サーバー ASP.NET Application Server) Webブラウザ UI Service Data Access ADO.NET Data Services Silverlight 3 WCF Navigation Framework の利用 Silverlight Toolkit の利用 認証機能の実装 バインディングの実装 入力検証の実装 エラーハンドルの実装 2009 Microsoft Corporation. All rights reserved. ADO.NET Entity Framwork SQL Server 2008 データソース ADO.NET ストアドプロシージャの呼出しの実装 トランザクション処理の実装 6

7 2009 Microsoft Corporation. All rights reserved.

8 サービスによるデータゕクセス Silverlight ではデータゕクセスでサービスの利用が必要 サービスはすべて非同期処理 利用できるサービスと選択基準 WCF or ADO.NET Data Services

9 ADO.NET Data Services の利用 RESTful URI によるゕクセス CURD ページング 並び変え フゖルタ 変更管理 早期ロード 遅延ロードが可能 メリット クラゕントの変更管理が可能 サービス参照のエンドポントが一つ クラゕントの設定フゔル管理が容易 デメリット 複雑な処理 ( 複数テーブルのデータ取得 1:N レコードの一括更新 ) では実装が冗長

10 WCF の利用 SOAP CRUD に関わらず 様々な処理をメソッドとして公開可能 メリット 複雑な処理 ( 異なるデータソースのマージ結果の取得 ) などが実装可能 デメリット クラゕントの変更管理を実装する必要がある サービス参照のエンドポントが多くなる可能性がある

画面の構築 ListBox の追加 <!--プロダクトリスト--> <ListBox x:name="productlistbox" Margin="24,0,24,0" ItemsPanel="StaticResource HorizonalWrapPanel" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListBox.ItemTemplate> <DataTemplate> <Border Margin="4" Background="LightGray"> <Grid Width="160" Margin="4,8"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> Home.xaml <Border Margin="4" BorderBrush="Gray" BorderThickness="1" Background="White"> <Image x:name="productimage" Source="Binding ProductThumbnailUrl, 画像情報の表示 Converter=StaticResource UriToBitmapImageConverter" 相対パス のフォーマット Grid.Row="0" Stretch="None" Margin="8" /> </Border> <TextBlock Text="Binding Name" Grid.Row="1" TextWrapping="Wrap" FontWeight="Bold" /> 商品情報の表示 <Grid Grid.Row="2"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <TextBlock Text="価格" Grid.Column="0" /> <TextBlock Text="Binding Price, Converter=StaticResource FormattingConverter, ConverterParameter= 0:C " Grid.Column="1" FontWeight="Bold"/> </Grid> </Grid> </Border> 価格情報の表示 </DataTemplate> </ListBox.ItemTemplate> 金額情報 のフォーマット </ListBox> 2009 Microsoft Corporation. All rights reserved.

データの取得 protected override void OnNavigatedTo(NavigationEventArgs e) MSStoreSampleEntities context = MSStoreSampleEntities.CreateNoTracking(); var productsquery = (from product in context.defaultcolorproducts where product.categoryid == 1 select product) as DataServiceQuery<DefaultColorProducts>; Home.xaml.cs LINQ でのデータ取得 productsquery.beginexecute(defaultcolorproductsquerycompleted, productsquery); private void DefaultColorProductsQueryCompleted(IAsyncResult result) 非同期処理 コールバックメソッドの実装 Dispatcher.BeginInvoke(() => DataServiceQuery<DefaultColorProducts> query = result.asyncstate as DataServiceQuery<DefaultColorProducts>; productlistbox.itemssource = query.endexecute(result); );

15 2009 Microsoft Corporation. All rights reserved.

データバンド XAML ベースのバンド機能 System.Windows.FrameworkElement Page, UserControl を含む多くのコントロールで可能 依存関係プロパテゖ コントロールに設定してあるバンド可能なプロパテゖ DataContext 上位にある XAML 要素から継承される バンデゖングモード

バンデゖングモード 変更点の通知 INotifyPropertyChanged ンターフェスの実装 PropertyChanged ベントの発行で変更点の通知が可能 OneWay TwoWay OneTime DataContext にソースを設定 ソースの値に変化が発生 コントロールプロパテゖの値に変化が発生 コントロールに送信 コントロールに送信 ソースに送信

画面の構築 ListBox の追加 <TextBlock Text="商品詳細" FontSize="18" /> <TextBlock x:name="productnametextblock" Text="Binding Product.Name" FontSize="16" FontWeight="Bold" /> <Image x:name="productdetailimage" Source="Binding ProductImageUrl, Converter=StaticResource UriToBitmapImageConverter"/> <ListBox x:name="colorlistbox" ItemsPanel="StaticResource HorizonalWrapPanel" ScrollViewer.HorizontalScrollBarVisibility="Disabled" SelectionChanged="colorListBox_SelectionChanged" ItemsSource="Binding ProductColors" SelectedItem="Binding ProductColor, Mode=TwoWay" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0"> <ListBox.ItemTemplate> <DataTemplate> <Border BorderBrush="Gray" BorderThickness="1" Margin="2,0"> <Image Source="Binding ProductThumbnailUrl, Converter=StaticResource UriToBitmapImageConverter" Margin="2" Width="40" /> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox> 2009 Microsoft Corporation. All rights reserved. Product.xaml TwoWayバ ンドの実装

商品詳細エンテゖテゖの実装 public class ProductDetailContainer : INotifyPropertyChanged private string productimageurl; private Products product; private ProductColors productcolor; private IEnumerable<ProductColors> productcolors; public event PropertyChangedEventHandler PropertyChanged; ンターフェスの実装 public IEnumerable<ProductColors> ProductColors get return this.productcolors; set if (this.productcolors!= value) 変更の通知 this.productcolors = value; PropertyChanged(this, new PropertyChangedEventArgs("ProductColors")); this.productcolor = productcolors.firstordefault(color => color.productcolorid == product.defaultcolorid); public ProductColors ProductColor get return this.productcolor; set if (this.productcolor!= value) this.productcolor = value; this.productimageurl = productcolor.productimageurl; PropertyChanged(this, new PropertyChangedEventArgs("ProductColor")); ~ 後略 ~ ProductDetailContainer.cs

データバンドの利用 productdetail = new ProductDetailContainer(); LayoutRoot.DataContext = productdetail; var productquery = (from product in context.products where product.productid == productid select product) as DataServiceQuery<Products>; productquery.beginexecute(productquerycompleted, productquery); ProductDetailContainer の利用 Product.xaml.cs var colorsquery = (from color in context.productcolors where color.productid == productid select color) as DataServiceQuery<ProductColors>; colorsquery.beginexecute(productcolorsquerycompleted, colorsquery); private void ProductQueryCompleted(IAsyncResult result) Dispatcher.BeginInvoke(() => DataServiceQuery<Products> query = result.asyncstate as DataServiceQuery<Products>; productdetail.product = query.endexecute(result).firstordefault(); ); ProductDetail(Container) へのデータ充填 取得データの宣言 (OnNavigatedTo ベント ) Product.xaml.cs private void ProductColorsQueryCompleted(IAsyncResult result) Dispatcher.BeginInvoke(() => DataServiceQuery<ProductColors> query = result.asyncstate as DataServiceQuery<ProductColors>; productdetail.productcolors = query.endexecute(result).tolist(); ); private void colorlistbox_selectionchanged(object sender, SelectionChangedEventArgs e) productdetail.productimageurl = productdetail.productcolor.productimageurl; 上から呼ばれる非同期メソッド Product.xaml.cs TwoWay バンドの利用

Model-View-ViewModel パターン ( 参考 ) 一歩進んだ Silverlight ソリューション 今回のサンプルでは処理の簡略化のために未実装 WPF Silverlight の疎結合ソリューションのパターン 下記の実装を行う Model Data(Web)Service のエンテゖテゖ ( をラップする ) ViewModel Model を UI に合わせて公開する View ViewModel を XAML 等でバンドする 参照 : http://msdn.microsoft.com/jajp/magazine/dd458800.aspx

22 2009 Microsoft Corporation. All rights reserved.

ADO.NET Data Services での データの追加 / 更新 / 削除 コンテキストの異なる Entity を対象にする場合 Attach コンテキストの変更管理に含める SetLink エンテゖテゖ同士が関連している場合の認識の追加 複数レコード更新処理が可能 楽観同時実行制御可能

データの追加 別のコンテキストから取得し た Entity を追加対象にする ため Attach する Baskets basket = new Baskets() BasketId = Guid.NewGuid(), Customers = AuthenticationContext.Current.User.Customer, LastUpdateDate = DateTime.Now ; context.addtobaskets(basket); context.attachto("customers", AuthenticationContext.Current.User.Customer); context.setlink(basket, "Customers, AuthenticationContext.Current.User.Customer); Basket.xaml.cs Baskets と Customer はオブジェ クトグラフ構造をとり 別のコンテ キストから取得した Entity を対象 にするため SetLink する // Data Services による更新確定 context.beginsavechanges(savechangesoptions.batch, OnAddBasketSaveChanged, context); private void OnAddBasketSaveChanged(IAsyncResult result) Dispatcher.BeginInvoke(() => MSStoreSampleEntities context = result.asyncstate as MSStoreSampleEntities; DataServiceResponse response = context.endsavechanges(result); Application.Current.Resources.Remove("ProductDetail"); ); 2009 Microsoft Corporation. All rights reserved. 商品をバスケットに追加 Basket.xaml OnNavigatedTo ベント

データの削除 選択された商品情報 private void basketitemdeletebutton_click(object sender, RoutedEventArgs e) Button button = sender as Button; BasketItems item = button.datacontext as BasketItems; context.deleteobject(item); context.beginsavechanges(ondeletebasketitemsavechanged, context); Basket.xaml.cs private void OnDeleteBasketItemSaveChanged(IAsyncResult result) Dispatcher.BeginInvoke(() => MSStoreSampleEntities context = result.asyncstate as MSStoreSampleEntities; var deleteddescripters = context.getchanges(entitystates.deleted); 商品の削除ボタン押下 context.endsavechanges(result); Basket.xaml Baskets basket = basketpanel.datacontext as Baskets; basketitemdeletebutton_click ベント foreach (var descripter in deleteddescripters) BasketItems item = descripter.entity as BasketItems; basket.basketitems.remove(item); basketpanel.datacontext = null; basketpanel.datacontext = basket; ); 2009 Microsoft Corporation. All rights reserved.

楽観同時実行制御 ( 参考 ) エンテゖテゖの同時実行モードを Fixed にする 内部的にはレスポンスデータの Etag 値を利用 更新処理を行い並列の違反があれば DataServiceRequest が発生

最後に 本日のサンプル http://msdn.microsoft.com/ja-jp/samplecode.recipe.aspx 順次シナリオを公開しています データモデル データサービスの作成 データ取得 Silverlight ToolKit の利用 データ表示 ( コンバーター ) 画面のナビゲート データバンド 入力データの検証 ADO.NET Data Services と Silverlight によるエラーハンドリング 関連のある複数エンテゖテゖからのデータ取得 オンデマンドな認証処理の実装 データ処理 ( 追加更新 ) EDM を利用した WCF サービス呼び出しによるストゕドプロシージャ実行とトランザクションの実装

Silverlight 3 と SharePoint 開発 タ トル OBA実践講座 SharePoint Server 2007における RIA開発 Silverlight3を活用したカスタマイズ 2009 Microsoft Corporation. All rights reserved. 出版 日経BPソフトプレス ISBN 978-4-89100-674-7 定価 3,570円 税込み 2010年1月 予定

29 2009 Microsoft Corporation. All rights reserved.

ストゕドプロシージャを呼び出す為 に必要な準備 サーバーサド Entity Data Model にストゕドプロシージャを登録 モデルブラウザで関数ンポート EntityClient 上でストゕドプロシージャを呼び出す 現状 ObjectServices 対応のコードは自動生成されない 自動トランザクションの指定が可能 Silverlight 対応の WCF サービスとして公開 クラゕントサド Silverlight ゕプリケーションからの呼び出しは非同期の実装

サービスの実装 [OperationContract] public void CreateOrder(string userid, int paymenttype, Guid creaditcardid) using (MSStoreSampleEntities context = new MSStoreSampleEntities()) context.connection.open(); using (DbTransaction transaction = context.connection.begintransaction()) // 注文を作成します using (DbCommand command = context.connection.createcommand()) command.transaction = transaction; command.commandtype = CommandType.StoredProcedure; command.commandtext = "MSStoreSampleEntities.CreateOrder"; command.parameters.add( new EntityParameter("UserId", DbType.String) Value = userid ); command.parameters.add( new EntityParameter("PaymentType", DbType.Int32) Value = paymenttype ); command.parameters.add( new EntityParameter("CreditCardId", DbType.Guid) Value = creaditcardid ); command.parameters.add( new EntityParameter("ReturnValue", DbType.Int32) Direction = ParameterDirection.ReturnValue ); command.executenonquery(); int? returnvalue = ((int?)command.parameters["returnvalue"].value); // 注文が完了したら バスケットを削除します using (DbCommand command = context.connection.createcommand()) command.transaction = transaction; command.commandtype = CommandType.StoredProcedure; command.commandtext = "MSStoreSampleEntities.DeleteBasket"; command.parameters.add( new EntityParameter("UserId", DbType.String) Value = userid ); command.parameters.add( new EntityParameter("ReturnValue", DbType.Int32) Direction = ParameterDirection.ReturnValue ); command.executenonquery(); int? returnvalue = ((int?)command.parameters["returnvalue"].value); transaction.commit(); トランザクションの考慮 2009 Microsoft Corporation. All rights reserved. OrderServices.svc.cs EntityClient 上での実装

Silverlight (クラ ゕント) からの 呼び出し private void paymentbutton_click(object sender, System.Windows.RoutedEventArgs e) Basket.xaml.cs OrderServiceClient client = new OrderServiceClient(); client.createordercompleted += CreateOrderCompleted; client.createorderasync(authenticationcontext.current.user.username, 3, Guid.Empty); void CreateOrderCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) if (e.error!= null) 注文処理ボタン押下 Basket.xaml throw e.error; paymentbutton_click( ベント NavigationService.Navigate(new Uri("/Home", UriKind.RelativeOrAbsolute)); 非同期処理 コールバックメソッドの実装 2009 Microsoft Corporation. All rights reserved.