Skip to content

Samples use custom theme resources #4312

Open
@michael-hawker

Description

@michael-hawker

Describe the bug

Some of our samples (like ListDetailsView) use custom theme resources {ThemeResource Brush-Blue-01} which cause problems if copied blindly. Any resources defined or used should be part of the sample XAML or we should only use system level resources that are part of OS/WinUI 2.x.

Steps to Reproduce

  • Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)

Steps to reproduce the behavior:

  1. Copy ListDetailsView sample XAML into a new app...
  2. Run, get an exception in MeasureOverride because theme resource is missing

Expected behavior

Easy to copy example and make work in an app.

Environment

NuGet Package(s):

Package Version(s):

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041)
  • Insider Build ({build_number})

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041)
  • Insider Build ({build_number})

Device form factor:

  • Desktop
  • Xbox
  • Surface Hub
  • IoT

Visual Studio version:

  • 2017 (15.{minor_version})
  • 2019 (16.{minor_version})
  • 2022 (17.{minor_version})

Additional context

This is something probably for us to keep in mind as we re-work samples in the future.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions