WPF resource nesting, one resource referencing another resource, the referenced resource should be declared in the previous

Source: Internet
Author: User

In WPF's XAML window.resources, one resource refers to another resource, and the following error occurs:

"Error 1" {Dependencyproperty.unsetvalue} "is not a valid value for the" System.Windows.FrameworkElement.FocusVisualStyle "property on the Setter.

Such as:

Although errors appear in the Error list, the missing program can still run, but the UI view (interface) is not visible in the designer.

This error occurs because:

The declaration of the referenced resource is behind the resource that references it (or there is no declaration of the referenced Resource).

Workaround:

Write the declaration of the referenced resource in front, such as:

In this way, you can see the beautiful interface in the XAML designer.

WPF resource nesting, one resource referencing another resource, the referenced resource should be declared in the previous

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.