question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Style doesn't affect IsCyclical & MoveWidthPercentage properties

See original GitHub issue

Styles are not applying in the CarouselView class. Have not tried CardsView.

This is the style I have been trying to apply.

<Style TargetType="panCardView:CarouselView">
    <Setter Property="IsCyclical" Value="False"/>
</Style>

In trying this, I have tried to use the style as an Implicit, Explicit and referencing it by using the StaticResource and giving it a x:Key to reference the style by. None of the methods of applying a style works.

P.S. Styling the IndicatorControl does work and works very well.

P.P.S Love the package though! Keep up the good work

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tdoellcommented, Jan 16, 2019

Yeah I can make a PR for those 3 properties if you would like. And I can make default value as properties like you just specified with the DefaultMoveWidthPercentage example.

Okay I will get to work on that.

1reaction
tdoellcommented, Jan 16, 2019

The solution we came up with is to provide an instance method in the CardsView class that CarouselView or another view can override that provides the default value for the properties.

Then in the BindableProperty.Create declarations, you would refer to the bindable instance and call the default value method.

Example

public static readonly BindableProperty IsCyclicalProperty = BindableProperty.Create(nameof(IsCyclical), typeof(bool), typeof(CardsView), defaultValueCreator: (bindable as CardsView).GetIsCyclicalDefaultValue());

protected virtual bool GetIsCyclicalDefaultValue() => false;

Then the CarouselView class could override that method and provide its own default value.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Box Sizing Module Level 3
This section defines the sizing properties width, height, min-width, min-height, max-width, and max-height. Their potential values are defined ...
Read more >
Make view 80% width of parent in React Native
As of React Native 0.42 height: and width: accept percentages. Use width: 80% in your stylesheets and it just works. Screenshot.
Read more >
A Complete Guide to Custom Properties
Everything important and useful to know about CSS Custom Properties. Like that they are often referred to as "CSS Variables" but that's not ......
Read more >
html - Why does percentage width work even if no explicit ...
If 'width' is set to 'auto', any other 'auto' values become '0' and 'width' follows from the resulting equality. Due to the fact...
Read more >
Exploring the Complexities of Width and Height in CSS
The width and height of parent-child combinations get even more interesting when we look at other properties, such as padding and margin ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found