objectdataprovider

WPF ObjectDataProvider that supports linq filtering?

Is there an WPF ObjectDataProvider that supports "Where" I mean like in asp.net there is an option to have a dataprovider that supports defining the results? What I actually need is two ComboBoxes that when I choose a value in the first it limits the second one. Say I have a parent table Category and a child table Group. I want that whe...

WPF data binding - DataGridComboBoxColumn and ObjectDataProvider

I'm trying to code a WPF 4.0 DataGrid that matches a database table, with two entries in particular GroupID and SectionID... GroupID contains a collection of groups, and SectionID should be built from a table that takes a {GroupID, SectionID} keys and returns section information. Binding the DataGridComboBoxColumn to the groups table to...

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 would call the InMars method that takes a parameter of int EarthWeight . Now earthweight is g...

Problem with DataTemplate and ObjectDataProvider refresh

I have a problem with a edit templete of cell in a WPF datagrid (WPF Toolkit). The template is builded with a ComboBox and the ItemsSource of ComboBox are loaded at runtime. This is the mean code... <ObjectDataProvider x:Key="dataValuesProvider" MethodName="GetValues" /> <toolkit:DataGrid ItemsSource="{Binding Path=MyItems}"> <toolkit...

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 (GetDates) via an ObjectDataProvider. One of the input parameters of the method GetDates is an ...

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 List<Note> All; static NotesEngine() { All ...

WPF Pass MenuItem selected as MethodParameter to ObjectDataProvider

I am trying to pass Selected MenuItem's Text/Header string as the MethodParameter to my ObjectDataProvider. I have seen examples like these on the internet but haven't been able to adapt it to the Menu Control specifically. I am new to WPF and need some help accomplish this. Any help would be greatly appreciated. Below is the code snipp...

Using a WPF toolkit DatePicker as a parameter to an ObjectDataProvider used as an itemssource (cont)

Continuing from the original question, when the ObjectDataProvider binds from the specified Method, a number of BindingExceptions are raised similar to the following: System.Windows.Data Error: 39 : BindingExpression path error: 'xxx' property not found on 'object' ''Object' (HashCode=15292788)'. BindingExpression:Path=xxx; DataIte...

WPF: How can I bind a label to ObjectDataProvider and specify the parameters?

What I need to do is: a) I MUST use custom localization (legacy system) b) Users need to be able to change the localization at will from with the application c) Localization must be done via data binding So, I guess the way to go would be to use the ObjectDataProvider, but how would I specify the parameter being passed? Such as "okb...

Will the changes of a property in a "StaticResource instance" reflected in UI ?

I have used object data provider to create instance of my view-model as below: <ObjectDataProvider x:Key="Datas" ObjectType="{x:Type ViewModel:UserControlViewModel}"> </ObjectDataProvider> <DataTemplate x:Key="SourceGrid"> <WPFToolKit:DataGrid x:Name="SourceDataGrid" ItemsSource="{Binding Source={StaticResource Datas},Path=SourceGridDa...

Bind the value of a parameter in an ObjectDataProvider in WPF

I would like to be able to be doing this : <ObjectDataProvider x:Key="dataProvider" ObjectInstance="uiRoot:App.Current.Controller" MethodName="GetMyViewModel"> <ObjectDataProvider.MethodParameters> <system:Int32>{Binding Id}</system:Int32> </ObjectDataProvi...

ObjectDataProvider in MVVM not neccessary?

Hello, I have created a simple MVVM, with only three classes CashFlowView, CashFlowViewModel, CashFlowModel. I use an infragistic's 9.1 XamDataPresenter (or xamDataGrid). <igDP:XamDataPresenter Name="xamDataPresenter1" DataSource="{Binding Source={StaticResource CashFlowData}}"> <ObjectDataProvider x:Key="CashFlowData" Obje...

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 { get{return _Text;} protected set { _Text = value; } } publi...

WPF, calling method with parameters in XAML's class

I have an ObjectDataProvider in my XAML that references a method in my Window-deriving class. That is, I have NewForm.xaml.cs with class NewForm and the ObjectDataProvider in NewForm.xaml is referencing a method in NewForm. Currently, with the following XAML, I get a stack overflow error because the NewForm constructor keeps getting ca...

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 the current object instance. I'm currently trying to get a converter to work. Setup: ...

WPF enumeration value as ObjectDataProvider's method parameter

Hi ! I want to pass for as a parameter for the GetValues method from MyItemSourceProvider a concrete value of MyEnum. How to write it please? <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type local:MyItemSourceProvider}"> <ObjectDataProvider.MethodParameters> <!-- ENUM value (e.g. MyEnum.Record1) --> ...

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 type Cat). In the UserControl.Resources I create ObjectDataProviders: <ObjectDataProvider ...

passing listbox item index as parameter to objectdataprovider

Hey guys, 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 original colour and the listboxitem index, and it will return a colour that i...