Bug 34211 - Using a Frame, when outlineColor and borderColor is bound, the frame doesn't draw itself correctly.
Summary: Using a Frame, when outlineColor and borderColor is bound, the frame doesn't ...
Status: RESOLVED DUPLICATE of bug 33764
Alias: None
Product: Forms
Classification: Xamarin
Component: Android (show other bugs)
Version: 1.5.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-09-23 13:15 UTC by Erik Renaud
Modified: 2016-04-22 21:04 UTC (History)
2 users (show)

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


Attachments
image initial, after bound properties change (10.19 KB, image/png)
2015-09-23 13:15 UTC, Erik Renaud
Details
sample application (52.56 KB, application/force-download)
2016-04-22 21:04 UTC, n.podbielski
Details


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 DUPLICATE of bug 33764

Description Erik Renaud 2015-09-23 13:15:49 UTC
Created attachment 13041 [details]
image initial, after bound properties change

This is a part of my xaml
        <customControls:StackLayoutButton Grid.Row="0" Grid.Column="3" Command="{Binding SelectDayPeriod}" CommandParameter="Evening" Spacing="0">
          <Frame OutlineColor="{Binding DayPeriod_EveningBorderColor}" Padding="10,10,10,10" BackgroundColor="{Binding DayPeriod_EveningBackgroundColor}" InputTransparent="True">
            <Image Source="{extensions:ResourceIcon ic_taskScheduling_evening_[theme].png}" Aspect="AspectFit" InputTransparent="True"/>
          </Frame>
          <Label Text="Evening" XAlign="Center" FontSize="Micro"/>
        </customControls:StackLayoutButton>

When the screen appears, the frame appears according to the bound outline color and the bound background color is applied only within the outline.

As soon as background color and outline color change, the frame is not redrawn correctly, the outline doesn't show up and the background takes the entire space.

Here is the code for outline color and background color in the vm.
public Color DayPeriod_EveningBorderColor { get { return DayPeriod == Entities.Task.DoneData.PeriodEnum.Evening ? Color.Accent : ColorEx.Gray; } }
public Color DayPeriod_EveningBackgroundColor { get { return DayPeriod == Entities.Task.DoneData.PeriodEnum.Evening && Device.OS != TargetPlatform.Windows ? Color.Accent : Color.Default; } }

Attached is a screenshot of when the screen shows up (left) and after I clicked on morning (which changes all the bound properties)
Comment 1 Erik Renaud 2015-09-23 13:16:51 UTC
p.s I am trying to create a nice button with an image and some text. your tools do not handle this natively and xlabs has bugs on ios.
Comment 2 Stephane Delcroix 2015-11-23 07:24:31 UTC
This is a dupe of https://bugzilla.xamarin.com/show_bug.cgi?id=33764
I'm no longer able to trigger this behavior in latest XF version.

*** This bug has been marked as a duplicate of bug 33764 ***
Comment 3 n.podbielski 2016-04-22 21:02:49 UTC
It is not fixed. Or it is broken again. Anyway it do not work.
In attachment is a proof (simple Android app).
Easiest way to fix it is to add following method to FrameRenderer 

public override void SetBackgroundColor(Color color)
{

}

Without it background is just overriden with base class SetBackgroundColor which just renders plain, one color rectangle.
Comment 4 n.podbielski 2016-04-22 21:04:24 UTC
Created attachment 15820 [details]
sample application