summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-08-30 12:12:27 -0600
committerJason Smith <jason.smith@xamarin.com>2016-08-30 11:12:27 -0700
commit1b7250167ff027bbd5ce3d2950a3e3495a13a5f7 (patch)
treebc219a8dada47527b2252fb7a07f8158b6f24701 /Xamarin.Forms.Platform.WP8
parent0bc22bda64afedbca09416cdccc77ce4ddbe522d (diff)
downloadxamarin-forms-1b7250167ff027bbd5ce3d2950a3e3495a13a5f7.tar.gz
xamarin-forms-1b7250167ff027bbd5ce3d2950a3e3495a13a5f7.tar.bz2
xamarin-forms-1b7250167ff027bbd5ce3d2950a3e3495a13a5f7.zip
Use character truncation in Windows (#321)
Change layout order ViewCells on Windows to correct label length layout issues Add extra layout pass on ViewCell load to make cells without margins visible
Diffstat (limited to 'Xamarin.Forms.Platform.WP8')
-rw-r--r--Xamarin.Forms.Platform.WP8/ViewToRendererConverter.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.WP8/ViewToRendererConverter.cs b/Xamarin.Forms.Platform.WP8/ViewToRendererConverter.cs
index 28f5f8c4..50ac3352 100644
--- a/Xamarin.Forms.Platform.WP8/ViewToRendererConverter.cs
+++ b/Xamarin.Forms.Platform.WP8/ViewToRendererConverter.cs
@@ -41,6 +41,7 @@ namespace Xamarin.Forms.Platform.WinPhone
{
frameworkElement.Loaded += (sender, args) =>
{
+ (_view as Layout)?.ForceLayout();
((IVisualElementController)_view).InvalidateMeasure(InvalidationTrigger.MeasureChanged);
InvalidateMeasure();
};
@@ -61,16 +62,22 @@ namespace Xamarin.Forms.Platform.WinPhone
protected override System.Windows.Size MeasureOverride(System.Windows.Size availableSize)
{
var content = Content as FrameworkElement;
- content?.Measure(availableSize);
Size request = _view.Measure(availableSize.Width, availableSize.Height, MeasureFlags.IncludeMargins).Request;
System.Windows.Size result;
if (_view.HorizontalOptions.Alignment == LayoutAlignment.Fill && !double.IsInfinity(availableSize.Width) && availableSize.Width != 0)
+ {
result = new System.Windows.Size(availableSize.Width, request.Height);
+ }
else
+ {
result = new System.Windows.Size(request.Width, request.Height);
+ }
+
+ _view.Layout(new Rectangle(0, 0, result.Width, result.Height));
+
+ content?.Measure(availableSize);
- _view.Layout(new Rectangle(0, 0, result.Width, result.Width));
return result;
}
}