Questions tagged [objectdataprovider]

provides data binding for XAML in Microsoft Windows Presentation Foundation (WPF) 4

Important links

89 questions
3
votes
1 answer

How to use an ObjectDataProvider to bind an enum to a ComboBox in XAML

I am trying to bind an Enum to a ComboBox. I have seen a lot of people using an ObjectDataProvider but I cannot seem to access it. I have also noticed that some people are using it within a Window.Resources, rather than Page.Resources but I cannot…
andas1951
  • 65
  • 3
  • 10
3
votes
1 answer

Binding WPF GridViewColumn to method with parameter

I am trying to bind GridViewColumn to a method with parameter. My current XAML looks like this:
sergman
  • 171
  • 1
  • 2
  • 12
2
votes
1 answer

Is it possible to bind WPF Combobox.SelectedValue to multiple ObjectDataProviders?

Trying to determine if it is possible to bind the SelectedValue of a ComboBox to the inputs of multiple ObjectDataProviders with XAMAL Bindings. I looked at MultiBinding but that appears to be grouping multiple controls together, not exactly what…
Brian
  • 68
  • 1
  • 6
2
votes
1 answer

WPF ObjectDataProvider Parameters

I have an ObjectDataProvider for getting a list of enum members:
Jasper Kent
  • 3,546
  • 15
  • 21
2
votes
1 answer

View lost when refreshing ObjectDataProvider

I'm implementing a textbox filter on a list based on Josh Smith's example at http://joshsmithonwpf.wordpress.com/2007/06/12/searching-for-items-in-a-listbox. Basically, it sets the Filter on the view to a delegate that checks against the text in the…
Yostage
  • 292
  • 2
  • 4
  • 12
2
votes
3 answers

WPF enumeration value as ObjectDataProvider's method parameter

I want to pass for as a parameter for the GetValues method from MyItemSourceProvider a concrete value of MyEnum. How to write it please?
theSpyCry
  • 12,073
  • 28
  • 96
  • 152
2
votes
1 answer

wpf xaml calling a method on the current object

Im attempting to bind to the output of a method. Now I've seen examples of this using ObjectDataProvider However the problem with this is ObjectDataProvider creates a new instance of the object to call the method. Where I need the method called on…
Without Me It Just Aweso
  • 4,593
  • 10
  • 35
  • 53
2
votes
2 answers

Converting XAML ObjectDataProvider to C#

I would like to create my ObjectDataProvider in my C# code behind rather than my XAML. I was wondering how to change this XAML into equivalent C#. The XAML was generated by Microsoft Expression Blend 2, so the d: namespace can be ignored…
Jippers
  • 2,635
  • 5
  • 37
  • 58
2
votes
1 answer

Can an ObjectDataProvider work with derived classes?

Let's say I have a base viewmodel for a specific control that implements some basic properties, e.g. public abstract class ControlVmBase{ public abstract int IconSize {get;set;} } I also have a ResourceDictionary which I want to use with…
Lennart
  • 9,657
  • 16
  • 68
  • 84
2
votes
3 answers

How do you pass "this" to the constructor for ObjectDataProvider in XAML?

How do you pass "this" to the constructor for ObjectDataProvider in XAML. Lets say my presenter class is: public class ApplicationPresenter(IView view){} and that my UserControl implements IView. What do I pass to the ConstructorParameters in the…
Jeremy Holt
  • 987
  • 1
  • 9
  • 14
2
votes
0 answers

Can WPF ObjectDataProvider invoke generic method?

Commonly known, ObjectDataProvider can invoke simple nongeneric methods like that XAML: CodeBehind: public static…
monstr
  • 1,680
  • 1
  • 25
  • 44
2
votes
1 answer

Why my WPF binding not work?

I trying to bind List to Listbox. And at the Button1Click method new instance of MyClass adds in my List<>, but that not visible in my listbox. There my code: public static class NotesEngine { public static…
Dmitriy Kudinov
  • 1,051
  • 5
  • 23
  • 31
2
votes
1 answer

Can MethodParameters in an ObjectDataProvider be databound to other controls?

I've been exploring WPF and XAML for a while now, but have hit a slight stumbling block revolving around binding to a method. My situation is: There is a ComboBox bound to a DataTable. There is a ListBox bound to the return value of a method…
pete the pagan-gerbil
  • 3,136
  • 2
  • 28
  • 49
2
votes
1 answer

WPF Binding to a method with parameter inside HierarchicalDataTemplate

Is there any way to bind a value to a textblock that is obtained from a method. For example, I pass my Person object into the HierarchicalDataTemplate, from there I can access its Weight property. Now lets say I want to get the weight in mars, I…
2
votes
1 answer

Bind enum with ObjectDataProvider

I have an enum that bind to a ComboBox in my view. public enum MyItems { [Browsable(false)] Item1, [Browsable(true)] Item2, [Browsable(false)] Item3, [Browsable(true)] Item4, } In view I use ObjectDataProvider …
Hodaya Shalom
  • 4,327
  • 12
  • 57
  • 111