Questions tagged [objectdataprovider]

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

Important links

89 questions
6
votes
1 answer

How to pass value to ObjectDataProvider.MethodParameters dynamically in runtime

I wrote this code: public class CustomData { public int F1 { get; set; } public int F2 { get; set; } public string F3 { get; set; } } public class RetrievCustomData : List { public RetrievCustomData GetSome(int i) …
Arian
  • 12,793
  • 66
  • 176
  • 300
6
votes
4 answers

WPF binding of string property and Button.Content

I want to bind string property with Button.Content. But why it didn't work? The data class: namespace test4 { public class Test : INotifyPropertyChanged { string _Text = "Begin"; public string Text { …
Begtostudy
  • 1,374
  • 4
  • 13
  • 28
5
votes
2 answers

how use List within xaml?

So I am pretty sure that up in the definition part I need to include something along the lines of: xmlns:s="clr-namespace:System.Collections.Generic;assembly=?????" but I just do not know what to put in place of the ???'s. What I want to do with…
Toadums
  • 2,772
  • 8
  • 44
  • 67
5
votes
2 answers

WPF ComboBox as System.Windows.Media.Colors

Wanting to get the color combobox (see image) behavior in my WPF ListView column. Can someone help me get this started? I am comfortable with ListView binding but not sure how to implement this. EDIT: …
markokstate
  • 923
  • 2
  • 14
  • 28
5
votes
1 answer

WPF designer error Value cannot be null. Parameter name: pattern

I've seen a lot of other ObjectDataProvider questions where the Parameter name: type, name, whatever, cannot be null. Those questions are all due to actual parameters not being set. As far as I can tell, there is no "pattern" parameter for an…
user2943131
  • 107
  • 3
  • 10
4
votes
1 answer

Using ObjectDataProvider

I cannot believe that nobody has gotten across this or perhaps I'm just missing something. I've got a custom DataSourceController which handles retrieving data and providing it to the rest of the application controls. Naturally, it uses sql…
Alexandra
  • 4,723
  • 3
  • 26
  • 32
4
votes
1 answer

passing listbox item index as parameter to objectdataprovider

I am currently attempting to use an object data provider to return the colour that I would like to use as a background for each listbox item, with the colour dependent on that listbox items index. Basically the parameters passed to the object is the…
Jay
  • 47
  • 2
4
votes
3 answers

Instantiate and reuse instances of objects in XAML

I want to instantiate objects in XAML, and reuse these instances. I think it should be simple but I'm stuck, I'm probably missing something obvious. Say I want to add Cats to different Rooms (Room has an ObservableCollection containing objects of…
eriksmith200
  • 2,159
  • 5
  • 22
  • 33
4
votes
1 answer

Sharing an ObjectDataProvider in WPF

I am trying to share an ObjectDataProvider resource between my main application and a user control. I define the odp in a separate resource dictionary file that is included in the app and the user control.
David Turvey
  • 2,891
  • 6
  • 27
  • 29
4
votes
3 answers

No connection string found, but only at design time

Hi I'm fairly new to WPF and C#, so please be easy on me if this is just a silly question: I'm using VS2012, Entity Framework to create a model of a pre-exisiting database and I would like to bind some tables to some ListView... Now, I know there…
3
votes
2 answers

Binding ObjectDataProvider to a property instead of a method

Suppose you have following class: class ProcessController { public List Active { get { ... } } ... public List GetProcesses() { ... } } I can use the GetMethod to bind a ObjectDataProvider to the GetProcesses()…
Theo Lenndorff
  • 4,556
  • 3
  • 28
  • 43
3
votes
2 answers

WPF Binding to Proxy

I have a number of collection classes that implement their own custom update notification. It should be pretty easy to translate these notifications to an INotifyCollectionChanged implementation in a proxy class. INotifyPropertyChanged is already…
Stephen Cleary
  • 437,863
  • 77
  • 675
  • 810
3
votes
2 answers

Binding a buttons IsEnabled/Visibility properties using its x:Name as a parameter in a method in the code-behind

I need to pass in the controls name to a method in a security object that returns a boolean value for the IsEnabled property and another method that returns its Visibility(Collapsed, Hidden, or Visible). These both have to be checked for permission…
jes9582
  • 253
  • 4
  • 15
3
votes
2 answers

WPF: Convert integer to bool using ObjectDataProvider

In my WPF app, I have a Save button which needs to be enabled when a collection count is greater than 0. I am trying to convert using ObjectDataProvider which will use Convert.ToBoolean(int value). (I can use a converter, but why not try learn…
Nikhil Agrawal
  • 47,018
  • 22
  • 121
  • 208
3
votes
1 answer

Strange behavior of markup extension. Does it not work in design mode?

The whole “story” only to be able to configure everything in XAML. I’m trying to pass parameter (variable from my Application class) to ObjectDataProvider(ODP) method. The idea was to use markup extension. Now at runtime everything works perfect…
AndrewZ
  • 31
  • 5
1
2 3 4 5 6