Bug 36202 - Border & padding properties not applied from custom EntryRenderer (WP)
Summary: Border & padding properties not applied from custom EntryRenderer (WP)
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.0.0
Hardware: All Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-11-24 06:19 UTC by Jorrit
Modified: 2016-02-05 23:07 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

sample repro (136.83 KB, application/x-zip-compressed)
2016-01-19 20:10 UTC, Jimmy [MSFT]

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jorrit 2015-11-24 06:19:32 UTC
When setting Textbox properties from a custom EntryRenderer on Windows Phone, not all properties all applied.
See below code: only the black background color is applied, the padding and border settings are ignored.

protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)

            if (Control != null)

                // apply padding
                Control.Padding = new Windows.UI.Xaml.Thickness(12);
                // remove border
                Control.BorderThickness = new Windows.UI.Xaml.Thickness(0);

                // apply background
                Control.Background = new SolidColorBrush(Colors.Black);
Comment 1 Jorrit 2015-12-15 19:33:34 UTC
Can someone take a look at this? Because due to this issue, it appears to be impossible to customize your entry controls on WP.
Comment 2 E.Z. Hart [MSFT] 2015-12-23 21:04:32 UTC

Is this on Windows Phone 8.0 or Windows Phone 8.1?
Comment 3 Jimmy [MSFT] 2016-01-19 20:10:55 UTC
Created attachment 14632 [details]
sample repro

This is happening on WinRT, not WP8. 

Setting the properties on Control is not affecting how it is rendered. However, if you first get the actual TextBox control similar to in WP8 with

> var entry = ((Windows.UI.Xaml.Controls.Grid)Control.Content).Children.OfType<TextBox>().First();

then setting the TextBox's BorderThickness and Padding will work.

### Steps to Reproduce
1. Run the attached WinRt project
Comment 4 Jimmy [MSFT] 2016-01-19 20:11:40 UTC
Marking as CONFIRMED due to info in comment #3
Comment 5 E.Z. Hart [MSFT] 2016-02-05 23:07:02 UTC
This is fixed in 2.1; the Control member of the renderer is now a TextBox again.