diff --git a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems index c6b3e9daf3fd..dc19cee5dfa1 100644 --- a/src/SamplesApp/UITests.Shared/UITests.Shared.projitems +++ b/src/SamplesApp/UITests.Shared/UITests.Shared.projitems @@ -493,6 +493,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -3008,6 +3012,9 @@ Image_ImageSource_PixelSize.xaml + + $fileinputname$.xaml + Image_Stretch_Algmnt_Inf_Vertical.xaml diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ImageTests/Image_Margin.xaml b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ImageTests/Image_Margin.xaml new file mode 100644 index 000000000000..f462192ebb4b --- /dev/null +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ImageTests/Image_Margin.xaml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ImageTests/Image_Margin.xaml.cs b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ImageTests/Image_Margin.xaml.cs new file mode 100644 index 000000000000..138fe46d79e2 --- /dev/null +++ b/src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/ImageTests/Image_Margin.xaml.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Uno.UI.Samples.Controls; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace UITests.Shared.Windows_UI_Xaml_Controls.ImageTests +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + [SampleControlInfo] + public sealed partial class Image_Margin : Page + { + public Image_Margin() + { + this.InitializeComponent(); + } + } +} diff --git a/src/Uno.UI/UI/Xaml/Controls/Layouter/Layouter.cs b/src/Uno.UI/UI/Xaml/Controls/Layouter/Layouter.cs index 70885d109c17..c3860d8c590d 100644 --- a/src/Uno.UI/UI/Xaml/Controls/Layouter/Layouter.cs +++ b/src/Uno.UI/UI/Xaml/Controls/Layouter/Layouter.cs @@ -298,7 +298,10 @@ protected Size MeasureChild(View view, Size slotSize) return ret; } - if (frameworkElement != null && !(frameworkElement is FrameworkElement)) + if (frameworkElement != null + && !(frameworkElement is FrameworkElement) + && !(frameworkElement is Image) + ) { // For IFrameworkElement implementers that are not FrameworkElements, the constraint logic must // be performed by the parent. Otherwise, the native element will take the size it needs without