Questions tagged [markup-extensions]

Markup extensions are a XAML technique for obtaining a value that is neither a primitive nor a specific XAML type. As XAML is based on simple XML syntax which due to its simplicity can be more verbose and thus one of the reasonable concepts of markup extensions was introduced. And this later syntax also provides a way to use values other than a literal string such as an already constructed object or a static object in our assembly.

Several markup extensions exist that are not specific to the WPF implementation of but are instead implementations of intrincics or features of as a language. These markup extensions are implemented in the System.Xaml assembly as part of the general Framework XAML services, and are within the XAML language XAML namespace. All the markup extensions derive from the abstract MarkupExtension class and override its ProvideValue method. The naming convention is to append the word Extension to the subclass’s name (only the Binding class does not follow the pattern). The XAML parser allows markup extensions to be created within {curly braces} and it also allows you to omit the Extension suffix when using a markup extensions if you want to.

170 questions
61
votes
3 answers

How to make Resharper resolve path for CustomBinding MarkupExtension

I want to create some extended Binding-Markup-Extension, which behaves just like a normal WPF-Binding but does some things more (use different defaults, maybe add some behavior, etc.). Code looks like this: public class CustomBindingExtension :…
Simon D.
  • 4,451
  • 2
  • 28
  • 57
26
votes
1 answer

VS2010 Custom MarkupExtension

We have just switched to vs2010 from vs2008, and our projects compile and run well without any problem. However, the xaml designer has some errors. Here is one of the errors hope someone can provide a solution. We have a custom MarkupExtension, and…
Qstonr
  • 815
  • 1
  • 9
  • 11
21
votes
1 answer

Can XAML 2009-related markup extensions be used in WPF?

I'm talking about extensions such as x:Reference and x:FactoryMethod, collectively appearing here. I'm reading a lot of contradictory information online, including on MSDN, Stackoverflow, and from other sources. I'll talk about x:Reference as an…
GregRos
  • 8,667
  • 3
  • 37
  • 63
18
votes
2 answers

Design time check of markup extension arguments in WPF designer

I've written a Markup extension for WPF that allows me to do