mfractor / mfractor-feedback

Found a bug or have a feature request for MFractor? Submit it here!
3 stars 0 forks source link

[Bug] Move color to local resource always wraps in a new ResourceDictionary #273

Closed davidortinau closed 4 years ago

davidortinau commented 4 years ago

I moved LinearGradientBrushs into the ContentPage.Resources dictionary and then used refactoring to extract the colors into resources.

This is what I got (RDs multiplying like rabbits):

Screen Shot 2020-07-18 at 10 41 06 AM

This is what I expected:

<ContentPage.Resources>
        <Color x:Key="DarkBlue">#0091FF</Color>
        <Color x:Key="LightBlue">#32C5FF</Color>
        <LinearGradientBrush x:Key="BlueGradient" StartPoint="0,0" EndPoint="1,1">
            <GradientStop Color="{StaticResource DarkBlue}" Offset="0.0"/>
            <GradientStop Color="{StaticResource LightBlue}" Offset="1.0"/>
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="GreenGradient" StartPoint="0,0" EndPoint="1,1">
            <GradientStop Color="#6DD400" Offset="0.0"/>
            <GradientStop Color="#44D7B6" Offset="1.0"/>
        </LinearGradientBrush>
    </ContentPage.Resources>
matthewrdev commented 4 years ago

@davidortinau Can I confirm if this is occurring on Visual Studio Mac or Windows?

matthewrdev commented 4 years ago

@davidortinau This was caused by a silly logic bug where the InsertResourceEntry code generator used the file on disk rather than the text buffer to perform the resource insertion.

This has been fixed and will be available in MFractor 4.2.11.

matthewrdev commented 4 years ago

@davidortinau This is available in this build: https://addins.monodevelop.com/Stable/Mac/8.6.6/MFractor.VS.Mac.MFractor-4.2.11.mpack