Skip to content

Align Styles behavior with UWP #119

Closed

Description

@jeromelaban

The current implementation of Styles in Uno Platform is lacking in some areas, such as Implicit styles, default styles merging, etc.. this issue will track other issues related to the alignment of the Style behavior with Windows' UWP implementation.

Activity

  1. jeromelaban commented on Jul 31, 2018

    @jeromelaban
    MemberAuthor

    Here's an assessment of what's missing, with description of some implicit behaviors and related questions:

    • How do implicit Styles behave?
      • How does resolution behave?
        • Standard 'leafmost first.' Styles can be defined in Resources local to a control or programmatically. Applied correctly to views added to tree programmatically.
    • How do resources behave?
      • How does FrameworkElement.Resources work under the hood?
        • Explicit resources are seemingly resolved (or at least their scope is fixed) at parse-time. Resources added programmatically, or belonging to ancestors, can't be referenced in xaml. (Compared to implicit Styles which seem more like they are resolved at runtime.)
        • Resources added by x:Name are available as StaticResources and are also set as fields on the control, hence can be accessed by x:Bind.
      • What programmatic interventions are available?
        • Limited, see above.
      • What can be bound to?
        • Both x:Key and x:Name resources.
      • How does ResourceDictionary behave at low level? (Eg what does Contains return if key is only in merged dictionary, etc)
    • Do Uno and UWP Styles match in code?
      • Same comportment? Same contract?
        • ResourceDictionary doesn't support MergedDictionary; will resolve global defaults if local values not found.
        • UWP seems to resolve event handlers and x:Bind using IComponentConnector and IComponentConnector2 interfaces respectively.
    • How does DefaultStyleKey work?
      • Need to test class libraries
    • What's the unset value of a custom control?
      • Typically the type of the base class, including classes with protected constructors (Control, ListViewBase).
      • What if it's modified at runtime?
    • How do resources from class libraries behave?
      • Can a Style from class library X be the default for a type from class library Y?
      • Can a Style from a class library be used in the default layer for a framework type? If so, local to that class library, or in consuming external apps/libraries?
    • Reuse original styles, validate all Theme Resources.

    Related issues:

  2. dr1rrb commented on Sep 12, 2018

    @dr1rrb
    Member

    Linking #190 which is blocked until this got completed.

  3. added
    kind/enhancement
    on May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

epickind/enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions