Xamarin.Forms.PancakeView
Xamarin.Forms.PancakeView copied to clipboard
DynamicResource color not working on Border
This doesn't work
<yummy:PancakeView.Border>
<yummy:Border Thickness="3" Color="{DynamicResource AccentColour}" />
</yummy:PancakeView.Border>
but this does
<yummy:PancakeView.Border>
<yummy:Border Thickness="3" Color="{StaticResource AccentColour}" />
</yummy:PancakeView.Border>
That sounds odd. Not quite sure what could be causing that to be honest. Would have to dig deeper.
Not quite sure when I'd get around to that though.
It looks like this problem starts after upgrading 1.4.2 to 2.0.0.691+. Downgrading to 1.4.2 solves the problem for us.
Yes, seeing this today with my app as well :(
This is most likely due to the object that this border is created by doesn't get notified appropriately by the changing runtime resource and hence doesn't cause a redraw. However, the bindable property itself has not been changed, just moved elsewhere, so I would kind of expect the same behavior. So far I don't have a fix.
This problem is also happening with the GradientStop colors in the BackgroundGradientStops collection.
<custom:PancakeView
BackgroundGradientStartPoint="0,0"
BackgroundGradientEndPoint="0,1"
HasShadow="False"
CornerRadius="0">
<custom:PancakeView.BackgroundGradientStops>
<custom:GradientStopCollection>
<custom:GradientStop
Color="{DynamicResource GradiantBlueToOrange_End}"
Offset="0" />
<custom:GradientStop
Color="{DynamicResource GradiantBlueToOrange_Start}"
Offset="1" />
</custom:GradientStopCollection>
</custom:PancakeView.BackgroundGradientStops>
Got the same problem with BackgroundGradientStops =/
Hi @sthewissen , same here - Border color set by DynamicResource is not working commented xaml was for previous versions of PancakeView.
Also, the changes made in this XAML doesn't reflect when using Xamarin HotReload. Any clue on that also ?
<yummy:PancakeView
x:Name="SDPancakeView"
Margin="5"
BackgroundColor="{DynamicResource MainMenuItemsBackgroundColor}"
BackgroundGradientEndPoint="1,0"
BackgroundGradientStartPoint="0,0"
CornerRadius="{DynamicResource SDPancakeViewCR}"
HeightRequest="50"
HorizontalOptions="FillAndExpand"
IsClippedToBounds="True">
<!--
BorderGradientAngle="50"
DashPattern="None"
GradientEndPoint="1,0"
GradientStartPoint="0,0"
-->
<yummy:PancakeView.Border>
<yummy:Border
DashPattern="10,0"
DrawingStyle="Inside"
Thickness="16"
Color="{DynamicResource MainMenuItemsBackgroundColor}" />
</yummy:PancakeView.Border>
<yummy:PancakeView.BackgroundGradientStops>
<yummy:GradientStopCollection>
<yummy:GradientStop Offset="0" Color="{DynamicResource SDPankcackeViewBGStartColor}" />
<yummy:GradientStop Offset="0.5" Color="{DynamicResource MainMenuItemsBackgroundColor}" />
<yummy:GradientStop Offset="1" Color="{DynamicResource SDPankcackeViewBGEndColor}" />
</yummy:GradientStopCollection>
</yummy:PancakeView.BackgroundGradientStops>
<!--<yummy:PancakeView x:Name="SDPancakeView"
Margin="5"
BackgroundColor="{DynamicResource MainMenuItemsBackgroundColor}"
BackgroundGradientEndColor="{DynamicResource SDPankcackeViewBGEndColor}"
BackgroundGradientStartColor="{DynamicResource SDPankcackeViewBGStartColor}"
BorderDrawingStyle="Inside"
BackgroundGradientStartPoint="0,0"
CornerRadius="{DynamicResource SDPancakeViewCR}"
HeightRequest="50"
HorizontalOptions="FillAndExpand"
IsClippedToBounds="True">-->
<!--<yummy:PancakeView Margin="5"
BackgroundColor="{DynamicResource MainMenuItemsBackgroundColor}"
BackgroundGradientAngle="110"
BackgroundGradientEndColor="{DynamicResource MainMenuFooterBackgroundColor}"
BackgroundGradientStartColor="{DynamicResource MainMenuItemsBackgroundColor}"
BorderDrawingStyle="Inside"
CornerRadius="15,0,0,15"
FlowDirection="LeftToRight"
HeightRequest="50"
HorizontalOptions="FillAndExpand"
IsClippedToBounds="True">-->
</yummy:PancakeView>
Hey @sthewissen , have you got the fix yet? The issue still appears.
Ye same issue here when setting the Border and BackgroundGradientStops
it's a pity that is not supported as it's a wonderful control, we removed pancakeView from all our projects as we could not make it work with dynamicResource and it was essential as we had to support darkmode.
it's a pity that is not supported as it's a wonderful control, we removed pancakeView from all our projects as we could not make it work with dynamicResource and it was essential as we had to support darkmode.
might need to do the same tbh
Sorry to hear it. I simply don't have the time to investigate/implement this right now. I wish it were different, but the repo is open to PRs if it's a must-have for you.