From ebf8724e1a1946838ba9bbf9a9d101160745bca1 Mon Sep 17 00:00:00 2001 From: Jesus Date: Sun, 19 Apr 2020 14:00:57 -0700 Subject: [PATCH 1/6] Added documentation to MVVMHelpers --- src/Wpf/Prism.Wpf/Common/MvvmHelpers.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Wpf/Prism.Wpf/Common/MvvmHelpers.cs b/src/Wpf/Prism.Wpf/Common/MvvmHelpers.cs index b5fc95b988..90b310dd0f 100644 --- a/src/Wpf/Prism.Wpf/Common/MvvmHelpers.cs +++ b/src/Wpf/Prism.Wpf/Common/MvvmHelpers.cs @@ -10,8 +10,20 @@ namespace Prism.Common { + /// + /// Helper class for MVVM. + /// public static class MvvmHelpers { + /// + /// Perform an on a view and viewmodel. + /// + /// + /// The action will be performed on the view and its viewmodel if they implement . + /// + /// The parameter type. + /// The view to perform the on. + /// The to perform. public static void ViewAndViewModelAction(object view, Action action) where T : class { T viewAsT = view as T; @@ -28,6 +40,16 @@ public static void ViewAndViewModelAction(object view, Action action) wher } } + /// + /// Get an implementer from a view or viewmodel. + /// + /// + /// If the view implements it will be returned. + /// Otherwise if the view's datacontext implements it will be returned instead. + /// + /// The implementer type to get. + /// The view to get from. + /// view or viewmodel as . public static T GetImplementerFromViewOrViewModel(object view) where T : class { T viewAsT = view as T; From 41f7cd8c721e04922188c99a6c564ba6bdaeefd1 Mon Sep 17 00:00:00 2001 From: Jesus Date: Sun, 19 Apr 2020 14:25:23 -0700 Subject: [PATCH 2/6] Added Documentation to IModuleCatalogExtensions --- .../Modularity/IModuleCatalogExtensions.cs | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs b/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs index de9d8f7b13..51aabb9f07 100644 --- a/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs +++ b/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs @@ -1,16 +1,19 @@ -using System; +using System; using Prism.Properties; namespace Prism.Modularity { + /// + /// extensions. + /// public static class IModuleCatalogExtensions { /// - /// Adds the module. + /// Adds the module to the . /// - /// Catalog - /// - /// Collection of module names () of the modules on which the module to be added logically depends on. + /// The catalog to add the module to. + /// Stage on which the module to be added will be initialized. + /// Collection of module names () of the modules on which the module to be added logically depends on. /// The type parameter. /// The same instance with the added module. public static IModuleCatalog AddModule(this IModuleCatalog catalog, InitializationMode mode = InitializationMode.WhenAvailable, params string[] dependsOn) @@ -20,12 +23,12 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, Initializ } /// - /// Adds the module. + /// Adds the module to the . /// - /// Catalog. - /// Name. - /// . - /// Collection of module names () of the modules on which the module to be added logically depends on. + /// The catalog to add the module to. + /// Name of the module to be added. + /// Stage on which the module to be added will be initialized. + /// Collection of module names () of the modules on which the module to be added logically depends on. /// The type parameter. /// The same instance with the added module. public static IModuleCatalog AddModule(this IModuleCatalog catalog, string name, InitializationMode mode = InitializationMode.WhenAvailable, params string[] dependsOn) @@ -37,7 +40,7 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, string na /// /// Adds a groupless to the catalog. /// - /// Catalog. + /// The catalog to add the module to. /// of the module to be added. /// Collection of module names () of the modules on which the module to be added logically depends on. /// The same instance with the added module. @@ -49,7 +52,7 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, Type moduleT /// /// Adds a groupless to the catalog. /// - /// Catalog. + /// The catalog to add the module to. /// of the module to be added. /// Stage on which the module to be added will be initialized. /// Collection of module names () of the modules on which the module to be added logically depends on. @@ -63,12 +66,13 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, Type moduleT } /// - /// Adds a groupless to the catalog. + /// Adds a groupless to the catalog. /// + /// The catalog to add the module to. /// Name of the module to be added. /// Catalog. /// of the module to be added. - /// Collection of module names () of the modules on which the module to be added logically depends on. + /// Collection of module names () of the modules on which the module to be added logically depends on. /// The same instance with the added module. public static IModuleCatalog AddModule(this IModuleCatalog catalog, string moduleName, string moduleType, params string[] dependsOn) { @@ -78,7 +82,7 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, string modul /// /// Adds a groupless to the catalog. /// - /// Catalog. + /// The catalog to add the module to. /// Name of the module to be added. /// of the module to be added. /// Stage on which the module to be added will be initialized. @@ -92,7 +96,7 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, string modul /// /// Adds a groupless to the catalog. /// - /// Catalog. + /// The catalog to add the module to. /// Name of the module to be added. /// of the module to be added. /// Reference to the location of the module to be added assembly. @@ -116,22 +120,21 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, string modul } /// - /// Adds the module. + /// Adds the module to the . /// - /// Catalog - /// + /// The catalog to add the module to. + /// Stage on which the module to be added will be initialized. /// The type parameter. /// The same instance with the added module. public static IModuleCatalog AddModule(this IModuleCatalog catalog, InitializationMode mode = InitializationMode.WhenAvailable) where T : IModule => catalog.AddModule(typeof(T).Name, mode); - /// - /// Adds the module. + /// Adds the module to the . /// - /// Catalog - /// Name. + /// The catalog to add the module to. + /// Name of the module to be added. /// The type parameter. /// The same instance with the added module. public static IModuleCatalog AddModule(this IModuleCatalog catalog, string name) @@ -139,11 +142,11 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, string na catalog.AddModule(name, InitializationMode.WhenAvailable); /// - /// Adds the module. + /// Adds the module to the . /// - /// Catalog. - /// Name. - /// . + /// The catalog to add the module to. + /// Name of the module to be added. + /// Stage on which the module to be added will be initialized. /// The type parameter. /// The same instance with the added module. public static IModuleCatalog AddModule(this IModuleCatalog catalog, string name, InitializationMode mode) @@ -153,11 +156,11 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, string na /// /// Creates and adds a to the catalog. /// - /// Catalog. + /// The catalog to add the module to. /// Stage on which the module group to be added will be initialized. /// Reference to the location of the module group to be added. /// Collection of included in the group. - /// The same instance with the added module group. + /// The same with the added module group. public static IModuleCatalog AddGroup(this IModuleCatalog catalog, InitializationMode initializationMode, string refValue, params ModuleInfo[] moduleInfos) { if (!(catalog is IModuleGroupsCatalog groupSupport)) From 69642722c7905906975e96fb8c95b944cdb68f0b Mon Sep 17 00:00:00 2001 From: Jesus Date: Sun, 19 Apr 2020 14:28:16 -0700 Subject: [PATCH 3/6] Added Documentation to PrismApplication --- src/Wpf/Prism.Unity.Wpf/PrismApplication.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Wpf/Prism.Unity.Wpf/PrismApplication.cs b/src/Wpf/Prism.Unity.Wpf/PrismApplication.cs index be4c933266..5bc0e791e4 100644 --- a/src/Wpf/Prism.Unity.Wpf/PrismApplication.cs +++ b/src/Wpf/Prism.Unity.Wpf/PrismApplication.cs @@ -4,13 +4,24 @@ namespace Prism.Unity { + /// + /// Base application class that uses as it's container. + /// public abstract class PrismApplication : PrismApplicationBase { + /// + /// Create a new used by Prism. + /// + /// A new . protected override IContainerExtension CreateContainerExtension() { return new UnityContainerExtension(); } + /// + /// Registers the s of the Exceptions that are not considered + /// root exceptions by the . + /// protected override void RegisterFrameworkExceptionTypes() { ExceptionExtensions.RegisterFrameworkExceptionType(typeof(ResolutionFailedException)); From a4c0bf0e2a55bb0fe3d8e1ab45488929a2a4792f Mon Sep 17 00:00:00 2001 From: Jesus Date: Sun, 19 Apr 2020 15:42:20 -0700 Subject: [PATCH 4/6] Add documentation to various classes in Prism.Wpf --- .../Prism.Unity.Wpf/Legacy/UnityBootstrapper.cs | 4 ++++ .../Prism.Unity.Wpf/Legacy/UnityExtensions.cs | 3 +++ src/Wpf/Prism.Wpf/Bootstrapper.cs | 2 +- .../Interactivity/CommandBehaviorBase.cs | 12 ++++++++---- .../Ioc/IContainerRegistryExtensions.cs | 3 +++ src/Wpf/Prism.Wpf/Logging/TextLogger.cs | 3 +++ src/Wpf/Prism.Wpf/Mvvm/ViewModelLocator.cs | 17 ++++++++++++++--- .../Behaviors/DestructibleRegionBehavior.cs | 13 +++++++++++++ .../Regions/IRegionNavigationJournal.cs | 2 +- 9 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/Wpf/Prism.Unity.Wpf/Legacy/UnityBootstrapper.cs b/src/Wpf/Prism.Unity.Wpf/Legacy/UnityBootstrapper.cs index d31cf046d6..6f7adfc329 100644 --- a/src/Wpf/Prism.Unity.Wpf/Legacy/UnityBootstrapper.cs +++ b/src/Wpf/Prism.Unity.Wpf/Legacy/UnityBootstrapper.cs @@ -179,6 +179,10 @@ protected virtual IUnityContainer CreateContainer() return new UnityContainer(); } + /// + /// Creates the used by Prism. + /// + /// The container extension. protected override IContainerExtension CreateContainerExtension() { return new UnityContainerExtension(Container); diff --git a/src/Wpf/Prism.Unity.Wpf/Legacy/UnityExtensions.cs b/src/Wpf/Prism.Unity.Wpf/Legacy/UnityExtensions.cs index 98cfc517bc..cb8a34d2b6 100644 --- a/src/Wpf/Prism.Unity.Wpf/Legacy/UnityExtensions.cs +++ b/src/Wpf/Prism.Unity.Wpf/Legacy/UnityExtensions.cs @@ -4,6 +4,9 @@ namespace Prism.Unity { + /// + /// extensions. + /// public static class UnityExtensions { /// diff --git a/src/Wpf/Prism.Wpf/Bootstrapper.cs b/src/Wpf/Prism.Wpf/Bootstrapper.cs index 234e3b747c..09d6f19347 100644 --- a/src/Wpf/Prism.Wpf/Bootstrapper.cs +++ b/src/Wpf/Prism.Wpf/Bootstrapper.cs @@ -48,7 +48,7 @@ public abstract class Bootstrapper /// /// Creates the container extension used by Prism. /// - /// The container extension + /// The container extension. protected abstract IContainerExtension CreateContainerExtension(); /// diff --git a/src/Wpf/Prism.Wpf/Interactivity/CommandBehaviorBase.cs b/src/Wpf/Prism.Wpf/Interactivity/CommandBehaviorBase.cs index 17f9e920a1..967907b4ce 100644 --- a/src/Wpf/Prism.Wpf/Interactivity/CommandBehaviorBase.cs +++ b/src/Wpf/Prism.Wpf/Interactivity/CommandBehaviorBase.cs @@ -13,7 +13,7 @@ namespace Prism.Interactivity /// /// Base behavior to handle connecting a to a Command. /// - /// The target object must derive from Control + /// The target object must derive from Control. /// /// CommandBehaviorBase can be used to provide new behaviors for commands. /// @@ -36,6 +36,10 @@ public CommandBehaviorBase(T targetObject) } bool _autoEnabled = true; + /// + /// If true the target object's IsEnabled property will update based on the commands ability to execute. + /// If false the target object's IsEnabled property will not update. + /// public bool AutoEnable { get { return _autoEnabled; } @@ -47,7 +51,7 @@ public bool AutoEnable } /// - /// Corresponding command to be execute and monitored for + /// Corresponding command to be execute and monitored for . /// public ICommand Command { @@ -69,7 +73,7 @@ public ICommand Command } /// - /// The parameter to supply the command during execution + /// The parameter to supply the command during execution. /// public object CommandParameter { @@ -124,7 +128,7 @@ private void CommandCanExecuteChanged(object sender, EventArgs e) } /// - /// Executes the command, if it's set, providing the + /// Executes the command, if it's set, providing the . /// protected virtual void ExecuteCommand(object parameter) { diff --git a/src/Wpf/Prism.Wpf/Ioc/IContainerRegistryExtensions.cs b/src/Wpf/Prism.Wpf/Ioc/IContainerRegistryExtensions.cs index 206de94901..80df9ba320 100644 --- a/src/Wpf/Prism.Wpf/Ioc/IContainerRegistryExtensions.cs +++ b/src/Wpf/Prism.Wpf/Ioc/IContainerRegistryExtensions.cs @@ -3,6 +3,9 @@ namespace Prism.Ioc { + /// + /// extensions. + /// public static class IContainerRegistryExtensions { /// diff --git a/src/Wpf/Prism.Wpf/Logging/TextLogger.cs b/src/Wpf/Prism.Wpf/Logging/TextLogger.cs index ffb9d3df97..2baab33c6d 100644 --- a/src/Wpf/Prism.Wpf/Logging/TextLogger.cs +++ b/src/Wpf/Prism.Wpf/Logging/TextLogger.cs @@ -10,6 +10,9 @@ namespace Prism.Logging /// public class TextLogger : ILoggerFacade, IDisposable { + /// + /// A that writes to console output. + /// public TextWriter Writer { get; set; } = Console.Out; /// diff --git a/src/Wpf/Prism.Wpf/Mvvm/ViewModelLocator.cs b/src/Wpf/Prism.Wpf/Mvvm/ViewModelLocator.cs index dccc3fc74d..e4182b90e5 100644 --- a/src/Wpf/Prism.Wpf/Mvvm/ViewModelLocator.cs +++ b/src/Wpf/Prism.Wpf/Mvvm/ViewModelLocator.cs @@ -17,11 +17,22 @@ public static class ViewModelLocator /// The AutoWireViewModel attached property. /// public static DependencyProperty AutoWireViewModelProperty = DependencyProperty.RegisterAttached("AutoWireViewModel", typeof(bool), typeof(ViewModelLocator), new PropertyMetadata(defaultValue: false, propertyChangedCallback: AutoWireViewModelChanged)); + + /// + /// Gets the value for the attached property. + /// + /// The target element. + /// The attached to the element. public static bool GetAutoWireViewModel(DependencyObject obj) { return (bool)obj.GetValue(AutoWireViewModelProperty); } + /// + /// Sets the attached property. + /// + /// The target element. + /// The value to attach. public static void SetAutoWireViewModel(DependencyObject obj, bool value) { obj.SetValue(AutoWireViewModelProperty, value); @@ -41,10 +52,10 @@ private static void AutoWireViewModelChanged(DependencyObject d, DependencyPrope } /// - /// Sets the DataContext of a View + /// Sets the DataContext of a View. /// - /// The View to set the DataContext on - /// The object to use as the DataContext for the View + /// The View to set the DataContext on. + /// The object to use as the DataContext for the View. static void Bind(object view, object viewModel) { if (view is FrameworkElement element) diff --git a/src/Wpf/Prism.Wpf/Regions/Behaviors/DestructibleRegionBehavior.cs b/src/Wpf/Prism.Wpf/Regions/Behaviors/DestructibleRegionBehavior.cs index fa9f2378f8..61aeee3d2e 100644 --- a/src/Wpf/Prism.Wpf/Regions/Behaviors/DestructibleRegionBehavior.cs +++ b/src/Wpf/Prism.Wpf/Regions/Behaviors/DestructibleRegionBehavior.cs @@ -5,10 +5,23 @@ namespace Prism.Regions.Behaviors { + /// + /// Calls on Views and ViewModels + /// removed from the collection. + /// + /// + /// The View and/or ViewModels must implement for this behavior to work. + /// public class DestructibleRegionBehavior : RegionBehavior { + /// + /// The key of this behavior. + /// public const string BehaviorKey = "IDestructibleRegionBehavior"; + /// + /// Attaches the to the collection. + /// protected override void OnAttach() { Region.Views.CollectionChanged += Views_CollectionChanged; diff --git a/src/Wpf/Prism.Wpf/Regions/IRegionNavigationJournal.cs b/src/Wpf/Prism.Wpf/Regions/IRegionNavigationJournal.cs index 70a321e671..5c30f53ddc 100644 --- a/src/Wpf/Prism.Wpf/Regions/IRegionNavigationJournal.cs +++ b/src/Wpf/Prism.Wpf/Regions/IRegionNavigationJournal.cs @@ -28,7 +28,7 @@ public interface IRegionNavigationJournal /// Gets a value that indicates whether there is at least one entry in the forward navigation history. /// /// - /// true if this instance can go forward; otherwise, false. + /// true if this instance can go forward; otherwise, false. /// bool CanGoForward { get; } From efe9497ef527cb8068f68f1507880f50743e3daf Mon Sep 17 00:00:00 2001 From: Jesus Date: Thu, 25 Jun 2020 12:35:42 -0700 Subject: [PATCH 5/6] Changed IModuleCatalogExtensions comment --- src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs b/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs index 51aabb9f07..7313f619c5 100644 --- a/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs +++ b/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs @@ -12,7 +12,7 @@ public static class IModuleCatalogExtensions /// Adds the module to the . /// /// The catalog to add the module to. - /// Stage on which the module to be added will be initialized. + /// The to use. /// Collection of module names () of the modules on which the module to be added logically depends on. /// The type parameter. /// The same instance with the added module. @@ -27,7 +27,7 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, Initializ /// /// The catalog to add the module to. /// Name of the module to be added. - /// Stage on which the module to be added will be initialized. + /// The to use. /// Collection of module names () of the modules on which the module to be added logically depends on. /// The type parameter. /// The same instance with the added module. @@ -123,7 +123,7 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, string modul /// Adds the module to the . /// /// The catalog to add the module to. - /// Stage on which the module to be added will be initialized. + /// The to use. /// The type parameter. /// The same instance with the added module. public static IModuleCatalog AddModule(this IModuleCatalog catalog, InitializationMode mode = InitializationMode.WhenAvailable) @@ -146,7 +146,7 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, string na /// /// The catalog to add the module to. /// Name of the module to be added. - /// Stage on which the module to be added will be initialized. + /// The to use. /// The type parameter. /// The same instance with the added module. public static IModuleCatalog AddModule(this IModuleCatalog catalog, string name, InitializationMode mode) From 6e7a514ff5396ac8a342b5ea97d9838cb3555b31 Mon Sep 17 00:00:00 2001 From: Jesus Date: Thu, 25 Jun 2020 13:58:29 -0700 Subject: [PATCH 6/6] Removed duplicate catalog documentation parameter --- src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs b/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs index 7313f619c5..91ceb9b326 100644 --- a/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs +++ b/src/Wpf/Prism.Wpf/Modularity/IModuleCatalogExtensions.cs @@ -70,7 +70,6 @@ public static IModuleCatalog AddModule(this IModuleCatalog catalog, Type moduleT /// /// The catalog to add the module to. /// Name of the module to be added. - /// Catalog. /// of the module to be added. /// Collection of module names () of the modules on which the module to be added logically depends on. /// The same instance with the added module.