Bug 43733 - ResourceDictionary MergedWith is not propagated from app.xaml
Summary: ResourceDictionary MergedWith is not propagated from app.xaml
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.1
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-08-25 06:52 UTC by Karol S
Modified: 2017-01-26 14:09 UTC (History)
5 users (show)

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

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:
Status:
RESOLVED FIXED

Description Karol S 2016-08-25 06:52:38 UTC
When I use MergedWith in App.xaml, imported values are only available in this (App.xaml) file, but they aren't propagated to all ContentPages. This means I have to apply MergedWith to ResoruceDictionaries on all pages.

For example:


<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:shared="clr-namespace:NameASpace;assembly=NameASpace"
             x:Class="NameASpace.App">
  <Application.Resources>
    <ResourceDictionary MergedWith="shared:SharedDictionary">
            <Style x:Key="BaseLabel" TargetType="Label">
                <Setter Property="TextColor" Value="{StaticResource SharedColor}" /> <!-- SharedColor is visible only in this file -->
         </Style>   
    </ResourceDictionary>
...
Comment 1 E.Z. Hart [MSFT] 2017-01-09 21:30:57 UTC
Could you provide a small reproduction project which demonstrates this issue? Without knowing how you're using "SharedDictionary" elsewhere in the project, we don't know how to reproduce the problem you're seeing.

Thanks,
The XF Team
Comment 2 Stephane Delcroix 2017-01-26 14:09:27 UTC
I'm quite sure this was fixed in the past months, and wasn't able to reproduce in 2.3.4-pre1.
I've added a unittest to make sure it doesn't regress: https://github.com/xamarin/Xamarin.Forms/commit/6670ca58458582a1a670f97d17958220802f84b0

Please reopen and provide a valid reproduction project if it's not fixed for you in 2.3.4-pre1