Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 17186 [details]
Any bindings for a control that are in a ContentView that is being presented by a ControlTemplate are lost when the ControlTemplate is changed at runtime. Same behavior on iOS and Android. The attached test project shows that a binding for a control outside of the ContentView still works after the ControlTemplate is changed, but that a binding inside the ContentView is lost. After going over the docs for Template Bindings  the only thing that is not crystal clear is whether the controls in the ContentView need to use TemplateBindings. I would think not because of this note:
"However, note that using a TemplateBinding outside of a ControlTemplate is not supported."
So this leads me to believe there is a bug here.
## Steps to reproduce
1. Open the attached test project.
2. Deploy to an Android or iOS device/sim
3. Note that the ListView with the color items is in the ContentView, while the label is outside of the ContentView. ContentView has a Silver background.
4. Click the Toggle Template button
Expected result: the ListView in the ContentView will still be seen.
Actual result: The ListView in the ContentView disappears because the binding for ItemsSource appears to be lost.
## Regression status
Not a regression, could reproduce in all versions of Forms since ControlTemplate was introduced in XF 2.1. This issue is present in 18.104.22.168-pre1 as well.
=== Xamarin Studio Enterprise ===
Version 6.0.2 (build 73)
Installation UUID: ceaba76c-db06-4fbd-b326-f69ea53c3e01
Mono 4.4.2 (mono-4.4.0-branch-c7sr1/f72fe45) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 404020011
=== Xamarin.Profiler ===
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Apple Developer Tools ===
Xcode 7.3.1 (10188.1)
=== Xamarin.Mac ===
Version: 22.214.171.124 (Visual Studio Enterprise)
=== Xamarin.Android ===
Version: 126.96.36.199 (Visual Studio Enterprise)
Android SDK: /Users/jongoldberger/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
SDK Tools Version: 25.1.7
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.3
Java SDK: /usr
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
Android Designer EPL code available here:
=== Xamarin Android Player ===
Location: /Applications/Xamarin Android Player.app
=== Xamarin.iOS ===
Version: 188.8.131.52 (Visual Studio Enterprise)
Build date: 2016-07-28 12:17:02-0400
=== Xamarin Inspector ===
Build date: Tue Apr 26 23:07:44 UTC 2016
=== Build Information ===
Release ID: 600020073
Git revision: a6f7a24a9723a2d4f5d33c176615b0d44703ab5b
Build date: 2016-07-26 13:36:15-04
Xamarin addins: f5acb37866a0141bc5ddbe95118f18dae4014568
Build lane: monodevelop-lion-cycle7-sr1
=== Operating System ===
Mac OS X 10.11.6
Darwin Jons-MacBook-Pro.local 15.6.0 Darwin Kernel Version 15.6.0
Thu Jun 23 18:25:34 PDT 2016
=== Enabled user installed addins ===
Xamarin Inspector 0.8.0.0
*** Bug 43706 has been marked as a duplicate of this bug. ***