PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/V4/PrismLibrary/Desktop/Prism/Regions/IRegionManagerAccessor.cs

#
C# | 50 lines | 11 code | 3 blank | 36 comment | 0 complexity | ab2f9df3e7e412e4ed4e5d4da9947330 MD5 | raw file
  1. //===================================================================================
  2. // Microsoft patterns & practices
  3. // Composite Application Guidance for Windows Presentation Foundation and Silverlight
  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;
  18. using System.Windows;
  19. namespace Microsoft.Practices.Prism.Regions
  20. {
  21. /// <summary>
  22. /// Provides an abstraction on top of the RegionManager static members.
  23. /// </summary>
  24. public interface IRegionManagerAccessor
  25. {
  26. /// <summary>
  27. /// Notification used by attached behaviors to update the region managers appropriatelly if needed to.
  28. /// </summary>
  29. /// <remarks>This event uses weak references to the event handler to prevent this static event of keeping the
  30. /// target element longer than expected. For security reasons, to use weak delegates in Silverlight you must provide
  31. /// a delegate that is available in the public API of the class (no private or anonymous delegates allowed).</remarks>
  32. event EventHandler UpdatingRegions;
  33. /// <summary>
  34. /// Gets the value for the RegionName attached property.
  35. /// </summary>
  36. /// <param name="element">The object to adapt. This is typically a container (i.e a control).</param>
  37. /// <returns>The name of the region that should be created when
  38. /// the RegionManager is also set in this element.</returns>
  39. string GetRegionName(DependencyObject element);
  40. /// <summary>
  41. /// Gets the value of the RegionName attached property.
  42. /// </summary>
  43. /// <param name="element">The target element.</param>
  44. /// <returns>The <see cref="IRegionManager"/> attached to the <paramref name="element"/> element.</returns>
  45. IRegionManager GetRegionManager(DependencyObject element);
  46. }
  47. }