Index: Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj =================================================================== diff -u -r13a00435931c2267b43b0d7f4343a81e291ea4f0 -r1cfb16d56f5e2e0067f1e9d9b8af401883697687 --- Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision 13a00435931c2267b43b0d7f4343a81e291ea4f0) +++ Core/Common/src/Core.Common.Controls/Core.Common.Controls.csproj (.../Core.Common.Controls.csproj) (revision 1cfb16d56f5e2e0067f1e9d9b8af401883697687) @@ -71,10 +71,8 @@ 3.5 - - Index: Core/Common/src/Core.Common.Controls/Dialogs/DialogBase.cs =================================================================== diff -u -r42ca97fdb85a553c6aac3bfdfe57c7be4af90821 -r1cfb16d56f5e2e0067f1e9d9b8af401883697687 --- Core/Common/src/Core.Common.Controls/Dialogs/DialogBase.cs (.../DialogBase.cs) (revision 42ca97fdb85a553c6aac3bfdfe57c7be4af90821) +++ Core/Common/src/Core.Common.Controls/Dialogs/DialogBase.cs (.../DialogBase.cs) (revision 1cfb16d56f5e2e0067f1e9d9b8af401883697687) @@ -33,6 +33,8 @@ /// public abstract partial class DialogBase : Form { + private readonly int minWidth; + private readonly int minHeight; private readonly IWin32Window owner; /// @@ -47,10 +49,10 @@ InitializeComponent(); this.owner = owner; + this.minWidth = minWidth; + this.minHeight = minHeight; Icon = icon; - - MinimumSize = new Size(minWidth, minHeight); } /// @@ -65,6 +67,9 @@ protected override void OnLoad(EventArgs e) { + // Set the minimum size here in order to prevent virtual member calls + MinimumSize = new Size(minWidth, minHeight); + // Initialize the cancel button (as this cannot be done during creation time) CancelButton = GetCancelButton(); Index: Core/Common/test/Core.Common.Base.Test/Properties/AssemblyInfo.cs =================================================================== diff -u -r41c77f9f36ae74a406fd382187426cc06d2b0200 -r1cfb16d56f5e2e0067f1e9d9b8af401883697687 --- Core/Common/test/Core.Common.Base.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 41c77f9f36ae74a406fd382187426cc06d2b0200) +++ Core/Common/test/Core.Common.Base.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 1cfb16d56f5e2e0067f1e9d9b8af401883697687) @@ -1,15 +1,7 @@ using System.Reflection; using System.Runtime.InteropServices; -using NUnit.Framework; [assembly: AssemblyTitle("Core.Common.Base.Test")] [assembly: AssemblyProduct("Core.Common.Base.Test")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("2eaa90e8-ad27-4130-919b-4a043f2526cb")] -[assembly: RequiresSTA] \ No newline at end of file Index: Core/Common/test/Core.Common.Controls.Test/Core.Common.Controls.Test.csproj =================================================================== diff -u -rb24588e3004fc180966cc724ea81fb687f205ee9 -r1cfb16d56f5e2e0067f1e9d9b8af401883697687 --- Core/Common/test/Core.Common.Controls.Test/Core.Common.Controls.Test.csproj (.../Core.Common.Controls.Test.csproj) (revision b24588e3004fc180966cc724ea81fb687f205ee9) +++ Core/Common/test/Core.Common.Controls.Test/Core.Common.Controls.Test.csproj (.../Core.Common.Controls.Test.csproj) (revision 1cfb16d56f5e2e0067f1e9d9b8af401883697687) @@ -51,11 +51,6 @@ - - - - - Index: Core/Common/test/Core.Common.Controls.Test/Dialogs/DialogBaseTest.cs =================================================================== diff -u -r42ca97fdb85a553c6aac3bfdfe57c7be4af90821 -r1cfb16d56f5e2e0067f1e9d9b8af401883697687 --- Core/Common/test/Core.Common.Controls.Test/Dialogs/DialogBaseTest.cs (.../DialogBaseTest.cs) (revision 42ca97fdb85a553c6aac3bfdfe57c7be4af90821) +++ Core/Common/test/Core.Common.Controls.Test/Dialogs/DialogBaseTest.cs (.../DialogBaseTest.cs) (revision 1cfb16d56f5e2e0067f1e9d9b8af401883697687) @@ -25,19 +25,41 @@ // Assert Assert.AreEqual(icon, dialog.Icon); Assert.IsTrue(dialog.ShowIcon); - Assert.AreEqual(1, dialog.MinimumSize.Width); - Assert.AreEqual(2, dialog.MinimumSize.Height); + Assert.AreEqual(0, dialog.MinimumSize.Width); // Set during load + Assert.AreEqual(0, dialog.MinimumSize.Height); // Set during load Assert.AreEqual(FormBorderStyle.Sizable, dialog.FormBorderStyle); Assert.AreEqual(FormStartPosition.CenterParent, dialog.StartPosition); Assert.IsFalse(dialog.ShowInTaskbar); Assert.IsTrue(dialog.ControlBox); Assert.IsFalse(dialog.MaximizeBox); Assert.IsFalse(dialog.MinimizeBox); - Assert.IsNull(dialog.CancelButton); + Assert.IsNull(dialog.CancelButton); // Set during load } } [Test] + public void ShowDialog_TestDialog_MinimumSizeSet() + { + // Setup + DialogBoxHandler = (name, wnd) => + { + var openedDialog = new FormTester(name); + + openedDialog.Close(); + }; + + using (var dialog = new TestDialog(null, null, 1, 2)) + { + // Call + dialog.ShowDialog(); + + // Assert + Assert.AreEqual(1, dialog.MinimumSize.Width); + Assert.AreEqual(2, dialog.MinimumSize.Height); + } + } + + [Test] public void ShowDialog_TestDialog_CancelButtonSet() { // Setup Index: Core/Common/test/Core.Common.Controls.Test/Properties/AssemblyInfo.cs =================================================================== diff -u -r40fa1903d03d65aa0020127802c42294bb46ef94 -r1cfb16d56f5e2e0067f1e9d9b8af401883697687 --- Core/Common/test/Core.Common.Controls.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 40fa1903d03d65aa0020127802c42294bb46ef94) +++ Core/Common/test/Core.Common.Controls.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 1cfb16d56f5e2e0067f1e9d9b8af401883697687) @@ -1,35 +1,7 @@ using System.Reflection; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. [assembly: AssemblyTitle("Core.Common.Controls.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Core.Common.Controls.Test")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0da3bf48-d82e-4f36-abb1-19955ed59750")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("0da3bf48-d82e-4f36-abb1-19955ed59750")] \ No newline at end of file