Bug 30169 - Compiled form with a dynamic resource reference throws a BindableObject:SetDynamicResource exception
Summary: Compiled form with a dynamic resource reference throws a BindableObject:SetDy...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-05-16 20:38 UTC by Mark Fredrickson
Modified: 2015-06-26 04:28 UTC (History)
7 users (show)

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

App and TestPage files (1.52 KB, application/x-zip-compressed)
2015-05-16 20:38 UTC, Mark Fredrickson

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 Mark Fredrickson 2015-05-16 20:38:45 UTC
Created attachment 11226 [details]
App and TestPage files

When I use a style with a Dynamic Resource in my xaml, the call to InitializeComponents throws an exception. I'm defining my styles in the App.xaml. Below is the xaml and the exception. It works fine without compilation. Forms version is

Dynamic Resource Style:

    <Style x:Key="InfoTitleStyle" TargetType="Label">
      <Setter Property="XAlign" Value="Start" />
      <Setter Property="TextColor" Value="#0000FF" /> <!-- Blue -->

Test Page Xaml:

<?xml version="1.0" encoding="utf-8" ?>

<StackLayout Orientation="Horizontal" HorizontalOptions="CenterAndExpand">
  <Label Text="Hello World" Style="{DynamicResource InfoTitleStyle}" />

Test Page InitializeComponent Exception:

"Method `Xamarin.Forms.BindableObject:SetDynamicResource (Xamarin.Forms.BindableProperty,string)' is inaccessible from method `Test.TestPage:InitializeComponent ()'"
Comment 1 Chris King 2015-05-18 18:26:56 UTC
XAML compiler bug.
Comment 2 Jason Smith [MSFT] 2015-05-27 16:10:09 UTC
Should be fixed in 1.4.3 final
Comment 3 Jason Smith [MSFT] 2015-05-27 16:10:24 UTC
I mean whatever release has XamlC next