SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Downloaden Sie, um offline zu lesen
XAML /C# を使った
Windows ストアアプリ(LOB)構築 TIPS
- Prism 4.5 & Kona Project 等のご紹介 -

                   鈴木 章太郎
                   テクニカルエバンジェリスト
                   兼 MTC アーキテクト
                   日本マイクロソフト株式会社
                   http://blogs.msdn.com/b/shosuz/
https://www.facebook.com/shosuz




テクニカルエバンジェリスト
 http://blogs.msdn.com/b/shosuz
MTC アーキテクト
 http://www.microsoft.com/ja-jp/business/mtc/ads.aspx
呟きネタは主に、Windows Azure, Windows、
Windows Phone, RIA, HTML5, MVVM,
iOS/Android x Windows Azure連携, Guitar … 等
ASPIC 執行役員 (‘05 ~)
Wipse モバイル x クラウド部会長(’11 ~)
2005-2012 早稲田大学大学院非常勤講師、
2008-2010 中央大学非常勤講師
Microsoft 軽音楽部 広報担当 (Gt./Key./DAW)
(2012 ~)
アジェンダ
        
        
        

        

        
Windows ストア LOB アプリ
 LOB アプリケーションにも本格導入検討中の企業が多い
 課題としては
    既存のアプリケーションとの共存の方法
    開発リソースの確保、技術研修等
    既存アプリケーションの互換性確認の問題
    Windows RT か Windows 8 Pro/Enterprise か
    配布の方法(Windows ストア、SCCM、Active Directory、
               Intune、他)
データソースとしての選択肢
 ストアアプリケーションは基本的にデータベース直接接続不可
 LOB アプリケーションはヘテロな環境に追加される
      新規に構築する and/or 既存のリレーショナルデータベース
      新規に公開する and/or 既存の Web サービス
      新規に構築する and/or 既存のコンテンツサーバー
      マスターデータが置かれているサーバー, etc.
 ASP.NET MVC4 Web API か WCF Data Services か
      データベース(特に SQL Server )は Data Services
      サービスの公開だと Web API が有用だが、LINQ で制限あり
      Data Services は RDBMS、Web API はそれ以外のもの
      組み合わせて使う(Windows Azure の場合は Mobile Services もあり)
百貨店の店舗用商品カタログのフロー例
                                                                                                  XML-RPC
商品情報                                                                                            マスター情報を検索
を検索
REST
           画像 URLを
 7:37 AM
           含む商品情         画像 URL                                                                              マスター
           報を取得          を検索                                                                          REST   情報を取得
                           SharePoint Site                                                       se
                                          http://sharepoint/url                                  ar
                                                                                                 ch
                           Site Actions Browse         Page                                     username

                                    Parent > Parent > Current Page
                                       Page Title


                           Current Page
                                      Page One         Page Two      This Site: site   search




画像情報を
                          Libraries
                          Site Pages
                          Shared
                          Documents




リクエスト           画像 URL
                          Drop Off
                          Library
                          Custom
                          library




画像情報を           を取得
返す
Entity Framework + Code First
 クラスを作成してデータベースを作成
     System.ComponentModel.DataAnnotations
     スキーマ修正、マイグレーション可能
     テストデータを入れられる
     新規サービス立ち上げやマッシュアップサービスの構築ニーズに合致


 ASP.NET MVC4 Web API でも WCF Data Services でも利用可能
   ただし前者の場合は、使いやすいようにクラス設計をすべき
Web API によるサービスの公開
 簡単に自動生成可能
  コントローラ名決定
  スキャフォールディング
 オプションから選択
  テンプレート
  モデルクラス
  データコンテキストクラス
 クラスを適宜修正・追加
  メソッドの追加、等
Kona プロジェクトとは?
        •

        •




        •
Kona Project とは?
http://konaguidance.codeplex.com
 CodePlex に公開された MVVM
  フレームワーク
 Prism 4.5の一部を利用
 C# / XAML に特化
 Windows ストア LOB アプリ開発
  のために最適化
      設定・検索チャーム
      各フレームへの遷移
      バリデーション
      その他順次追加予定
その前に Prism – 元々は…
WPF, Silverlight, Windows Phone 開発用
                     •
                     •
                     •
                     •

                     •
                     •
Prism は Windows ストアアプリ向きか?
               •   Modularity
               •   UI Composition
               •   Region Navigation
               •   Decoupled
                   Communication
               •   Commands
               •   MVVM Support
1. Windows Phone 開発の経験を十分に活用する
 Windows Phone アプリ             Windows ストアアプリ
 Deactivate/Tombstoned/Reactiv Suspend/Terminate/Resume
 ate
 Microsoft Push Notification   Windows Push Notification
 Service (MPN)                 Service (WNS)
 Windows Phone Marketplace     Windows Store app certification
 certification                 & Application Excellence Review
                               (AER)
 App manifest declares         App manifest declares
 capabilities                  capabilities
2. AttachedBehavior にフォーカスする
•    AttachedBehavior の経験を活
     かし、それにフォーカス
      後からコントロールに動作を追加できる
•    Blend のBehavior<T>
     → 使わない
•    Expressions のバインディング
     → 使わない
3. Push 通知には要 Windows ストア開発者登録
              • Windows ストアに、開発した
                アプリを申請し、正しいクレ
                デンシャルを取得する
                (SID 及びシークレットキー)
              • 完全にサイドローディングで
                配布する前提で設計・開発を
                行ったアプリからは、WNS
                (Windows Notification
                Service)を使ったプッシュ配
                信はできない → 通知ハブ?
4. .NET 4.5 の async と await を活用する
async Task<int> AccessTheWebAsync()
{
        HttpClient client = new HttpClient();
        Task<string> getStringTask =
          client.GetStringAsync("http://msdn.microsoft.com");
        DoIndependentWork();
        string urlContents = await getStringTask;
        return urlContents.Length;
    }
ページ遷移とナビゲーション
5. LayoutAwarePage クラスの使用
ページ遷移、状態管理、および Visual State の管理のため
Navigation support
         protected virtual void GoHome(object sender, RoutedEventArgs e)
         protected virtual void GoBack(object sender, RoutedEventArgs e)
         protected virtual void GoForward(object sender, RoutedEventArgs e)
Visual state switching
         public void StartLayoutUpdates(object sender, RoutedEventArgs e)
         public void StopLayoutUpdates(object sender, RoutedEventArgs e)
Process lifetime management
         protected override void OnNavigatedTo(NavigationEventArgs e)
         protected override void OnNavigatedFrom(NavigationEventArgs e)
         protected virtual void LoadState(Object navigationParameter,
                                                Dictionary<String, Object> pageState)
         protected virtual void SaveState(Dictionary<String, Object> pageState)
Navigation と Visual State のサポート
XAML:
<Button Click="GoBack"
        IsEnabled="{Binding Frame.CanGoBack,
        ElementName=pageRoot}
        "Style="{StaticResource BackButtonStyle}“
/>
<UserControl
        Loaded="StartLayoutUpdates"
        Unloaded="StopLayoutUpdates“
>
LoadState と SaveState : SuspensionManager
protected override void SaveState(System.Collections.Generic.Dictionary<string, object> pageState)
{
    var virtualizingStackPanel =
                      VisualTreeUtilities.GetVisualChild<VirtualizingStackPanel>(itemGridView);
    if (virtualizingStackPanel != null && pageState != null)
    {
        pageState["virtualizingStackPanelHorizontalOffset"] = virtualizingStackPanel.HorizontalOffset;
    }
}


protected override void LoadState(object navigationParameter,
                                       System.Collections.Generic.Dictionary<string, object> pageState)
{
    if (pageState != null && pageState.ContainsKey("virtualizingStackPanelHorizontalOffset"))
    {
        double.TryParse(pageState["virtualizingStackPanelHorizontalOffset"].ToString(),
                        out virtualizingStackPanelHorizontalOffset);
    }
}
6. Visual State のサポートによる
   landscape, portrait, fill, and snap
<VisualStateManager.VisualStateGroups>
    <VisualStateGroup x:Name="ApplicationViewStates">
        <VisualState x:Name="FullScreenLandscape"/>
        <VisualState x:Name="Filled"/>
        <VisualState x:Name="FullScreenPortrait">
             <Storyboard>   ...   </Storyboard>
         </VisualState>
         <VisualState x:Name="Snapped">
             <Storyboard>   ...   </Storyboard>
         </VisualState>
     </VisualStateGroup>
</VisualStateManager.VisualStateGroups>
グローバル対応
7.グローバル対応 -
 ロケールごとに分離されたリソース



    <ToolTip
        x:Uid=“PreviewCartoonizeAppBarButtonToolTip”
        Content=“Preview Cartoonization”
        … />
Model-View-ViewModel Pattern
8. ページ遷移:
View First かViewModel First か
View First:
this.Frame.Navigate(typeof(ItemDetailPage), itemId);


ViewModel First:
Var itemDetailPageViewModel = new ItemDetailPageViewModel(…)
                                     { ItemId = itemId };
navigationService.Navigate(itemDetailPageViewModel);
9. BindableBase クラスの利用による
       INotifyPropertyChanged の提供
public abstract class BindableBase : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;

    protected bool SetProperty<T>(ref T storage, T value, [CallerMemberName] String propertyName = null)
    {
        if (object.Equals(storage, value)) return false;
        storage = value;
        this.OnPropertyChanged(propertyName);
        return true;
    }
    protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        var eventHandler = this.PropertyChanged;
        if (eventHandler != null)
        {
            eventHandler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
10. Kona ViewModelLocator の利用
•   Convention ベースのルックアップ
    •   MyNamespace.MyPage -> MyNamespace.MyPageViewModel
•   ルールに基づく例外により Conventionのオーバーライドが可能
•   ViewModel をインスタンス化するのにコンテナを活用可能
WPF/Silverlight における
    典型的なバリデーション
•   Implement INotifyDataErrorInfo
•   UI コントロールでエラーのディクショナリにバインド
    •   NotifyOnValidationError=True

<TextBox Text="{Binding Id, Mode=TwoWay, ValidatesOnExceptions=True,
NotifyOnValidationError=True}"/>
11. Kona BindableValidator の利用
View:
<TextBox
           Text="{Binding Address.FirstName, Mode=TwoWay}"
           behaviors:HighlightFormFieldOnErrors.PropertyErrors=
           "{Binding Errors[FirstName]}" />
-----------------------------------------------------------------------------
ViewModel:
_bindableValidator = new BindableValidator(_address);


public BindableValidator Errors
{
    get { return _bindableValidator; }
}
Decoupled Eventing
           •   “ハリウッド式ペアレンタル
               スタイルの UI コンポジション”
               (ユーザーコントロール)
           •   子コントロールは、長時間持続す
               るサービスにより発生したイベン
               トをリッスンする必要があるも、
               自らそれを、取り外すことはでき
               ない
           •   Prism の EventAggregator 部分
               をポーティング
12. 必要に応じて EventAggregator 使用
public SubscriberViewModel(IEventAggregator eventAggregator)
{
    eventAggregator.GetEvent<ShoppingCartUpdatedEvent>()
               .Subscribe(s => UpdateItemCountAsync());
}

public PublisherViewModel(IEventAggregator eventAggregator)
{
    _eventAggregator = eventAggregator;
}

_eventAggregator.GetEvent<ShoppingCartUpdatedEvent>()
               .Publish(string.Empty);
Commanding と ViewModel Method Invocation
ICommand:
         void Execute(object)
         bool CanExecute(object)
         event EventHandler CanExecuteChanged
Command Invoker:
         ButtonBase
-----------------------------------------------------
Event -> Action
13. コントロールに
    ICommand をサポートする DelegateCommand を使用
View:
<Button Content=“Go to shopping cart”
 Command="{Binding ShoppingCartNavigationCommand}" />
---------------------------------------------------------------------
ViewModel:
ShoppingCartNavigationCommand = new
DelegateCommand(NavigateToShoppingCartPage,
                      CanNavigateToShoppingCartPage);

ShoppingCartNavigationCommand.RaiseCanExecuteChanged();
14. AttachedBehavior や Action を使用する
View:
<GridView x:Name="itemGridView“
         ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}"
         ItemTemplate="{StaticResource KonaRI250x250ItemTemplate}"
         SelectionMode="None“ IsItemClickEnabled="True"
         behaviors:ListViewItemClickedToAction.Action=
                  "{Binding CategoryNavigationAction}">
----------------------------------------------------------------------------------
ViewModel:
CategoryNavigationAction = NavigateToCategory;
Suspend, Resume, 及びTerminate
15. Kona RestorableStateAttribute と
    MVVM フレームワークの利用
public class MyViewModel : ViewModel, INavigationAware
{
        private string _name;

       [RestorableState]
         public string Name
       {
           get { return _name; }
           set { SetProperty(ref _name, value); }
       }
}
16. Visual Studio との統合
    Windows              Windows
    Azure Store          Phone Store
ALM ソリューションの提供
ALM ソリューションの提供
クライアント

          Visual Studio Ultimate 2012
       アプリケーション ライフサイクル全体を包括的にカバー

          Visual Studio Premium 2012
             統合開発環境とテスト機能を搭載
 Visual Studio         Visual Studio
 Professional 2012     Test Professional 2012
 開発機能を提供する統合開発環境        包括的なテストの実施と管理を支援


サーバー

  Visual Studio Team Foundation Server 2012
         アプリケーション開発プロジェクトの統合開発基盤
参考情報
 Visual Studio 2012 導入事例
    http://aka.ms/VS2012-Case
 Visual Studio 2012 が提供する統合ソリューション
    http://aka.ms/VS2012-Sol
 Visual Studio 2012 製品ガイド(PDF, 16MB)
    http://aka.ms/VS2012-Prod
 Visual Studio 2012 試用版
    http://aka.ms/VS2012-Try
 Visual Studio 2012 ライセンス ホワイトペーパー
    http://aka.ms/VS2012-Lic
Resource
 http://konaguidance.codeplex.com
   英語版 OS でないと .exe は解凍できない場合あり
   Source Code → Download で .zip を落としてください
XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips   Prism 4.5 & Kona project 等のご紹介

Weitere ähnliche Inhalte

Was ist angesagt?

JSON Schema で Web API のスキマを埋めよう
JSON Schema で Web API のスキマを埋めようJSON Schema で Web API のスキマを埋めよう
JSON Schema で Web API のスキマを埋めようVOYAGE GROUP
 
ノンプログラミングで API はじめて体験!_築山 春木氏
ノンプログラミングで API はじめて体験!_築山 春木氏ノンプログラミングで API はじめて体験!_築山 春木氏
ノンプログラミングで API はじめて体験!_築山 春木氏kintone papers
 
Build insider testingwithvs
Build insider testingwithvsBuild insider testingwithvs
Build insider testingwithvsTomoyuki Iwade
 
WebAssemblyが切り拓くフロントエンドWeb開発の未来
WebAssemblyが切り拓くフロントエンドWeb開発の未来WebAssemblyが切り拓くフロントエンドWeb開発の未来
WebAssemblyが切り拓くフロントエンドWeb開発の未来Jun-ichi Sakamoto
 
パララックスでレスポンシブでJ query mobileなサイトのつくりかた
パララックスでレスポンシブでJ query mobileなサイトのつくりかたパララックスでレスポンシブでJ query mobileなサイトのつくりかた
パララックスでレスポンシブでJ query mobileなサイトのつくりかたShumpei Shiraishi
 
WebブラウザでC#実行 WebAssemblyの技術
WebブラウザでC#実行 WebAssemblyの技術WebブラウザでC#実行 WebAssemblyの技術
WebブラウザでC#実行 WebAssemblyの技術Sho Okada
 
Vs2013 multi device shosuz
Vs2013 multi device shosuzVs2013 multi device shosuz
Vs2013 multi device shosuzShotaro Suzuki
 
APIモック3分クッキング
APIモック3分クッキングAPIモック3分クッキング
APIモック3分クッキング政雄 金森
 
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -Koji Ishimoto
 
オフラインファーストの思想と実践
オフラインファーストの思想と実践オフラインファーストの思想と実践
オフラインファーストの思想と実践Shumpei Shiraishi
 
.NET の今と今後に思うこと
.NET の今と今後に思うこと.NET の今と今後に思うこと
.NET の今と今後に思うことAkira Inoue
 
App Service の DevOps と Visual Studio Team Services 最新アップデート
App Service の DevOps と Visual Studio Team Services 最新アップデートApp Service の DevOps と Visual Studio Team Services 最新アップデート
App Service の DevOps と Visual Studio Team Services 最新アップデートMicrosoft Azure Japan
 
Swaggerで始めるモデルファーストなAPI開発
Swaggerで始めるモデルファーストなAPI開発Swaggerで始めるモデルファーストなAPI開発
Swaggerで始めるモデルファーストなAPI開発Takuro Sasaki
 
Service worker が拓く mobile web の新しいかたち
Service worker が拓く mobile web の新しいかたちService worker が拓く mobile web の新しいかたち
Service worker が拓く mobile web の新しいかたちKinuko Yasuda
 
.NET 6の期待の新機能とアップデート
.NET 6の期待の新機能とアップデート.NET 6の期待の新機能とアップデート
.NET 6の期待の新機能とアップデートTomomitsuKusaba
 
ASP.NET習得の最短経路を考察する
ASP.NET習得の最短経路を考察するASP.NET習得の最短経路を考察する
ASP.NET習得の最短経路を考察するMasaki Takeda
 
進化する Web ~ Progressive Web Apps の実装と応用 ~
進化する Web  ~ Progressive Web Apps の実装と応用 ~進化する Web  ~ Progressive Web Apps の実装と応用 ~
進化する Web ~ Progressive Web Apps の実装と応用 ~Microsoft Azure Japan
 
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web ServiceアプリケーションAngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーションssuser070fa9
 
webpackを使ったワンランク上のモダンJSカスタマイズ_門屋 亮氏
webpackを使ったワンランク上のモダンJSカスタマイズ_門屋 亮氏webpackを使ったワンランク上のモダンJSカスタマイズ_門屋 亮氏
webpackを使ったワンランク上のモダンJSカスタマイズ_門屋 亮氏kintone papers
 
サーバーレスで ガチ本番運用までやってるお話し
サーバーレスで ガチ本番運用までやってるお話しサーバーレスで ガチ本番運用までやってるお話し
サーバーレスで ガチ本番運用までやってるお話しAkira Nagata
 

Was ist angesagt? (20)

JSON Schema で Web API のスキマを埋めよう
JSON Schema で Web API のスキマを埋めようJSON Schema で Web API のスキマを埋めよう
JSON Schema で Web API のスキマを埋めよう
 
ノンプログラミングで API はじめて体験!_築山 春木氏
ノンプログラミングで API はじめて体験!_築山 春木氏ノンプログラミングで API はじめて体験!_築山 春木氏
ノンプログラミングで API はじめて体験!_築山 春木氏
 
Build insider testingwithvs
Build insider testingwithvsBuild insider testingwithvs
Build insider testingwithvs
 
WebAssemblyが切り拓くフロントエンドWeb開発の未来
WebAssemblyが切り拓くフロントエンドWeb開発の未来WebAssemblyが切り拓くフロントエンドWeb開発の未来
WebAssemblyが切り拓くフロントエンドWeb開発の未来
 
パララックスでレスポンシブでJ query mobileなサイトのつくりかた
パララックスでレスポンシブでJ query mobileなサイトのつくりかたパララックスでレスポンシブでJ query mobileなサイトのつくりかた
パララックスでレスポンシブでJ query mobileなサイトのつくりかた
 
WebブラウザでC#実行 WebAssemblyの技術
WebブラウザでC#実行 WebAssemblyの技術WebブラウザでC#実行 WebAssemblyの技術
WebブラウザでC#実行 WebAssemblyの技術
 
Vs2013 multi device shosuz
Vs2013 multi device shosuzVs2013 multi device shosuz
Vs2013 multi device shosuz
 
APIモック3分クッキング
APIモック3分クッキングAPIモック3分クッキング
APIモック3分クッキング
 
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
 
オフラインファーストの思想と実践
オフラインファーストの思想と実践オフラインファーストの思想と実践
オフラインファーストの思想と実践
 
.NET の今と今後に思うこと
.NET の今と今後に思うこと.NET の今と今後に思うこと
.NET の今と今後に思うこと
 
App Service の DevOps と Visual Studio Team Services 最新アップデート
App Service の DevOps と Visual Studio Team Services 最新アップデートApp Service の DevOps と Visual Studio Team Services 最新アップデート
App Service の DevOps と Visual Studio Team Services 最新アップデート
 
Swaggerで始めるモデルファーストなAPI開発
Swaggerで始めるモデルファーストなAPI開発Swaggerで始めるモデルファーストなAPI開発
Swaggerで始めるモデルファーストなAPI開発
 
Service worker が拓く mobile web の新しいかたち
Service worker が拓く mobile web の新しいかたちService worker が拓く mobile web の新しいかたち
Service worker が拓く mobile web の新しいかたち
 
.NET 6の期待の新機能とアップデート
.NET 6の期待の新機能とアップデート.NET 6の期待の新機能とアップデート
.NET 6の期待の新機能とアップデート
 
ASP.NET習得の最短経路を考察する
ASP.NET習得の最短経路を考察するASP.NET習得の最短経路を考察する
ASP.NET習得の最短経路を考察する
 
進化する Web ~ Progressive Web Apps の実装と応用 ~
進化する Web  ~ Progressive Web Apps の実装と応用 ~進化する Web  ~ Progressive Web Apps の実装と応用 ~
進化する Web ~ Progressive Web Apps の実装と応用 ~
 
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web ServiceアプリケーションAngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
 
webpackを使ったワンランク上のモダンJSカスタマイズ_門屋 亮氏
webpackを使ったワンランク上のモダンJSカスタマイズ_門屋 亮氏webpackを使ったワンランク上のモダンJSカスタマイズ_門屋 亮氏
webpackを使ったワンランク上のモダンJSカスタマイズ_門屋 亮氏
 
サーバーレスで ガチ本番運用までやってるお話し
サーバーレスで ガチ本番運用までやってるお話しサーバーレスで ガチ本番運用までやってるお話し
サーバーレスで ガチ本番運用までやってるお話し
 

Andere mochten auch

Room metro Tokyo #3 発表資料です。
Room metro Tokyo #3 発表資料です。Room metro Tokyo #3 発表資料です。
Room metro Tokyo #3 発表資料です。Manato KAMEYA
 
Windows 8時代のアプリ開発
Windows 8時代のアプリ開発Windows 8時代のアプリ開発
Windows 8時代のアプリ開発信之 岩永
 
わんくま名古屋 #37 (20151114) Windows 10 UWP アプリ開発入門(実践編)
わんくま名古屋 #37 (20151114) Windows 10 UWP アプリ開発入門(実践編)わんくま名古屋 #37 (20151114) Windows 10 UWP アプリ開発入門(実践編)
わんくま名古屋 #37 (20151114) Windows 10 UWP アプリ開発入門(実践編)Yasuhiko Yamamoto
 
Anders Hejlsberg Q & A
Anders Hejlsberg Q & AAnders Hejlsberg Q & A
Anders Hejlsberg Q & A信之 岩永
 
WPF開発での陥りやすい罠
WPF開発での陥りやすい罠WPF開発での陥りやすい罠
WPF開発での陥りやすい罠Sho Okada
 
C#とILとネイティブと
C#とILとネイティブとC#とILとネイティブと
C#とILとネイティブと信之 岩永
 
C#や.NET Frameworkがやっていること
C#や.NET FrameworkがやっていることC#や.NET Frameworkがやっていること
C#や.NET Frameworkがやっていること信之 岩永
 

Andere mochten auch (7)

Room metro Tokyo #3 発表資料です。
Room metro Tokyo #3 発表資料です。Room metro Tokyo #3 発表資料です。
Room metro Tokyo #3 発表資料です。
 
Windows 8時代のアプリ開発
Windows 8時代のアプリ開発Windows 8時代のアプリ開発
Windows 8時代のアプリ開発
 
わんくま名古屋 #37 (20151114) Windows 10 UWP アプリ開発入門(実践編)
わんくま名古屋 #37 (20151114) Windows 10 UWP アプリ開発入門(実践編)わんくま名古屋 #37 (20151114) Windows 10 UWP アプリ開発入門(実践編)
わんくま名古屋 #37 (20151114) Windows 10 UWP アプリ開発入門(実践編)
 
Anders Hejlsberg Q & A
Anders Hejlsberg Q & AAnders Hejlsberg Q & A
Anders Hejlsberg Q & A
 
WPF開発での陥りやすい罠
WPF開発での陥りやすい罠WPF開発での陥りやすい罠
WPF開発での陥りやすい罠
 
C#とILとネイティブと
C#とILとネイティブとC#とILとネイティブと
C#とILとネイティブと
 
C#や.NET Frameworkがやっていること
C#や.NET FrameworkがやっていることC#や.NET Frameworkがやっていること
C#や.NET Frameworkがやっていること
 

Ähnlich wie XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips Prism 4.5 & Kona project 等のご紹介

HTML5でオフラインWebアプリケーションを作ろう
HTML5でオフラインWebアプリケーションを作ろうHTML5でオフラインWebアプリケーションを作ろう
HTML5でオフラインWebアプリケーションを作ろうyoshikawa_t
 
Windows Azure ではじめる Windows ストアアプリ開発
Windows Azure ではじめる Windows ストアアプリ開発Windows Azure ではじめる Windows ストアアプリ開発
Windows Azure ではじめる Windows ストアアプリ開発Shotaro Suzuki
 
次期Office製品群の新しい開発モデルの解説
次期Office製品群の新しい開発モデルの解説次期Office製品群の新しい開発モデルの解説
次期Office製品群の新しい開発モデルの解説kumo2010
 
jQuery と MVC で実践する標準志向 Web 開発
jQuery と MVC で実践する標準志向 Web 開発jQuery と MVC で実践する標準志向 Web 開発
jQuery と MVC で実践する標準志向 Web 開発Akira Inoue
 
Jjug springセッション
Jjug springセッションJjug springセッション
Jjug springセッションYuichi Hasegawa
 
Webフロントエンド開発の最新トレンド - HTML5, モバイル, オフライン
Webフロントエンド開発の最新トレンド - HTML5, モバイル, オフラインWebフロントエンド開発の最新トレンド - HTML5, モバイル, オフライン
Webフロントエンド開発の最新トレンド - HTML5, モバイル, オフラインShumpei Shiraishi
 
Elastic on Azure Integration & Building React UI Based Search App Using Azure...
Elastic on Azure Integration & Building React UI Based Search App Using Azure...Elastic on Azure Integration & Building React UI Based Search App Using Azure...
Elastic on Azure Integration & Building React UI Based Search App Using Azure...Shotaro Suzuki
 
Data API + AWS = (CMS どうでしょう 札幌編)
Data API + AWS =  (CMS どうでしょう 札幌編)Data API + AWS =  (CMS どうでしょう 札幌編)
Data API + AWS = (CMS どうでしょう 札幌編)Yuji Takayama
 
Featuring Project Silk & Liike: 楽しい "モダン" Web 開発のちょっとディープなお話
Featuring Project Silk & Liike: 楽しい "モダン" Web 開発のちょっとディープなお話Featuring Project Silk & Liike: 楽しい "モダン" Web 開発のちょっとディープなお話
Featuring Project Silk & Liike: 楽しい "モダン" Web 開発のちょっとディープなお話Akira Inoue
 
Web リソースを活用した簡単アプリケーション開発(Windows Phone)
Web リソースを活用した簡単アプリケーション開発(Windows Phone)Web リソースを活用した簡単アプリケーション開発(Windows Phone)
Web リソースを活用した簡単アプリケーション開発(Windows Phone)Akira Onishi
 
マイクロソフトWeb開発の今と今後
マイクロソフトWeb開発の今と今後マイクロソフトWeb開発の今と今後
マイクロソフトWeb開発の今と今後Akira Inoue
 
Concentrated HTML5 & Attractive HTML5
Concentrated HTML5 & Attractive HTML5Concentrated HTML5 & Attractive HTML5
Concentrated HTML5 & Attractive HTML5Sho Ito
 
勉強会force#3 iOSアプリ開発
勉強会force#3 iOSアプリ開発勉強会force#3 iOSアプリ開発
勉強会force#3 iOSアプリ開発Kazuki Nakajima
 
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ 【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ 日本マイクロソフト株式会社
 
Tech talk salesforce mobile sdk
Tech talk   salesforce mobile sdkTech talk   salesforce mobile sdk
Tech talk salesforce mobile sdkKazuki Nakajima
 
App012 linux java_にも対応!_azure_service_fabric_を
App012 linux java_にも対応!_azure_service_fabric_をApp012 linux java_にも対応!_azure_service_fabric_を
App012 linux java_にも対応!_azure_service_fabric_をTech Summit 2016
 
App012 linux java_にも対応!_azure_service_fabric_を
App012 linux java_にも対応!_azure_service_fabric_をApp012 linux java_にも対応!_azure_service_fabric_を
App012 linux java_にも対応!_azure_service_fabric_をTech Summit 2016
 
Google Compute EngineとPipe API
Google Compute EngineとPipe APIGoogle Compute EngineとPipe API
Google Compute EngineとPipe APImaruyama097
 

Ähnlich wie XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips Prism 4.5 & Kona project 等のご紹介 (20)

HTML5でオフラインWebアプリケーションを作ろう
HTML5でオフラインWebアプリケーションを作ろうHTML5でオフラインWebアプリケーションを作ろう
HTML5でオフラインWebアプリケーションを作ろう
 
Windows Azure ではじめる Windows ストアアプリ開発
Windows Azure ではじめる Windows ストアアプリ開発Windows Azure ではじめる Windows ストアアプリ開発
Windows Azure ではじめる Windows ストアアプリ開発
 
次期Office製品群の新しい開発モデルの解説
次期Office製品群の新しい開発モデルの解説次期Office製品群の新しい開発モデルの解説
次期Office製品群の新しい開発モデルの解説
 
jQuery と MVC で実践する標準志向 Web 開発
jQuery と MVC で実践する標準志向 Web 開発jQuery と MVC で実践する標準志向 Web 開発
jQuery と MVC で実践する標準志向 Web 開発
 
Jjug springセッション
Jjug springセッションJjug springセッション
Jjug springセッション
 
Webフロントエンド開発の最新トレンド - HTML5, モバイル, オフライン
Webフロントエンド開発の最新トレンド - HTML5, モバイル, オフラインWebフロントエンド開発の最新トレンド - HTML5, モバイル, オフライン
Webフロントエンド開発の最新トレンド - HTML5, モバイル, オフライン
 
Elastic on Azure Integration & Building React UI Based Search App Using Azure...
Elastic on Azure Integration & Building React UI Based Search App Using Azure...Elastic on Azure Integration & Building React UI Based Search App Using Azure...
Elastic on Azure Integration & Building React UI Based Search App Using Azure...
 
Data API + AWS = (CMS どうでしょう 札幌編)
Data API + AWS =  (CMS どうでしょう 札幌編)Data API + AWS =  (CMS どうでしょう 札幌編)
Data API + AWS = (CMS どうでしょう 札幌編)
 
Featuring Project Silk & Liike: 楽しい "モダン" Web 開発のちょっとディープなお話
Featuring Project Silk & Liike: 楽しい "モダン" Web 開発のちょっとディープなお話Featuring Project Silk & Liike: 楽しい "モダン" Web 開発のちょっとディープなお話
Featuring Project Silk & Liike: 楽しい "モダン" Web 開発のちょっとディープなお話
 
Web リソースを活用した簡単アプリケーション開発(Windows Phone)
Web リソースを活用した簡単アプリケーション開発(Windows Phone)Web リソースを活用した簡単アプリケーション開発(Windows Phone)
Web リソースを活用した簡単アプリケーション開発(Windows Phone)
 
マイクロソフトWeb開発の今と今後
マイクロソフトWeb開発の今と今後マイクロソフトWeb開発の今と今後
マイクロソフトWeb開発の今と今後
 
Concentrated HTML5 & Attractive HTML5
Concentrated HTML5 & Attractive HTML5Concentrated HTML5 & Attractive HTML5
Concentrated HTML5 & Attractive HTML5
 
勉強会force#3 iOSアプリ開発
勉強会force#3 iOSアプリ開発勉強会force#3 iOSアプリ開発
勉強会force#3 iOSアプリ開発
 
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ 【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
 
Web Intents入門
Web Intents入門Web Intents入門
Web Intents入門
 
Mvc conf session_5_isami
Mvc conf session_5_isamiMvc conf session_5_isami
Mvc conf session_5_isami
 
Tech talk salesforce mobile sdk
Tech talk   salesforce mobile sdkTech talk   salesforce mobile sdk
Tech talk salesforce mobile sdk
 
App012 linux java_にも対応!_azure_service_fabric_を
App012 linux java_にも対応!_azure_service_fabric_をApp012 linux java_にも対応!_azure_service_fabric_を
App012 linux java_にも対応!_azure_service_fabric_を
 
App012 linux java_にも対応!_azure_service_fabric_を
App012 linux java_にも対応!_azure_service_fabric_をApp012 linux java_にも対応!_azure_service_fabric_を
App012 linux java_にも対応!_azure_service_fabric_を
 
Google Compute EngineとPipe API
Google Compute EngineとPipe APIGoogle Compute EngineとPipe API
Google Compute EngineとPipe API
 

Mehr von Shotaro Suzuki

This is how our first offline technical event in three years was able to succ...
This is how our first offline technical event in three years was able to succ...This is how our first offline technical event in three years was able to succ...
This is how our first offline technical event in three years was able to succ...Shotaro Suzuki
 
Introducing the new features of the Elastic 8.6 release.pdf
Introducing the new features of the Elastic 8.6 release.pdfIntroducing the new features of the Elastic 8.6 release.pdf
Introducing the new features of the Elastic 8.6 release.pdfShotaro Suzuki
 
NET MAUI for .NET 7 for iOS, Android app development
 NET MAUI for .NET 7 for iOS, Android app development  NET MAUI for .NET 7 for iOS, Android app development
NET MAUI for .NET 7 for iOS, Android app development Shotaro Suzuki
 
What's New in the Elastic 8.5 Release
What's New in the Elastic 8.5 ReleaseWhat's New in the Elastic 8.5 Release
What's New in the Elastic 8.5 ReleaseShotaro Suzuki
 
Centralized Observability for the Azure Ecosystem
Centralized Observability for the Azure EcosystemCentralized Observability for the Azure Ecosystem
Centralized Observability for the Azure EcosystemShotaro Suzuki
 
What's New in the Elastic 8.4 Release
What's New in the Elastic 8.4 ReleaseWhat's New in the Elastic 8.4 Release
What's New in the Elastic 8.4 ReleaseShotaro Suzuki
 
Power Apps x .NET ~ Transforming Business Applications with Fusion Development
Power Apps x .NET ~ Transforming Business Applications with Fusion DevelopmentPower Apps x .NET ~ Transforming Business Applications with Fusion Development
Power Apps x .NET ~ Transforming Business Applications with Fusion DevelopmentShotaro Suzuki
 
devreljapan2022evaadvoc-final.pdf
devreljapan2022evaadvoc-final.pdfdevreljapan2022evaadvoc-final.pdf
devreljapan2022evaadvoc-final.pdfShotaro Suzuki
 
elastic-mabl-co-webinar-20220729
elastic-mabl-co-webinar-20220729elastic-mabl-co-webinar-20220729
elastic-mabl-co-webinar-20220729Shotaro Suzuki
 
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...Shotaro Suzuki
 
Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...
Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...
Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...Shotaro Suzuki
 
Building a search experience with Elastic – Introducing Elastic's latest samp...
Building a search experience with Elastic – Introducing Elastic's latest samp...Building a search experience with Elastic – Introducing Elastic's latest samp...
Building a search experience with Elastic – Introducing Elastic's latest samp...Shotaro Suzuki
 
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...Shotaro Suzuki
 
Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...
Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...
Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...Shotaro Suzuki
 
Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...
Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...
Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...Shotaro Suzuki
 
What's New in the Elastic 8.2 Release - Seamless User Experience with Search -
What's New in the Elastic 8.2 Release - Seamless User Experience with Search -What's New in the Elastic 8.2 Release - Seamless User Experience with Search -
What's New in the Elastic 8.2 Release - Seamless User Experience with Search -Shotaro Suzuki
 
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...Shotaro Suzuki
 
Building Software Reliability through Distributed Tracing.pdf
Building Software Reliability through Distributed Tracing.pdfBuilding Software Reliability through Distributed Tracing.pdf
Building Software Reliability through Distributed Tracing.pdfShotaro Suzuki
 
Building a Flutter Development Environment with VSCode and Useful Extensions
Building a Flutter Development Environment with VSCode and Useful ExtensionsBuilding a Flutter Development Environment with VSCode and Useful Extensions
Building a Flutter Development Environment with VSCode and Useful ExtensionsShotaro Suzuki
 
Introducing the elastic 8.0 release a new era of speed, scale, relevance, and...
Introducing the elastic 8.0 release a new era of speed, scale, relevance, and...Introducing the elastic 8.0 release a new era of speed, scale, relevance, and...
Introducing the elastic 8.0 release a new era of speed, scale, relevance, and...Shotaro Suzuki
 

Mehr von Shotaro Suzuki (20)

This is how our first offline technical event in three years was able to succ...
This is how our first offline technical event in three years was able to succ...This is how our first offline technical event in three years was able to succ...
This is how our first offline technical event in three years was able to succ...
 
Introducing the new features of the Elastic 8.6 release.pdf
Introducing the new features of the Elastic 8.6 release.pdfIntroducing the new features of the Elastic 8.6 release.pdf
Introducing the new features of the Elastic 8.6 release.pdf
 
NET MAUI for .NET 7 for iOS, Android app development
 NET MAUI for .NET 7 for iOS, Android app development  NET MAUI for .NET 7 for iOS, Android app development
NET MAUI for .NET 7 for iOS, Android app development
 
What's New in the Elastic 8.5 Release
What's New in the Elastic 8.5 ReleaseWhat's New in the Elastic 8.5 Release
What's New in the Elastic 8.5 Release
 
Centralized Observability for the Azure Ecosystem
Centralized Observability for the Azure EcosystemCentralized Observability for the Azure Ecosystem
Centralized Observability for the Azure Ecosystem
 
What's New in the Elastic 8.4 Release
What's New in the Elastic 8.4 ReleaseWhat's New in the Elastic 8.4 Release
What's New in the Elastic 8.4 Release
 
Power Apps x .NET ~ Transforming Business Applications with Fusion Development
Power Apps x .NET ~ Transforming Business Applications with Fusion DevelopmentPower Apps x .NET ~ Transforming Business Applications with Fusion Development
Power Apps x .NET ~ Transforming Business Applications with Fusion Development
 
devreljapan2022evaadvoc-final.pdf
devreljapan2022evaadvoc-final.pdfdevreljapan2022evaadvoc-final.pdf
devreljapan2022evaadvoc-final.pdf
 
elastic-mabl-co-webinar-20220729
elastic-mabl-co-webinar-20220729elastic-mabl-co-webinar-20220729
elastic-mabl-co-webinar-20220729
 
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...
 
Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...
Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...
Discover what's new in the Elastic 8.3 release - Find, monitor, and protect e...
 
Building a search experience with Elastic – Introducing Elastic's latest samp...
Building a search experience with Elastic – Introducing Elastic's latest samp...Building a search experience with Elastic – Introducing Elastic's latest samp...
Building a search experience with Elastic – Introducing Elastic's latest samp...
 
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
Developing .NET 6 Blazor WebAssemby apps with Radzen Blazor component library...
 
Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...
Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...
Elastic x Microsoft Azure Integration Evolution - Integrated Monitoring for S...
 
Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...
Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...
Building 3D mobile apps using Power Apps Mixed Reality controls, Azure SQL Da...
 
What's New in the Elastic 8.2 Release - Seamless User Experience with Search -
What's New in the Elastic 8.2 Release - Seamless User Experience with Search -What's New in the Elastic 8.2 Release - Seamless User Experience with Search -
What's New in the Elastic 8.2 Release - Seamless User Experience with Search -
 
Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...Application development with c#, .net 6, blazor web assembly, asp.net web api...
Application development with c#, .net 6, blazor web assembly, asp.net web api...
 
Building Software Reliability through Distributed Tracing.pdf
Building Software Reliability through Distributed Tracing.pdfBuilding Software Reliability through Distributed Tracing.pdf
Building Software Reliability through Distributed Tracing.pdf
 
Building a Flutter Development Environment with VSCode and Useful Extensions
Building a Flutter Development Environment with VSCode and Useful ExtensionsBuilding a Flutter Development Environment with VSCode and Useful Extensions
Building a Flutter Development Environment with VSCode and Useful Extensions
 
Introducing the elastic 8.0 release a new era of speed, scale, relevance, and...
Introducing the elastic 8.0 release a new era of speed, scale, relevance, and...Introducing the elastic 8.0 release a new era of speed, scale, relevance, and...
Introducing the elastic 8.0 release a new era of speed, scale, relevance, and...
 

XAML と C# を使った Windows ストアアプリ(LOB)構築のためのtips Prism 4.5 & Kona project 等のご紹介

  • 1. XAML /C# を使った Windows ストアアプリ(LOB)構築 TIPS - Prism 4.5 & Kona Project 等のご紹介 - 鈴木 章太郎 テクニカルエバンジェリスト 兼 MTC アーキテクト 日本マイクロソフト株式会社 http://blogs.msdn.com/b/shosuz/
  • 2. https://www.facebook.com/shosuz テクニカルエバンジェリスト http://blogs.msdn.com/b/shosuz MTC アーキテクト http://www.microsoft.com/ja-jp/business/mtc/ads.aspx 呟きネタは主に、Windows Azure, Windows、 Windows Phone, RIA, HTML5, MVVM, iOS/Android x Windows Azure連携, Guitar … 等 ASPIC 執行役員 (‘05 ~) Wipse モバイル x クラウド部会長(’11 ~) 2005-2012 早稲田大学大学院非常勤講師、 2008-2010 中央大学非常勤講師 Microsoft 軽音楽部 広報担当 (Gt./Key./DAW) (2012 ~)
  • 3. アジェンダ     
  • 4.
  • 5. Windows ストア LOB アプリ  LOB アプリケーションにも本格導入検討中の企業が多い  課題としては  既存のアプリケーションとの共存の方法  開発リソースの確保、技術研修等  既存アプリケーションの互換性確認の問題  Windows RT か Windows 8 Pro/Enterprise か  配布の方法(Windows ストア、SCCM、Active Directory、 Intune、他)
  • 6.
  • 7. データソースとしての選択肢  ストアアプリケーションは基本的にデータベース直接接続不可  LOB アプリケーションはヘテロな環境に追加される  新規に構築する and/or 既存のリレーショナルデータベース  新規に公開する and/or 既存の Web サービス  新規に構築する and/or 既存のコンテンツサーバー  マスターデータが置かれているサーバー, etc.  ASP.NET MVC4 Web API か WCF Data Services か  データベース(特に SQL Server )は Data Services  サービスの公開だと Web API が有用だが、LINQ で制限あり  Data Services は RDBMS、Web API はそれ以外のもの  組み合わせて使う(Windows Azure の場合は Mobile Services もあり)
  • 8. 百貨店の店舗用商品カタログのフロー例 XML-RPC 商品情報 マスター情報を検索 を検索 REST 画像 URLを 7:37 AM 含む商品情 画像 URL マスター 報を取得 を検索 REST 情報を取得 SharePoint Site se http://sharepoint/url ar ch Site Actions Browse Page username Parent > Parent > Current Page Page Title Current Page Page One Page Two This Site: site search 画像情報を Libraries Site Pages Shared Documents リクエスト 画像 URL Drop Off Library Custom library 画像情報を を取得 返す
  • 9.
  • 10.
  • 11. Entity Framework + Code First  クラスを作成してデータベースを作成  System.ComponentModel.DataAnnotations  スキーマ修正、マイグレーション可能  テストデータを入れられる  新規サービス立ち上げやマッシュアップサービスの構築ニーズに合致  ASP.NET MVC4 Web API でも WCF Data Services でも利用可能  ただし前者の場合は、使いやすいようにクラス設計をすべき
  • 12.
  • 13. Web API によるサービスの公開  簡単に自動生成可能  コントローラ名決定  スキャフォールディング  オプションから選択  テンプレート  モデルクラス  データコンテキストクラス  クラスを適宜修正・追加  メソッドの追加、等
  • 14.
  • 15.
  • 17. Kona Project とは? http://konaguidance.codeplex.com  CodePlex に公開された MVVM フレームワーク  Prism 4.5の一部を利用  C# / XAML に特化  Windows ストア LOB アプリ開発 のために最適化  設定・検索チャーム  各フレームへの遷移  バリデーション  その他順次追加予定
  • 18. その前に Prism – 元々は… WPF, Silverlight, Windows Phone 開発用 • • • • • •
  • 19. Prism は Windows ストアアプリ向きか? • Modularity • UI Composition • Region Navigation • Decoupled Communication • Commands • MVVM Support
  • 20.
  • 21.
  • 22. 1. Windows Phone 開発の経験を十分に活用する Windows Phone アプリ Windows ストアアプリ Deactivate/Tombstoned/Reactiv Suspend/Terminate/Resume ate Microsoft Push Notification Windows Push Notification Service (MPN) Service (WNS) Windows Phone Marketplace Windows Store app certification certification & Application Excellence Review (AER) App manifest declares App manifest declares capabilities capabilities
  • 23. 2. AttachedBehavior にフォーカスする • AttachedBehavior の経験を活 かし、それにフォーカス  後からコントロールに動作を追加できる • Blend のBehavior<T> → 使わない • Expressions のバインディング → 使わない
  • 24. 3. Push 通知には要 Windows ストア開発者登録 • Windows ストアに、開発した アプリを申請し、正しいクレ デンシャルを取得する (SID 及びシークレットキー) • 完全にサイドローディングで 配布する前提で設計・開発を 行ったアプリからは、WNS (Windows Notification Service)を使ったプッシュ配 信はできない → 通知ハブ?
  • 25. 4. .NET 4.5 の async と await を活用する async Task<int> AccessTheWebAsync() { HttpClient client = new HttpClient(); Task<string> getStringTask = client.GetStringAsync("http://msdn.microsoft.com"); DoIndependentWork(); string urlContents = await getStringTask; return urlContents.Length; }
  • 27. 5. LayoutAwarePage クラスの使用 ページ遷移、状態管理、および Visual State の管理のため Navigation support protected virtual void GoHome(object sender, RoutedEventArgs e) protected virtual void GoBack(object sender, RoutedEventArgs e) protected virtual void GoForward(object sender, RoutedEventArgs e) Visual state switching public void StartLayoutUpdates(object sender, RoutedEventArgs e) public void StopLayoutUpdates(object sender, RoutedEventArgs e) Process lifetime management protected override void OnNavigatedTo(NavigationEventArgs e) protected override void OnNavigatedFrom(NavigationEventArgs e) protected virtual void LoadState(Object navigationParameter, Dictionary<String, Object> pageState) protected virtual void SaveState(Dictionary<String, Object> pageState)
  • 28. Navigation と Visual State のサポート XAML: <Button Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot} "Style="{StaticResource BackButtonStyle}“ /> <UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates“ >
  • 29. LoadState と SaveState : SuspensionManager protected override void SaveState(System.Collections.Generic.Dictionary<string, object> pageState) { var virtualizingStackPanel = VisualTreeUtilities.GetVisualChild<VirtualizingStackPanel>(itemGridView); if (virtualizingStackPanel != null && pageState != null) { pageState["virtualizingStackPanelHorizontalOffset"] = virtualizingStackPanel.HorizontalOffset; } } protected override void LoadState(object navigationParameter, System.Collections.Generic.Dictionary<string, object> pageState) { if (pageState != null && pageState.ContainsKey("virtualizingStackPanelHorizontalOffset")) { double.TryParse(pageState["virtualizingStackPanelHorizontalOffset"].ToString(), out virtualizingStackPanelHorizontalOffset); } }
  • 30. 6. Visual State のサポートによる landscape, portrait, fill, and snap <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="ApplicationViewStates"> <VisualState x:Name="FullScreenLandscape"/> <VisualState x:Name="Filled"/> <VisualState x:Name="FullScreenPortrait"> <Storyboard> ... </Storyboard> </VisualState> <VisualState x:Name="Snapped"> <Storyboard> ... </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups>
  • 32. 7.グローバル対応 - ロケールごとに分離されたリソース <ToolTip x:Uid=“PreviewCartoonizeAppBarButtonToolTip” Content=“Preview Cartoonization” … />
  • 34. 8. ページ遷移: View First かViewModel First か View First: this.Frame.Navigate(typeof(ItemDetailPage), itemId); ViewModel First: Var itemDetailPageViewModel = new ItemDetailPageViewModel(…) { ItemId = itemId }; navigationService.Navigate(itemDetailPageViewModel);
  • 35. 9. BindableBase クラスの利用による INotifyPropertyChanged の提供 public abstract class BindableBase : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected bool SetProperty<T>(ref T storage, T value, [CallerMemberName] String propertyName = null) { if (object.Equals(storage, value)) return false; storage = value; this.OnPropertyChanged(propertyName); return true; } protected void OnPropertyChanged([CallerMemberName] string propertyName = null) { var eventHandler = this.PropertyChanged; if (eventHandler != null) { eventHandler(this, new PropertyChangedEventArgs(propertyName)); } } }
  • 36. 10. Kona ViewModelLocator の利用 • Convention ベースのルックアップ • MyNamespace.MyPage -> MyNamespace.MyPageViewModel • ルールに基づく例外により Conventionのオーバーライドが可能 • ViewModel をインスタンス化するのにコンテナを活用可能
  • 37. WPF/Silverlight における 典型的なバリデーション • Implement INotifyDataErrorInfo • UI コントロールでエラーのディクショナリにバインド • NotifyOnValidationError=True <TextBox Text="{Binding Id, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"/>
  • 38. 11. Kona BindableValidator の利用 View: <TextBox Text="{Binding Address.FirstName, Mode=TwoWay}" behaviors:HighlightFormFieldOnErrors.PropertyErrors= "{Binding Errors[FirstName]}" /> ----------------------------------------------------------------------------- ViewModel: _bindableValidator = new BindableValidator(_address); public BindableValidator Errors { get { return _bindableValidator; } }
  • 39. Decoupled Eventing • “ハリウッド式ペアレンタル スタイルの UI コンポジション” (ユーザーコントロール) • 子コントロールは、長時間持続す るサービスにより発生したイベン トをリッスンする必要があるも、 自らそれを、取り外すことはでき ない • Prism の EventAggregator 部分 をポーティング
  • 40. 12. 必要に応じて EventAggregator 使用 public SubscriberViewModel(IEventAggregator eventAggregator) { eventAggregator.GetEvent<ShoppingCartUpdatedEvent>() .Subscribe(s => UpdateItemCountAsync()); } public PublisherViewModel(IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; } _eventAggregator.GetEvent<ShoppingCartUpdatedEvent>() .Publish(string.Empty);
  • 41. Commanding と ViewModel Method Invocation ICommand: void Execute(object) bool CanExecute(object) event EventHandler CanExecuteChanged Command Invoker: ButtonBase ----------------------------------------------------- Event -> Action
  • 42. 13. コントロールに ICommand をサポートする DelegateCommand を使用 View: <Button Content=“Go to shopping cart” Command="{Binding ShoppingCartNavigationCommand}" /> --------------------------------------------------------------------- ViewModel: ShoppingCartNavigationCommand = new DelegateCommand(NavigateToShoppingCartPage, CanNavigateToShoppingCartPage); ShoppingCartNavigationCommand.RaiseCanExecuteChanged();
  • 43. 14. AttachedBehavior や Action を使用する View: <GridView x:Name="itemGridView“ ItemsSource="{Binding Source={StaticResource groupedItemsViewSource}}" ItemTemplate="{StaticResource KonaRI250x250ItemTemplate}" SelectionMode="None“ IsItemClickEnabled="True" behaviors:ListViewItemClickedToAction.Action= "{Binding CategoryNavigationAction}"> ---------------------------------------------------------------------------------- ViewModel: CategoryNavigationAction = NavigateToCategory;
  • 45. 15. Kona RestorableStateAttribute と MVVM フレームワークの利用 public class MyViewModel : ViewModel, INavigationAware { private string _name; [RestorableState] public string Name { get { return _name; } set { SetProperty(ref _name, value); } } }
  • 46. 16. Visual Studio との統合 Windows Windows Azure Store Phone Store
  • 49. クライアント Visual Studio Ultimate 2012 アプリケーション ライフサイクル全体を包括的にカバー Visual Studio Premium 2012 統合開発環境とテスト機能を搭載 Visual Studio Visual Studio Professional 2012 Test Professional 2012 開発機能を提供する統合開発環境 包括的なテストの実施と管理を支援 サーバー Visual Studio Team Foundation Server 2012 アプリケーション開発プロジェクトの統合開発基盤
  • 50. 参考情報  Visual Studio 2012 導入事例  http://aka.ms/VS2012-Case  Visual Studio 2012 が提供する統合ソリューション  http://aka.ms/VS2012-Sol  Visual Studio 2012 製品ガイド(PDF, 16MB)  http://aka.ms/VS2012-Prod  Visual Studio 2012 試用版  http://aka.ms/VS2012-Try  Visual Studio 2012 ライセンス ホワイトペーパー  http://aka.ms/VS2012-Lic
  • 51. Resource  http://konaguidance.codeplex.com  英語版 OS でないと .exe は解凍できない場合あり  Source Code → Download で .zip を落としてください