This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
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)

See Also:
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

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

Note You need to log in before you can comment on or make changes to this bug.