markup-extensions Questions

3

I want to create a Binding to a collection of strings defined inside XAML. In WPF I could create an ArrayList as a resource with a key, ready to be used as the source of a Binding (using a Static...
Falange asked 3/10, 2016 at 16:50

1

Solved

I have a custom markup extensions "ThemeExtension" to provide "SolidColorBrush" from my DefaultTheme.xaml ResourceDictionary. Calling example: BorderBrush="{extensions:Theme Key= FooKeyValue}" I...
Accelerator asked 23/10, 2018 at 10:23

1

I've created a custom MarkupExtension that allows an easy way to to forward events from FrameworkElements to methods on the view-model. Everything works perfectly, except Visual Studio doesn't prov...
Calefacient asked 18/10, 2017 at 18:48

2

Solved

I have a simple UIElement that I would like to turn into a MarkupExtension: [MarkupExtensionReturnType(typeof(FrameworkElement))] public class PinkRectangle : MarkupExtension { public override ob...
Decarbonize asked 19/7, 2019 at 20:51

2

Solved

Recently I read about an IValueConverter which also inherits from MarkupExtension. It was something like: internal class BoolToVisibilityConverter : MarkupExtension, IValueConverter { private sta...
Marten asked 13/2, 2015 at 13:48

1

Solved

Fall Creators update SDK added a Markup Extension class, great. https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.markup.markupextension So I create one and override and "ProvideValue" met...
Rosalvarosalyn asked 7/11, 2017 at 11:28

4

Solved

if I have an object say called MyObject, which has a property called MyChild, which itself has a property called Name. How can I get the value of that Name property if all I have is a binding path ...
Sloshy asked 26/8, 2010 at 17:35

3

I am trying to create my own MarkupExtension for localization. The idea is to pass a name of a resource (for example 'Save') to the markup extension and the return would be localized value (for exa...
Bree asked 17/1, 2018 at 8:19

2

Solved

I've made a markup extension for translating strings based on a key. Example <TextBlock Text="{Translate myKey}" /> Now I want to be able to use nested bindings for providing my keys. Exam...
Afc asked 12/6, 2009 at 9:50

6

Solved

How do you set a custom MarkupExtension from code? You can easily set if from Xaml. The same goes for Binding and DynamicResource. <TextBox FontSize="{Binding MyFontSize}" Style="{DynamicReso...
Skatole asked 20/9, 2011 at 18:15

1

Solved

I have a CustomMarkupExtension class. The Binding is working (!= null), but the BindingExpressionBase is always null. Can someone explain me why? I need to get the BindingExpressionBase to call th...
Rahm asked 22/5, 2017 at 6:40

1

Solved

I would like to create my own MarkupExtension (like Binding, TemplateBinding...) How can I do it for Universal Apps like I did in WPF?
Immitigable asked 20/12, 2016 at 15:2

1

Solved

Reducing this question to the bare minimum, consider this MarkupExtension class... public class ProblemStatement : MarkupExtension { private readonly string _first; private readonly string _seco...
Phylum asked 17/5, 2014 at 13:36

3

Solved

I'm developing a WPF MarkupExtension and encountered errors during design time. With the previous version of Visual Studio 2010 it was possible to start a second instance of Visual Studio&nbsp...

2

Solved

I'm thinking about ways of getting advance of C# 6 string interpolation in XAML, such as using them instead of value converters in some simple scenarios like replacing a zero by an empty string whe...
Companionship asked 26/5, 2015 at 13:14

1

In this case I am looking to use strings declared in a resource dictionary as part of a binding on a Text property. Binding just a single dynamic resource string is not a problem: <TextBlock Te...
Mcnally asked 6/6, 2013 at 13:2

3

Solved

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 l...

4

Solved

I am trying to make string.Format available as a handy function in WPF, so that the various text parts can be combined in pure XAML, without boilerplate in code-behind. The main problem is support ...
Peptone asked 20/8, 2014 at 22:19

1

Solved

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 ...
Par asked 14/3, 2014 at 20:12

1

Solved

The scenario: Create a MarkupExtension to replace Grid.Row=”0” by Grid.Row=”{namespace:ClassExtension GridRowName}” (same for column) Xaml Code: <Grid> <Grid.RowDefinitions> <Row...
Nolte asked 7/10, 2013 at 18:59

2

I've written a Markup extension for WPF that allows me to do <!-- Generic Styles --> <Style x:Key="bold" TargetType="Label"> <Setter Property="FontWeight" Value="ExtraBold" /> &...
Alves asked 9/4, 2013 at 12:54

4

Has anyone ever created a custom markup extension in WPF or Silverlight? When would you ever want or need to do this? Any tips or sources on how to do it?
Gamber asked 4/3, 2009 at 1:16

1

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 provid...
Biologist asked 28/4, 2010 at 21:26

1

Solved

I'm trying to create a WPF MarkupExtension class that provides translated text from my text translation class. The translation stuff works great, but requires a static method call with a text key t...
Chapter asked 6/2, 2013 at 19:25

3

Solved

Is it possible to have a DependencyProperty within a MarkupExtension derived class? public class GeometryQueryExtension : MarkupExtension { public XmlDataProvider Source { get; set; } public st...
Sainfoin asked 30/11, 2009 at 5:50

© 2022 - 2024 — McMap. All rights reserved.