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