PageRenderTime 40ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/V1/trunk/Source/QuickStarts/Modularity/DirectoryLookupModularity/ModuleB/DefaultViewB.xaml.cs

#
C# | 45 lines | 21 code | 5 blank | 19 comment | 0 complexity | 2553b400fec825a379425db967e5e33d MD5 | raw file
  1. //===============================================================================
  2. // Microsoft patterns & practices
  3. // Composite Application Guidance for Windows Presentation Foundation
  4. //===============================================================================
  5. // Copyright (c) Microsoft Corporation. All rights reserved.
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
  7. // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
  8. // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  9. // FITNESS FOR A PARTICULAR PURPOSE.
  10. //===============================================================================
  11. // The example companies, organizations, products, domain names,
  12. // e-mail addresses, logos, people, places, and events depicted
  13. // herein are fictitious. No association with any real company,
  14. // organization, product, domain name, email address, logo, person,
  15. // places, or events is intended or should be inferred.
  16. //===============================================================================
  17. using System.Windows;
  18. using System.Windows.Controls;
  19. using Microsoft.Practices.Composite.Modularity;
  20. namespace ModuleB
  21. {
  22. /// <summary>
  23. /// Interaction logic for DefaultViewB.xaml
  24. /// </summary>
  25. public partial class DefaultViewB : UserControl
  26. {
  27. private readonly IModuleLoader moduleLoader;
  28. private readonly IModuleEnumerator moduleEnumerator;
  29. public DefaultViewB(IModuleLoader moduleLoader, IModuleEnumerator moduleEnumerator)
  30. {
  31. this.moduleLoader = moduleLoader;
  32. this.moduleEnumerator = moduleEnumerator;
  33. InitializeComponent();
  34. }
  35. private void OnLoadModuleCClick(object sender, RoutedEventArgs e)
  36. {
  37. moduleLoader.Initialize(new ModuleInfo[] {moduleEnumerator.GetModule("ModuleC")});
  38. }
  39. }
  40. }