Skip to content

[C# Markup] How should I use ThemeResource in template control? #2268

Closed Answered by dansiegel
kucint asked this question in Q&A
Discussion options

You must be logged in to vote
  1. The ThemeResource class is indeed internal sealed class

    So ThemeResource is a static public class. ThemeResource<T> which is the one you're trying to use in your sample is an internal sealed class and it's meant to be because it's the BindingProvider that is used internally by the IDependencyPropertyBuilder if you did x => x.ThemeResource("Foo")

    You are correct there is a bug in the docs. I will have a PR up this morning to fix it. Thanks for bringing it to my attention. (see #2269)

  2. How should I bind themes to template control?

    This one gets a little trickier. There are some edge cases for Resource resolution that are very hard for us to properly replicate from C# Markup because w…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@kucint
Comment options

@dansiegel
Comment options

Answer selected by kucint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants