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 18131 [details]
A DataTemplate with a x:Reference to a control throws exception when it's placed in App.xaml instead of the Page where the control exists:
System.Exception: Can't resolve name on Element
See MainPage.xaml, MainPage.xaml.cs and App.xaml in my sample, these are the only places where I added code.
This is preventing sharing DataTemplate's across Pages.
I don't see why would this work when DataTemplate is in a Page but not in App.xaml.
"References an instance that is declared elsewhere in XAML markup" (from https://msdn.microsoft.com/en-us/library/ee795380(v=vs.110).aspx)
the scope fo x:Reference is roughly the xaml file in which it is used.
you probably can use a Binding to achieve your goal