{"id":341,"date":"2012-08-13T23:03:24","date_gmt":"2012-08-13T14:03:24","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2012\/08\/13\/prism_silverlight_quickstarts\/"},"modified":"2012-08-13T23:03:24","modified_gmt":"2012-08-13T14:03:24","slug":"prism_silverlight_quickstarts","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2012\/08\/13\/prism_silverlight_quickstarts\/","title":{"rendered":"Prism Silverlight \u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u65b9\u6cd5 QuickStarts"},"content":{"rendered":"<p>Silverlight&#160; <a href=\"https:\/\/www.typea.info\/blog\/index.php\/2012\/08\/11\/prism_basic_mvvm_qukickstart\">MVVM \u306e QuickStart<\/a> \u3092\u78ba\u8a8d\u3057\u305f\u306e\u3067\u3001\u6b21\u306f \u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u65b9\u6cd5\u306e QuckStart \u3092\u8aad\u307f\u4e0b\u3057\u306a\u304c\u3089\u30e1\u30e2\u3059\u308b\u3002<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ff921163(v=pandp.40)\">http:\/\/msdn.microsoft.com\/en-us\/library\/ff921163(v=pandp.40)<\/a><\/p>\n<p>\u4e0a\u8a18\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001Prism \u3092\u5229\u7528\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u30c8\u30d4\u30c3\u30af\u304c\u542b\u307e\u308c\u308b<\/p>\n<ul>\n<li><strong>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u751f\u6210<\/strong> : \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001<strong>IModule<\/strong> \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9 <\/li>\n<li><strong>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u767b\u9332<\/strong> : \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u4ee5\u4e0b\u306e\u65b9\u6cd5\u3067\u767b\u9332\u3067\u304d\u308b\n<ul>\n<li><strong>\u30b3\u30fc\u30c9\u306b\u76f4\u63a5\u8a18\u8ff0<\/strong> : \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e \u30e2\u30b8\u30e5\u30fc\u30eb\u30ab\u30bf\u30ed\u30b0\u306b \u76f4\u63a5\u8a18\u8ff0\u3067\u304d\u308b <\/li>\n<li><strong>XAML <\/strong>: Prism \u3067\u306f\u3001XAML\u3092\u4f7f\u3063\u3066\u30e2\u30b8\u30e5\u30fc\u30eb\u30ab\u30bf\u30ed\u30b0\u3092\u30ed\u30fc\u30c9\u3067\u304d\u308b <\/li>\n<\/ul>\n<\/li>\n<li><strong>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u4f9d\u5b58\u95a2\u4fc2\u306e\u767b\u9332 <\/strong>:&#160; \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u4f9d\u5b58\u95a2\u4fc2\u3092\u6301\u3064\u3053\u3068\u304c\u3067\u304d\u3001Prism \u306f\u4f9d\u5b58\u95a2\u4fc2\u306e\u7ba1\u7406(\u518d\u5e30\u7684\u306a\u4f9d\u5b58\u3084\u91cd\u8907\u3092\u542b\u3080)\u3092\u63d0\u4f9b\u3059\u308b\u3002 <\/li>\n<li><strong>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u521d\u671f\u5316<\/strong> : Prism \u3067\u306f\u3001\u4ee5\u4e0b\u306e2\u7a2e\u985e\u306e\u65b9\u6cd5\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\n<ul>\n<li><strong>\u5229\u7528\u53ef\u80fd\u6642 <\/strong>: \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u5229\u7528\u53ef\u80fd\u306b\u306a\u308b\u3068\u540c\u6642\u306b\u521d\u671f\u5316\u3055\u308c\u308b\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u59cb\u6642\u306b\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u308b <\/li>\n<li><strong>\u30aa\u30f3\u30c7\u30de\u30f3\u30c9<\/strong> : \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u305f\u3068\u304d\u306b\u521d\u671f\u5316\u3055\u308c\u308b\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u8981\u6c42\u306b\u3088\u308a\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u958b\u59cb\u3055\u308c\u308b <\/li>\n<\/ul>\n<\/li>\n<li><strong>\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/strong> :&#160; \u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u975e\u540c\u671f\u306b\u95a2\u9023\u3059\u308bXAP\u30d5\u30a1\u30a4\u30eb\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u3001XAP\u30d5\u30a1\u30a4\u30eb\u3078\u30ed\u30fc\u30c9\u3055\u308c\u3001\u521d\u671f\u5316\u3055\u308c\u308b\u3002Prism \u306f XAP \u304c\u91cd\u8907\u3057\u3066\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u308b\u306e\u3092\u9632\u3050\u3002\n<ul>\n<li><strong>\u9032\u6357\u306e\u8868\u793a <\/strong>: \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u9032\u6357\u306e\u5909\u66f4\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u308b <\/li>\n<li><strong>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u5b8c\u4e86\u6642\u306e\u30a2\u30af\u30b7\u30e7\u30f3<\/strong> : \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u30ed\u30fc\u30c9\u5b8c\u4e86\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u3051\u53d6\u308a\u3001\u30ed\u30fc\u30c9\u3068\u521d\u671f\u5316\u304c\u5b8c\u4e86\u3057\u305f\u3068\u304d\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u8a2d\u5b9a\u3067\u304d\u308b <\/li>\n<\/ul>\n<\/li>\n<li><strong>\u7570\u306a\u3063\u305f DI \u30b3\u30f3\u30c6\u30ca\u306e\u6d3b\u7528<\/strong> :&#160;\n<ul>\n<li><strong>MEF(Managed Extensibility Framework) \u306b\u3088\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u5316<\/strong> : .NET Framework 4 \u304b\u3089\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u30b3\u30f3\u30c6\u30ca <\/li>\n<li><strong>Unity \u306b\u3088\u308b \u30e2\u30b8\u30e5\u30fc\u30eb\u5316<\/strong> : \u4ee5\u524d\u304b\u3089\u5229\u7528\u3055\u308c\u3066\u304d\u305f\u30b3\u30f3\u30c6\u30ca <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u30b7\u30ca\u30ea\u30aa<\/h3>\n<p>6\u3064\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3001ModlueA,ModuleB \u2026 ModuleF <\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\" width=\"400\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"80\">\u30e2\u30b8\u30e5\u30fc\u30eb<\/td>\n<td valign=\"top\" width=\"80\">\u5b9a\u7fa9\u306e\u5834\u6240<\/td>\n<td valign=\"top\" width=\"80\">\u521d\u671f\u5316<\/td>\n<td valign=\"top\" width=\"80\">\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/td>\n<td valign=\"top\" width=\"80\">\u4f9d\u5b58<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"80\">A<\/td>\n<td valign=\"top\" width=\"80\">\u30b3\u30fc\u30c9<\/td>\n<td valign=\"top\" width=\"80\">\u5229\u7528\u53ef\u80fd\u6642<\/td>\n<td valign=\"top\" width=\"80\">\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u540c\u6642<\/td>\n<td valign=\"top\" width=\"80\">D<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"80\">B<\/td>\n<td valign=\"top\" width=\"80\">XAML<\/td>\n<td valign=\"top\" width=\"80\">\u5229\u7528\u53ef\u80fd\u6642<\/td>\n<td valign=\"top\" width=\"80\">\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9<\/td>\n<td valign=\"top\" width=\"80\">&#160;<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"80\">C<\/td>\n<td valign=\"top\" width=\"80\">\u30b3\u30fc\u30c9<\/td>\n<td valign=\"top\" width=\"80\">\u30aa\u30f3\u30c7\u30de\u30f3\u30c9<\/td>\n<td valign=\"top\" width=\"80\">\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u540c\u6642<\/td>\n<td valign=\"top\" width=\"80\">&#160;<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"80\">D<\/td>\n<td valign=\"top\" width=\"80\">XAML<\/td>\n<td valign=\"top\" width=\"80\">\u5229\u7528\u53ef\u80fd\u6642<\/td>\n<td valign=\"top\" width=\"80\">\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9<\/td>\n<td valign=\"top\" width=\"80\">&#160;<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"80\">E<\/td>\n<td valign=\"top\" width=\"80\">XAML<\/td>\n<td valign=\"top\" width=\"80\">\u30aa\u30f3\u30c7\u30de\u30f3\u30c9<\/td>\n<td valign=\"top\" width=\"80\">\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9<\/td>\n<td valign=\"top\" width=\"80\">&#160;<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"80\">F<\/td>\n<td valign=\"top\" width=\"80\">XAML<\/td>\n<td valign=\"top\" width=\"80\">\u30aa\u30f3\u30c7\u30de\u30f3\u30c9<\/td>\n<td valign=\"top\" width=\"80\">\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9<\/td>\n<td valign=\"top\" width=\"80\">E<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3069\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3082\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u306f\u3001\u521d\u671f\u5316\u3055\u308c\u3066\u3044\u308b\u304b\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u4e2d\u304b\u7b49\u3092\u8868\u793a\u3057\u3001\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u30af\u30ea\u30c3\u30af\u306b\u3088\u308a\u521d\u671f\u5316\u3092\u8981\u6c42\u3059\u308b\u3002\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7\u3092\u63d0\u4f9b\u3057\u3001\u73fe\u5728\u306e\u521d\u671f\u5316\u72b6\u6cc1\u306a\u3069\u3092\u8868\u793a\u3059\u308b\u3002<\/p>\n<h4>\u30e2\u30b8\u30e5\u30fc\u30eb\u5316 QuickStart \u306e\u30e6\u30fc\u30b6\u30fc\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9(Silverlight)<\/h4>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module01.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"prism_qs_module01\" border=\"0\" alt=\"prism_qs_module01\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module01_thumb.jpg\" width=\"318\" height=\"221\" \/><\/a> <\/p>\n<h4>\u30d3\u30eb\u30c9\u3068\u5b9f\u884c<\/h4>\n<ol>\n<li>Silverlight only &#8211; Open Modularity With Mef QuickStart.bat \u3092\u5b9f\u884c\u3059\u308b\u3068\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u304c\u8d77\u52d5\u3059\u308b <\/li>\n<li>ModularityWithMef.Silverlight.Web \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3001\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u8a2d\u5b9a\u3092\u9078\u629e <\/li>\n<li>F5 \u3067\u5b9f\u884c <\/li>\n<\/ol>\n<h2>\u30a6\u30a9\u30fc\u30af\u30b9\u30eb\u30fc<\/h2>\n<p>1.\u30e1\u30a4\u30f3\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30bb\u30c3\u30c8\u304c\u8868\u793a\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u308c\u305e\u308c\u306e\u521d\u671f\u5316\u72b6\u6cc1\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u30e2\u30b8\u30e5\u30fc\u30ebB\u3068\u30e2\u30b8\u30e5\u30fc\u30ebD\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3092\u958b\u59cb\u3059\u308b\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module02.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"prism_qs_module02\" border=\"0\" alt=\"prism_qs_module02\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module02_thumb.jpg\" width=\"330\" height=\"229\" \/><\/a><\/p>\n<p>\u30e2\u30b8\u30e5\u30fc\u30ebB \u304a\u3088\u3073 D \u306f\u5229\u7528\u53ef\u80fd\u306b\u306a\u3063\u305f\u3089\u3001\u521d\u671f\u5316\u3055\u308c\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u308b\u3002<\/p>\n<p>\u30e2\u30b8\u30e5\u30fc\u30ebA\u3082\u5229\u7528\u53ef\u80fd\u306b\u306a\u3063\u305f\u3089\u521d\u671f\u5316\u3055\u308c\u308b\u304c\u3001\u30e2\u30b8\u30e5\u30fc\u30ebD\u4f9d\u5b58\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u30e2\u30b8\u30e5\u30fc\u30ebD\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u3001\u30e2\u30b8\u30e5\u30fc\u30ebA\u306f\u521d\u671f\u5316\u3055\u308c\u306a\u3044\u3002<\/p>\n<p>2.\u30e2\u30b8\u30e5\u30fc\u30ebA\u306b\u30de\u30a6\u30b9\u3092\u30db\u30d0\u30fc\u3059\u308b\u3068\u3001\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7\u304c\u8868\u793a\u3055\u308c\u308b<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module03.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"prism_qs_module03\" border=\"0\" alt=\"prism_qs_module03\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module03_thumb.jpg\" width=\"289\" height=\"182\" \/><\/a> <\/p>\n<p>3.\u30e2\u30b8\u30e5\u30fc\u30ebC\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30ed\u30fc\u30c9\u3055\u308c\u308b<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module04.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"prism_qs_module04\" border=\"0\" alt=\"prism_qs_module04\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module04_thumb.jpg\" width=\"342\" height=\"181\" \/><\/a> <\/p>\n<p>4.\u30e2\u30b8\u30e5\u30fc\u30ebF\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u30e2\u30b8\u30e5\u30fc\u30ebE\u304a\u3088\u3073\u30e2\u30b8\u30e5\u30fc\u30ebF\u304c\u30ed\u30fc\u30c9\u3055\u308c\u308b<\/p>\n<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module05.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px\" title=\"prism_qs_module05\" border=\"0\" alt=\"prism_qs_module05\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/PrismSilverlightQuickStarts_E73B\/prism_qs_module05_thumb.jpg\" width=\"252\" height=\"183\" \/><\/a> <\/p>\n<p>\u30e2\u30b8\u30e5\u30fc\u30ebF\u306f\u3001\u30e2\u30b8\u30e5\u30fc\u30ebE\u306b\u4f9d\u5b58\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30e2\u30b8\u30e5\u30fc\u30ebE\u304c\u521d\u671f\u5316\u3055\u308c\u308b\u307e\u3067\u3001\u521d\u671f\u5316\u3055\u308c\u306a\u3044\u3002<\/p>\n<h3>\u5b9f\u88c5\u306e\u8a73\u7d30<\/h3>\n<h4>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u59cb<\/h4>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001<strong>Bootstrapper <\/strong>\u3092\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u59cb\u304a\u3088\u3073\u30e1\u30a4\u30f3\u30da\u30fc\u30b8\u306e\u521d\u671f\u5316\u306b\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>App.xaml.cs<\/p>\n<pre class=\"prettyprint linenums\">private void Application_Startup(object sender, StartupEventArgs e)\r\n{\r\n    \/\/ The boostrapper will create the Shell instance, so we don't need to set the RootVisual\r\n    QuickStartBootstrapper bootstrapper = new QuickStartBootstrapper();\r\n    bootstrapper.Run();\r\n}<\/pre>\n<p><strong>Bootstrapper <\/strong>\u306f\u3001Silverlight \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3001RootVisual \u3092\u30bb\u30c3\u30c8\u3059\u308b\u305f\u3081\u306b <strong>CreateShell <\/strong>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 \u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p>QuickStartBootstrapper.cs<\/p>\n<pre class=\"prettyprint linenums\">public class QuickStartBootstrapper : MefBootstrapper\r\n{\r\n    protected override DependencyObject CreateShell()\r\n    {\r\n        return this.Container.GetExportedValue<shell>();     \r\n    }\r\n:<\/pre>\n<h4>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u751f\u6210<\/h4>\n<p><strong>IModule<\/strong> \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30016\u3064\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u751f\u6210\u3055\u308c\u308b\u3002<\/p>\n<p>MEF\u5229\u7528\u6642(Unity\u306e\u5834\u5408\u3001\u30a2\u30c8\u30ea\u30d3\u30e5\u30fc\u30c8\u306f\u4e0d\u8981)<\/p>\n<pre class=\"prettyprint linenums\">[ModuleExport(typeof(ModuleA), DependsOnModuleNames = new string[] {&quot;ModuleD&quot;})]\r\npublic class ModuleA : IModule\r\n{\r\n    :\r\n}<\/pre>\n<p>MEF\u306e\u5834\u5408\u3001<strong>ModuleExport<\/strong> \u30a2\u30c8\u30ea\u30d3\u30e5\u30fc\u30c8\u306f\u3001MEF\u306b <strong>IModule <\/strong>\u306e\u6d3e\u751f\u30af\u30e9\u30b9\u3092\u516c\u958b\u3059\u308b\u3002<\/p>\n<h4>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u767b\u9332<\/h4>\n<p>\u3044\u304f\u3064\u304b\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u76f4\u63a5\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u53c2\u7167\u3055\u308c\u3001\u3044\u304f\u3064\u304b\u306f\u3001XAML\u304b\u3089\u53c2\u7167\u3055\u308c\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u308b\u3002<\/p>\n<p><strong>Bootstrapper <\/strong>\u306f\u3001<strong>CreateModuleCatarog <\/strong>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30e1\u30bd\u30c3\u30c9\u3092XAML\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u3063\u3066\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u767b\u9332\u3059\u308b\u305f\u3081\u306b\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">protected override IModuleCatalog CreateModuleCatalog()\r\n{\r\n    \/\/ When using MEF, the existing Prism ModuleCatalog is still the place to configure modules via configuration files.\r\n    return Modularity.ModuleCatalog.CreateFromXaml(new Uri(&quot;\/ModularityWithMef.Silverlight;component\/ModulesCatalog.xaml&quot;, UriKind.Relative));\r\n}<\/pre>\n<blockquote>\n<p>MEF \u306f\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308bXAP\u3092\u7d50\u3073\u3064\u3051\u308b\u30e1\u30ab\u30cb\u30ba\u30e0\u3092\u63d0\u4f9b\u3057\u3066\u3044\u306a\u3044\u3002Prism \u306e <strong>ModuleCatalog&#160; <\/strong>\u306f MEF \u30b3\u30f3\u30c6\u30ca\u304c\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u3067\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30b5\u30dd\u30fc\u30c8\u3092\u5229\u7528\u3059\u308b\u3002<\/p>\n<p>MEF <strong>DeploymentCatalog<\/strong> \u306f\u3001XAP\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u306e\u306b\u5229\u7528\u3055\u308c\u308b\u3002<\/p>\n<\/blockquote>\n<p>MEF\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u3001Bootstrapper \u30af\u30e9\u30b9\u306f\u3001<strong>AggregateCatalog<\/strong> \u304c\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u578b\u306e\u767a\u898b\u3092\u63d0\u4f9b\u3059\u308b\u3002<strong>ConfigureAggregateCatalog <\/strong>\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">protected override void ConfigureAggregateCatalog()\r\n{\r\n    base.ConfigureAggregateCatalog();\r\n\r\n    \/\/ Add this assembly to export ModuleTracker\r\n    this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(QuickStartBootstrapper).Assembly));\r\n\r\n    \/\/ Module A is referenced in in the project and directly in code.\r\n    this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ModuleA.ModuleA).Assembly));\r\n\r\n    \/\/ Module C is referenced in in the project and directly in code.\r\n    this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ModuleC.ModuleC).Assembly));\r\n}<\/pre>\n<h4>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30ed\u30fc\u30c9<\/h4>\n<p>\u958b\u59cb\u6642\u304a\u3088\u3073\u30aa\u30f3\u30c7\u30de\u30f3\u30c9\u3067\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30ed\u30fc\u30c9\u3001\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3001\u9032\u6357\u8868\u793a\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u9593\u306e\u4f9d\u5b58\u95a2\u4fc2\u306e\u30c7\u30e2\u3092\u542b\u3080\u3002<\/p>\n<p><strong>Shell <\/strong>\u306f UI\u304b\u3089\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30ed\u30fc\u30c9\u3059\u308b\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5fdc\u3048\u3001<strong>ModuleManager.LoadModule<\/strong> \u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059<\/p>\n<p><strong>Shell.xaml.cs<\/strong><\/p>\n<pre class=\"prettyprint linenums\">private void ModuleC_RequestModuleLoad(object sender, EventArgs e)\r\n{\r\n    \/\/ The ModuleManager uses the Async Events Pattern.\r\n    this.ModuleManager.LoadModule(WellKnownModuleNames.ModuleC);\r\n}<\/pre>\n<p>Shell \u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306e\u9032\u6357\u3092\u3001<strong>ModuleManager.ModuleDownloadProgressChange <\/strong>\u30a4\u30d9\u30f3\u30c8 \u304b\u3089\u901a\u77e5\u3055\u308c\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">this.ModuleManager.ModuleDownloadProgressChanged += this.ModuleManager_ModuleDownloadProgressChanged;<\/pre>\n<pre class=\"prettyprint linenums\">private void ModuleManager_ModuleDownloadProgressChanged(object sender, ModuleDownloadProgressChangedEventArgs e)\r\n{\r\n    this.moduleTracker.RecordModuleDownloading(e.ModuleInfo.ModuleName, e.BytesReceived, e.TotalBytesToReceive);\r\n}<\/pre>\n<p>Shell \u306f\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304c\u5b8c\u4e86\u3057\u3001\u521d\u671f\u5316\u3055\u308c\u305f\u306e\u3092\u3001<strong>ModuleManager.LoadModuleComplete <\/strong>\u30a4\u30d9\u30f3\u30c8\u304b\u3089\u901a\u77e5\u3055\u308c\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">this.ModuleManager.LoadModuleCompleted += this.ModuleManager_LoadModuleCompleted;<\/pre>\n<pre class=\"prettyprint linenums\">private void ModuleManager_LoadModuleCompleted(object sender, LoadModuleCompletedEventArgs e)\r\n{\r\n    this.moduleTracker.RecordModuleLoaded(e.ModuleInfo.ModuleName);\r\n}        <\/pre>\n<h3>\u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u3067\u30ad\u30fc\u3068\u306a\u308b\u30af\u30e9\u30b9<\/h3>\n<ul>\n<li><strong>ModuleCatalog <\/strong>: \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304a\u3088\u3073\u30e2\u30b8\u30e5\u30fc\u30eb\u30b0\u30eb\u30fc\u30d7\u306e\u30e1\u30bf\u30c7\u30fc\u30bf\u306e\u30ab\u30bf\u30ed\u30b0 <\/li>\n<li><strong>ModuleManager <\/strong>: \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u521d\u671f\u5316\u3092\u5236\u5fa1 <\/li>\n<li><strong>ModuleInitializer <\/strong>: ModuleManager \u3092\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u751f\u6210\u6642\u306b\u88dc\u52a9\u3059\u308b <\/li>\n<li><strong>IModlueTypeLoader<\/strong> : \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3084\u30ea\u30e2\u30fc\u30c8\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u53c2\u7167\u3059\u308b\u6d3e\u751f\u578b\u306e\u305f\u3081\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9(\u4f8b XapModuleTypeLoader) <\/li>\n<li><strong>Bootstrapper\/MefBootstrapper\/UnityBootstrapper&#160; <\/strong>: \u30e2\u30b8\u30e5\u30fc\u30eb\u5f0f\u306ePrism\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u521d\u671f\u5316\u3092\u958b\u59cb\u3092\u88dc\u52a9\u3059\u308b <\/li>\n<\/ul>\n<h3>\u53d7\u5165\u30c6\u30b9\u30c8<\/h3>\n<p>\u30c6\u30b9\u30c8\u7528\u306e\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u304c\u540c\u68b1\u3055\u308c\u3066\u3044\u308b\u304c\u3001VS Express \u30a8\u30c7\u30a3\u30b7\u30e7\u30f3\u3067\u306f\u3001\u8aad\u307f\u8fbc\u3081\u305a\u3002\u3002\u3002 <\/p>\n<p><iframe style=\"width: 120px; height: 240px\" marginheight=\"0\" src=\"http:\/\/rcm-jp.amazon.co.jp\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea-pm-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4797363584\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><iframe style=\"width: 120px; height: 240px\" marginheight=\"0\" src=\"http:\/\/rcm-jp.amazon.co.jp\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea-pm-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4777515184\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Silverlight&#160; MVVM \u306e QuickStart \u3092\u78ba\u8a8d\u3057\u305f\u306e\u3067\u3001\u6b21\u306f \u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u65b9\u6cd5\u306e QuckStart \u3092\u8aad\u307f\u4e0b\u3057\u306a\u304c\u3089\u30e1\u30e2\u3059\u308b\u3002 http:\/\/msdn.microsoft.com\/en- [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[55,54],"tags":[],"class_list":["post-341","post","type-post","status-publish","format-standard","hentry","category-prism","category-silverlight"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=341"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/341\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}