├── .editorconfig
├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── Sandbox
├── README.md
└── WinForms
│ ├── CommandBinderSample
│ ├── App.config
│ ├── Bootstraper.cs
│ ├── CommandBinderSample.csproj
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Shell.Designer.cs
│ ├── Shell.cs
│ ├── Shell.resx
│ ├── View.Designer.cs
│ ├── View.cs
│ ├── View.resx
│ ├── ViewModel.cs
│ └── packages.config
│ └── Hello World
│ ├── HelloWorldModule
│ ├── HelloWorldModule.cs
│ ├── HelloWorldModule.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── packages.config
│ └── HeloWorldUnity
│ ├── App.config
│ ├── Bootstraper.cs
│ ├── HeloWorldUnity.csproj
│ ├── Program.cs
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ ├── Shell.Designer.cs
│ ├── Shell.cs
│ ├── Shell.resx
│ └── packages.config
└── Source
├── Prism.Tests
├── Events
│ ├── BackgroundEventSubscriptionFixture.cs
│ ├── DataEventArgsFixture.cs
│ ├── DelegateReferenceFixture.cs
│ ├── DispatcherEventSubscriptionFixture.cs
│ ├── EventAggregatorFixture.cs
│ ├── EventBaseFixture.cs
│ ├── EventSubscriptionFixture.cs
│ ├── MockDelegateReference.cs
│ └── PubSubEventFixture.cs
├── Logging
│ ├── DebugLoggerFixture.cs
│ └── EmptyLoggerFixture.cs
├── Mocks
│ ├── Commands
│ │ └── DelegateCommandMock.cs
│ ├── ViewModels
│ │ ├── MockValidatingViewModel.cs
│ │ └── MockViewModel.cs
│ └── Views
│ │ ├── Mock.cs
│ │ └── MockView.cs
├── Mvvm
│ ├── BindableBaseFixture.cs
│ ├── CompositeCommandFixture.cs
│ ├── DelegateCommandFixture.cs
│ ├── ErrorsContainerFixture.cs
│ ├── PropertySupportFixture.cs
│ └── ViewModelLocationProviderFixture.cs
├── Prism.Tests.csproj
├── Properties
│ └── AssemblyInfo.cs
└── packages.config
├── Prism
├── Commands
│ ├── CompositeCommand.cs
│ ├── DelegateCommand.cs
│ └── DelegateCommandBase.cs
├── Events
│ ├── BackgroundEventSubscription.cs
│ ├── DataEventArgs.cs
│ ├── DelegateReference.cs
│ ├── DispatcherEventSubscription.cs
│ ├── EventAggregator.cs
│ ├── EventBase.cs
│ ├── EventSubscription.cs
│ ├── IDelegateReference.cs
│ ├── IEventAggregator.cs
│ ├── IEventSubscription.cs
│ ├── PubSubEvent.cs
│ ├── SubscriptionToken.cs
│ └── ThreadOption.cs
├── IActiveAware.cs
├── Logging
│ ├── Category.cs
│ ├── DebugLogger.cs
│ ├── EmptyLogger.cs
│ ├── ILoggerFacade.cs
│ └── Priority.cs
├── Mvvm
│ ├── BindableBase.cs
│ ├── ErrorsContainer.cs
│ ├── PropertySupport.cs
│ └── ViewModelLocationProvider.cs
├── Prism.csproj
└── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── PrismLibrary.sln
├── PrismLibrary_Core.sln
├── PrismLibrary_WinForms.sln
├── WinForms
├── Prism.Unity.WinForms
│ ├── GlobalSuppressions.cs
│ ├── Prism.Unity.WinForms.csproj
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Regions
│ │ └── UnityRegionNavigationContentLoader.cs
│ ├── UnityBootstrapper.cs
│ ├── UnityBootstrapperExtension.cs
│ ├── UnityContainerHelper.cs
│ ├── UnityExtensions.cs
│ ├── UnityServiceLocatorAdapter.cs
│ └── packages.config
├── Prism.WinForms.Tests
│ ├── App.config
│ ├── BootstrapperFixture.cs
│ ├── CollectionChangedTracker.cs
│ ├── CollectionExtensionsFixture.cs
│ ├── CompilerHelper.Desktop.cs
│ ├── ExceptionAssert.cs
│ ├── ExceptionExtensionsFixture.cs
│ ├── ListDictionaryFixture.cs
│ ├── Logging
│ │ ├── TextLoggerFixture.cs
│ │ └── TraceLoggerFixture.Desktop.cs
│ ├── Mocks
│ │ ├── MockAsyncModuleTypeLoader.cs
│ │ ├── MockClickableObject.cs
│ │ ├── MockCommand.cs
│ │ ├── MockConfigurationStore.Desktop.cs
│ │ ├── MockContainerAdapter.cs
│ │ ├── MockDelegateReference.cs
│ │ ├── MockDependencyObject.cs
│ │ ├── MockFrameworkElement.cs
│ │ ├── MockHostAwareRegionBehavior.cs
│ │ ├── MockInteractionRequestAwareElement.cs
│ │ ├── MockLogger.cs
│ │ ├── MockModuleTypeLoader.cs
│ │ ├── MockPresentationRegion.cs
│ │ ├── MockRegion.cs
│ │ ├── MockRegionAdapter.cs
│ │ ├── MockRegionBehavior.cs
│ │ ├── MockRegionBehaviorCollection.cs
│ │ ├── MockRegionManager.cs
│ │ ├── MockRegionManagerAccessor.cs
│ │ ├── MockServiceLocator.cs
│ │ ├── MockSortableViews.cs
│ │ ├── MockViewsCollection.cs
│ │ ├── Modules
│ │ │ ├── MockAbstractModule.cs
│ │ │ ├── MockAttributedModule.cs
│ │ │ ├── MockDependantModule.cs
│ │ │ ├── MockDependencyModule.cs
│ │ │ ├── MockExposingTypeFromGacAssemblyModule.cs
│ │ │ ├── MockModuleA.cs
│ │ │ ├── MockModuleReferencedAssembly.cs
│ │ │ ├── MockModuleReferencingAssembly.cs
│ │ │ ├── MockModuleReferencingOtherModule.cs
│ │ │ └── MockModuleThrowingException.cs
│ │ ├── ViewModels
│ │ │ └── MockViewModel.cs
│ │ └── Views
│ │ │ ├── Mock.cs
│ │ │ └── MockView.cs
│ ├── Modularity
│ │ ├── AssemblyResolverFixture.Desktop.cs
│ │ ├── ConfigurationModuleCatalogFixture.Desktop.cs
│ │ ├── ConfigurationStoreFixture.Desktop.cs
│ │ ├── DirectoryModuleCatalogFixture.Desktop.cs
│ │ ├── FileModuleTypeLoaderFixture.Desktop.cs
│ │ ├── ModuleAttributeFixture.Desktop.cs
│ │ ├── ModuleCatalogFixture.cs
│ │ ├── ModuleCatalogXaml
│ │ │ └── SimpleModuleCatalog.xaml
│ │ ├── ModuleDependencySolverFixture.cs
│ │ ├── ModuleInfoGroupExtensionsFixture.cs
│ │ ├── ModuleInfoGroupFixture.cs
│ │ ├── ModuleInitializerFixture.cs
│ │ ├── ModuleManagerFixture.cs
│ │ └── NotAValidDotNetDll.txt.dll
│ ├── Prism.WinForms.Tests.csproj
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── ServiceLocatorExtensionsFixture.cs
│ └── packages.config
└── Prism.WinForms
│ ├── Bootstrapper.cs
│ ├── Commands
│ ├── ButtonBinder.cs
│ ├── CommandBinder.cs
│ ├── CommandManager.cs
│ ├── ICommandBinder.cs
│ └── MenuItemCommandBinder.cs
│ ├── Common
│ ├── CallbackHelper.cs
│ └── ListDictionary.cs
│ ├── Events
│ └── WeakDelegatesManager.cs
│ ├── Extensions
│ ├── CollectionExtensions.cs
│ ├── ExceptionExtensions.cs
│ └── ServiceLocatorExtensions.cs
│ ├── Logging
│ ├── TextLogger.cs
│ └── TraceLogger.cs
│ ├── Modularity
│ ├── AssemblyResolver.Desktop.cs
│ ├── ConfigurationModuleCatalog.Desktop.cs
│ ├── ConfigurationStore.Desktop.cs
│ ├── CyclicDependencyFoundException.Desktop.cs
│ ├── CyclicDependencyFoundException.cs
│ ├── DirectoryModuleCatalog.Desktop.cs
│ ├── DuplicateModuleException.Desktop.cs
│ ├── DuplicateModuleException.cs
│ ├── FileModuleTypeLoader.Desktop.cs
│ ├── IAssemblyResolver.Desktop.cs
│ ├── IConfigurationStore.Desktop.cs
│ ├── IModule.cs
│ ├── IModuleCatalog.cs
│ ├── IModuleCatalogItem.cs
│ ├── IModuleInitializer.cs
│ ├── IModuleManager.cs
│ ├── IModuleTypeLoader.cs
│ ├── InitializationMode.cs
│ ├── LoadModuleCompletedEventArgs.cs
│ ├── ModularityException.Desktop.cs
│ ├── ModularityException.cs
│ ├── ModuleAttribute.Desktop.cs
│ ├── ModuleCatalog.cs
│ ├── ModuleConfigurationElement.Desktop.cs
│ ├── ModuleConfigurationElementCollection.Desktop.cs
│ ├── ModuleDependencyAttribute.Desktop.cs
│ ├── ModuleDependencyCollection.Desktop.cs
│ ├── ModuleDependencyConfigurationElement.Desktop.cs
│ ├── ModuleDependencySolver.cs
│ ├── ModuleDownloadProgressChangedEventArgs.cs
│ ├── ModuleInfo.Desktop.cs
│ ├── ModuleInfo.cs
│ ├── ModuleInfoGroup.cs
│ ├── ModuleInfoGroupExtensions.cs
│ ├── ModuleInitializeException.Desktop.cs
│ ├── ModuleInitializeException.cs
│ ├── ModuleInitializer.cs
│ ├── ModuleManager.Desktop.cs
│ ├── ModuleManager.cs
│ ├── ModuleNotFoundException.Desktop.cs
│ ├── ModuleNotFoundException.cs
│ ├── ModuleState.cs
│ ├── ModuleTypeLoaderNotFoundException.Desktop.cs
│ ├── ModuleTypeLoaderNotFoundException.cs
│ ├── ModuleTypeLoadingException.Desktop.cs
│ ├── ModuleTypeLoadingException.cs
│ └── ModulesConfigurationSection.Desktop.cs
│ ├── Prism.WinForms.csproj
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
│ └── packages.config
└── nuspecs
├── CreatePrismNuGetPackages.ps1
├── Prism.Unity.WinForms.nuspec
└── Prism.WinForms.nuspec
/.editorconfig:
--------------------------------------------------------------------------------
1 | ; This file is for unifying the coding style for different editors and IDEs.
2 | ; More information at http://editorconfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | end_of_line = CRLF
8 |
9 | [*.cs]
10 | indent_style = space
11 | indent_size = 4
12 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Prism.WinForms
2 |
3 | Reduced version of Prism.WPF that works in Windows.Forms.
4 |
5 | ### Includes:
6 | * Unity bootstraper
7 | * Modularity
8 |
9 | ## What is Prism ?
10 |
11 | Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Windows 10 UWP, and Xamarin Forms. Separate releases are available for each platform and those will be developed on independent timelines. Prism provides an implementation of a collection of design patterns that are helpful in writing well-structured and maintainable XAML applications, including MVVM, dependency injection, commands, EventAggregator, and others. Prism's core functionality is a shared code base in a Portable Class Library targeting these platforms. Those things that need to be platform specific are implemented in the respective libraries for the target platform. Prism also provides great integration of these patterns with the target platform. For example, Prism for UWP and Xamarin Forms allows you to use an abstraction for navigation that is unit testable, but that layers on top of the platform concepts and APIs for navigation so that you can fully leverage what the platform itself has to offer, but done in the MVVM way.
12 |
13 | Prism 6 is a fully open source version of the Prism guidance originally produced by Microsoft patterns & practices. The core team members were all part of the p&p team that developed Prism 1 through 5, and the effort has now been turned over to the open source community to keep it alive and thriving to support the .NET community. There are thousands of companies who have adopted previous versions of Prism for WPF, Silverlight, and Windows Runtime, and we hope they will continue to move along with us as we continue to evolve and enhance the framework to keep pace with current platform capabilities and requirements.
14 |
15 | For more info visit the [Prism][3] repository in github.
16 |
17 | ## Requeriments
18 |
19 | * [Prism.Core][1]
20 | * [Unity Container][2]
21 |
22 | [1]: https://www.nuget.org/packages/Prism.Core/
23 | [2]: https://www.nuget.org/packages/Unity/
24 | [3]: https://github.com/PrismLibrary/Prism
25 |
26 |
--------------------------------------------------------------------------------
/Sandbox/README.md:
--------------------------------------------------------------------------------
1 | # Development samples
2 |
3 | All samples under this repository are minimal samples created to test Prism in a real application during development. This enables the team to proof and validate more complex functionality (e.g. navigation) without the need to create new NuGet packages during development.
4 |
5 | These samples are no replacement for the unit test suite that covers the code base.
6 |
7 | # Stable samples
8 |
9 | More complete samples showing how to use Prism 6 for your application development will be posted in separate repositories under the [PrismLibrary GitHub organization](https://github.com/PrismLibrary). These samples are based on public released NuGet packages and are thus more stable than the development samples.
10 |
11 | * [WPF](https://github.com/PrismLibrary/Prism-Samples-Wpf)
12 | * [Xamarin Forms](https://github.com/PrismLibrary/Prism-Samples-Forms)
13 | * [Windows 10 UWP](https://github.com/PrismLibrary/Prism-Samples-Windows)
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/Bootstraper.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 | using Prism.Modularity;
3 | using Prism.Unity;
4 | using Microsoft.Practices.Unity;
5 |
6 | namespace CommandBinderSample
7 | {
8 | internal class Bootstraper: UnityBootstrapper
9 | {
10 | protected override Form CreateShell()
11 | {
12 | return this.Container.Resolve();
13 | }
14 |
15 | protected override void ConfigureModuleCatalog()
16 | {
17 | base.ConfigureModuleCatalog();
18 |
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace CommandBinderSample
5 | {
6 | static class Program
7 | {
8 | [STAThread]
9 | static void Main()
10 | {
11 | Application.EnableVisualStyles();
12 | Application.SetCompatibleTextRenderingDefault(false);
13 |
14 | Bootstraper b = new Bootstraper();
15 | b.Run();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("CommandBinderSample")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("CommandBinderSample")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("9f00a1e3-eee5-4d1b-a74c-01b2f5879eb0")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CommandBinderSample.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CommandBinderSample.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CommandBinderSample.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/Shell.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace CommandBinderSample
2 | {
3 | partial class Shell
4 | {
5 | ///
6 | /// Variable del diseñador necesaria.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Limpiar los recursos que se estén usando.
12 | ///
13 | /// true si los recursos administrados se deben desechar; false en caso contrario.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Código generado por el Diseñador de Windows Forms
24 |
25 | ///
26 | /// Método necesario para admitir el Diseñador. No se puede modificar
27 | /// el contenido de este método con el editor de código.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.view1 = new CommandBinderSample.View();
32 | this.SuspendLayout();
33 | //
34 | // view1
35 | //
36 | this.view1.Dock = System.Windows.Forms.DockStyle.Fill;
37 | this.view1.Location = new System.Drawing.Point(0, 0);
38 | this.view1.Name = "view1";
39 | this.view1.Size = new System.Drawing.Size(284, 262);
40 | this.view1.TabIndex = 0;
41 | //
42 | // Shell
43 | //
44 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
45 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
46 | this.ClientSize = new System.Drawing.Size(284, 262);
47 | this.Controls.Add(this.view1);
48 | this.Name = "Shell";
49 | this.Text = "Shell";
50 | this.ResumeLayout(false);
51 |
52 | }
53 |
54 | #endregion
55 |
56 | private View view1;
57 | }
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/Shell.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 |
3 | namespace CommandBinderSample
4 | {
5 | public partial class Shell : Form
6 | {
7 | public Shell()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/View.cs:
--------------------------------------------------------------------------------
1 | using Prism.Commands;
2 | using System.Windows.Forms;
3 |
4 | namespace CommandBinderSample
5 | {
6 | public partial class View : UserControl
7 | {
8 | CommandManager commandManager = new CommandManager();
9 | ViewModel viewModel;
10 |
11 | public View()
12 | {
13 | InitializeComponent();
14 |
15 | viewModel = new ViewModel();
16 |
17 | statusLabel.DataBindings.Add("Text", viewModel, "Status");
18 |
19 | commandManager.Bind(viewModel.Command1, toolStrip1);
20 | commandManager.Bind(viewModel.Command2, toolStrip2);
21 |
22 | commandManager.Bind(viewModel.Command1, button1);
23 | commandManager.Bind(viewModel.Command2, button2);
24 |
25 | checkBox1.CheckedChanged += (o, e) => viewModel.Command1Enabled = checkBox1.Checked;
26 | checkBox2.CheckedChanged += (o, e) => viewModel.Command2Enabled = checkBox2.Checked;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/ViewModel.cs:
--------------------------------------------------------------------------------
1 | using Prism.Commands;
2 | using Prism.Mvvm;
3 |
4 | namespace CommandBinderSample
5 | {
6 | internal class ViewModel : BindableBase
7 | {
8 | public DelegateCommand Command1 { get; private set; }
9 | public DelegateCommand Command2 { get; private set; }
10 |
11 |
12 | private string _status;
13 | public string Status
14 | {
15 | get { return _status; }
16 | set { SetProperty(ref _status, value); }
17 | }
18 |
19 |
20 | private bool _command1Enabled;
21 | public bool Command1Enabled
22 | {
23 | get { return _command1Enabled; }
24 | set { SetProperty(ref _command1Enabled, value);
25 | Command1.RaiseCanExecuteChanged();
26 | }
27 | }
28 |
29 | private bool _command2Enabled;
30 | public bool Command2Enabled
31 | {
32 | get { return _command2Enabled; }
33 | set
34 | {
35 | SetProperty(ref _command2Enabled, value);
36 | Command2.RaiseCanExecuteChanged();
37 | }
38 | }
39 |
40 |
41 | public ViewModel()
42 | {
43 | Command1 = new DelegateCommand(Write1, () => Command1Enabled);
44 | Command2 = new DelegateCommand(Write2, () => Command2Enabled);
45 | }
46 |
47 | private void Write1()
48 | {
49 | Status = "Command1 executed!!!";
50 | }
51 |
52 | private void Write2()
53 | {
54 | Status = "Command2 executed!!!";
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/CommandBinderSample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HelloWorldModule/HelloWorldModule.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Design;
2 | using Prism.Modularity;
3 | using Microsoft.Practices.Unity;
4 | namespace HelloWorldModule
5 | {
6 | public class HelloWorldModule : IModule
7 | {
8 | private readonly IUnityContainer _container;
9 |
10 | public HelloWorldModule(IUnityContainer container)
11 | {
12 | _container = container;
13 | }
14 |
15 | public void Initialize()
16 | {
17 | _container.RegisterType();
18 | }
19 | }
20 |
21 | public interface IHelloService
22 | {
23 | string SayHello();
24 | }
25 |
26 | public class HelloService : IHelloService
27 | {
28 | public string SayHello()
29 | {
30 | return "Hello";
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HelloWorldModule/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // La información general de un ensamblado se controla mediante el siguiente
6 | // conjunto de atributos. Cambie estos valores de atributo para modificar la información
7 | // asociada con un ensamblado.
8 | [assembly: AssemblyTitle("HelloWorldModule")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Esteban Espuña")]
12 | [assembly: AssemblyProduct("HelloWorldModule")]
13 | [assembly: AssemblyCopyright("Copyright © Esteban Espuña 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Si establece ComVisible en false, los tipos de este ensamblado no estarán visibles
18 | // para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde
19 | // COM, establezca el atributo ComVisible en true en este tipo.
20 | [assembly: ComVisible(false)]
21 |
22 | // El siguiente GUID sirve como id. de typelib si este proyecto se expone a COM.
23 | [assembly: Guid("7e741828-4cfa-4c22-834e-1904e66d56e7")]
24 |
25 | // La información de versión de un ensamblado consta de los cuatro valores siguientes:
26 | //
27 | // Versión principal
28 | // Versión secundaria
29 | // Número de compilación
30 | // Revisión
31 | //
32 | // Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión
33 | // mediante el carácter '*', como se muestra a continuación:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HelloWorldModule/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/Bootstraper.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 | using Prism.Modularity;
3 | using Prism.Unity;
4 | using Microsoft.Practices.Unity;
5 |
6 | namespace HeloWorldUnity
7 | {
8 | internal class Bootstraper: UnityBootstrapper
9 | {
10 | protected override Form CreateShell()
11 | {
12 | return this.Container.Resolve();
13 | }
14 |
15 | protected override void ConfigureModuleCatalog()
16 | {
17 | base.ConfigureModuleCatalog();
18 |
19 | ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;
20 | moduleCatalog.AddModule(typeof(HelloWorldModule.HelloWorldModule));
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace HeloWorldUnity
5 | {
6 | static class Program
7 | {
8 | [STAThread]
9 | static void Main()
10 | {
11 | Application.EnableVisualStyles();
12 | Application.SetCompatibleTextRenderingDefault(false);
13 |
14 | Bootstraper b = new Bootstraper();
15 | b.Run();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // La información general de un ensamblado se controla mediante el siguiente
6 | // conjunto de atributos. Cambie estos valores de atributo para modificar la información
7 | // asociada con un ensamblado.
8 | [assembly: AssemblyTitle("HeloWorldUnity")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Esteban Espuña")]
12 | [assembly: AssemblyProduct("HeloWorldUnity")]
13 | [assembly: AssemblyCopyright("Copyright © Esteban Espuña 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Si establece ComVisible en false, los tipos de este ensamblado no estarán visibles
18 | // para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde
19 | // COM, establezca el atributo ComVisible en true en este tipo.
20 | [assembly: ComVisible(false)]
21 |
22 | // El siguiente GUID sirve como id. de typelib si este proyecto se expone a COM.
23 | [assembly: Guid("5eddd609-ce60-497c-9656-6e9761612a33")]
24 |
25 | // La información de versión de un ensamblado consta de los cuatro valores siguientes:
26 | //
27 | // Versión principal
28 | // Versión secundaria
29 | // Número de compilación
30 | // Revisión
31 | //
32 | // Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión
33 | // mediante el carácter '*', como se muestra a continuación:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Este código fue generado por una herramienta.
4 | // Versión de runtime: 4.0.30319.42000
5 | //
6 | // Los cambios de este archivo pueden provocar un comportamiento inesperado y se perderán si
7 | // el código se vuelve a generar.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace HeloWorldUnity.Properties
12 | {
13 |
14 |
15 | ///
16 | /// Clase de recurso fuertemente tipado para buscar cadenas traducidas, etc.
17 | ///
18 | // StronglyTypedResourceBuilder generó automáticamente esta clase
19 | // a través de una herramienta como ResGen o Visual Studio.
20 | // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen
21 | // con la opción /str o recompile su proyecto de VS.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Devuelve la instancia ResourceManager almacenada en caché utilizada por esta clase.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HeloWorldUnity.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Invalida la propiedad CurrentUICulture del subproceso actual para todas las
56 | /// búsquedas de recursos usando esta clase de recursos fuertemente tipados.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace HeloWorldUnity.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/Shell.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace HeloWorldUnity
2 | {
3 | partial class Shell
4 | {
5 | ///
6 | /// Variable del diseñador necesaria.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Limpiar los recursos que se estén usando.
12 | ///
13 | /// true si los recursos administrados se deben desechar; false en caso contrario.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Código generado por el Diseñador de Windows Forms
24 |
25 | ///
26 | /// Método necesario para admitir el Diseñador. No se puede modificar
27 | /// el contenido de este método con el editor de código.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.HelloLabel = new System.Windows.Forms.Label();
32 | this.SuspendLayout();
33 | //
34 | // HelloLabel
35 | //
36 | this.HelloLabel.Dock = System.Windows.Forms.DockStyle.Fill;
37 | this.HelloLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
38 | this.HelloLabel.Location = new System.Drawing.Point(0, 0);
39 | this.HelloLabel.Name = "HelloLabel";
40 | this.HelloLabel.Size = new System.Drawing.Size(284, 262);
41 | this.HelloLabel.TabIndex = 0;
42 | this.HelloLabel.Text = "This label shoud say hello";
43 | this.HelloLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
44 | //
45 | // Shell
46 | //
47 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
49 | this.ClientSize = new System.Drawing.Size(284, 262);
50 | this.Controls.Add(this.HelloLabel);
51 | this.Name = "Shell";
52 | this.Text = "Shell";
53 | this.ResumeLayout(false);
54 |
55 | }
56 |
57 | #endregion
58 |
59 | private System.Windows.Forms.Label HelloLabel;
60 | }
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/Shell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using HelloWorldModule;
4 | using Microsoft.Practices.Unity;
5 |
6 | namespace HeloWorldUnity
7 | {
8 | public partial class Shell : Form
9 | {
10 | public Shell()
11 | {
12 | InitializeComponent();
13 | this.Load += Shell_Load;
14 | }
15 |
16 | [Dependency]
17 | public IHelloService HelloService { get; set; }
18 |
19 | private void Shell_Load(object sender, EventArgs e)
20 | {
21 | this.HelloLabel.Text = HelloService.SayHello();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Sandbox/WinForms/Hello World/HeloWorldUnity/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Source/Prism.Tests/Events/BackgroundEventSubscriptionFixture.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using Xunit;
4 | using Prism.Events;
5 |
6 | namespace Prism.Tests.Events
7 | {
8 | public class BackgroundEventSubscriptionFixture
9 | {
10 | [Fact]
11 | public void ShouldReceiveDelegateOnDifferentThread()
12 | {
13 | ManualResetEvent completeEvent = new ManualResetEvent(false);
14 | SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
15 | SynchronizationContext calledSyncContext = null;
16 | Action