objectdataprovider

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 code below so that the UserControl can create the ApplicationPresenter using the defaul...

how to share 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. <ObjectDataProvider x:Key="AsymmetricFrameHolder" ObjectType="{x:Type data:DataFrameAsymmetric}"/> I then try to access this in th...

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 safely. <ObjectDataProvider x:Key="FooSourceDS" ObjectType="{x:Type myNS:FooSource}" d:IsDataSource...

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 search box. I hook up the filter like so: var pickerView = FindResource("sortedRulesView...

Different filtered dataProviders for the same data ?

I have several lookup tables, some of which refer to or are relationships between others. For instance, I have membership type included inventory which has Membership ID and Inventory Type ID and is the amount of each Inventory Type that one gets when one gets a specific type of membership. When the user is reviewing an Inventory Type...

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 connection which I also initialize. My App code: private ISQLConnection conn; public ISQLConnec...

DataBinding in a List View

Hello All, Am new to XAML/WPF and have come across this weird issue: I have a list view to which I set a DataSource. The DataSource is an arraylist of "CatalogPartRows". I create my columns in the code. I then set their cell templates (some of my columns contain combo boxes and check boxes). My problem here is that I need to call a fu...

Binding ObjectDataProvider to a property instead of a method.

Suppose you have following class: class ProcessController { public List<Process> Active { get { ... } } ... public List<Process> GetProcesses() { ... } } I can use the GetMethod to bind a ObjectDataProvider to the GetProcesses() method: <ObjectDataProvider x:Key="pList" MethodName="GetProcesses" ...

WPF ObjectDataProvider and Mouse.GetPosition(IInputElement relativeTo)

I am attempting to bind the position of a camera to the relative position of a mouse's position in a 3D environment. Using an ObjectDataProvider I would imagine I can call this method and then bind to it, however, I'm not sure what to put in the ObjectDataProvider.MethodParameters, I'd like to reference the named Viewport3D from outside...

WPF ObjectDataProvider with static method GetPosition of Mouse

I am attempting to use an ObjectDataProvider to call the GetPositition method of Mouse, but am getting this error: System.Windows.Data Error: 34 : ObjectDataProvider: Failure trying to invoke method on type; Method='GetPosition'; Type='Mouse'; Error='No method was found with matching parameter signature.' MissingMethodException:'System....

WPF ObjectDataProvider with Mouse.GetPosition()

I have the following code, dw:ObjectReference is an implementation which is supposed to point to a declared ViewPort3D not in the UserControl.Resources. Is this even possible? And if so what should I replace dw:ObjectReference with? <ObjectDataProvider MethodName="GetPosition" ObjectType="{x:Type Mouse}" x:Key="odp"> <ObjectData...

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 I'm looking to day. I'd like to be able to have the ComboBox (locations) change the TextBl...

WPF -- How to bubble up event from Collection class to main Window

I'm using an ObjectDataProvider to call a class of with IObservableCollection: <ObjectDataProvider x:Key="WaitingPatientDS" ObjectType="{x:Type local:clsPatients}"> <ObjectDataProvider.ConstructorParameters> <sys:Boolean>True</sys:Boolean> </ObjectDataProvider.ConstructorParameters> </ObjectDataProvider> c...

WPF -- trap database connection errors from ObjectDataProvider

I've got a WPF application that uses LINQ to SQL DataContexts. The first call to the database would be from the ObjectDataProvider in the XAML of the main form: <ObjectDataProvider x:Key="WaitingPatientDS" ObjectType="{x:Type local:clsPatients}"> <ObjectDataProvider.ConstructorParameters> <sys:Boolean>True</sys:Boolean> ...

WPF -- How NOT to use an ObjectDataProvider?

I have my first WPF working fine with an ObjectDataProvider in the XAML: <ObjectDataProvider x:Key="WaitingPatientDS" ObjectType="{x:Type local:clsPatients}"> <ObjectDataProvider.ConstructorParameters> <sys:Boolean>True</sys:Boolean> </ObjectDataProvider.ConstructorParameters> </ObjectDataProvider> However, I don't lik...

WPF Binding to method of a collection element

Im searching for the best practice (or any working solution) for the following scenario: I have an Employee class: public class Employee { public string DisplayName { get; set; } // It is important that this method has a parameter public string GetSomething(string param) { return param + DisplayName; } } I have a...

WPF: ObjectDataProvider issue

I am using an ObjectDataProvider declared in the XAML as follows: <UserControl.Resources> <ObjectDataProvider x:Key="odpTheList" ObjectType="{x:Type library:StaticClass}" MethodName="GetListOfItems" /> </UserControl.Resources> Basically it calls StaticClass.GetListOfItems() to get t...

WPF TreeView doesnt display Object Hierarchy

Hello, I am having some serious trouble creating a WPF TreeView with an Object databinding. The application is config file editor. I have defined an Object structure which can be serialized to the correct XML format. The problem I am having is formatting the object instance in the TreeView showing the correct hierarchy. The TreeView w...

WPF: Binding with nonstatic parameter? (newbie question)

Hi guys, This will probably be obvious but I can't find the best way. I want to show the user's ToDo's in a listbox. These ToDo's are in the database and consist of an Id, UserId and Description. The user logged in to the app. How can I retrieve the ToDo's for that certain userId and set it up for binding to the listbox? I was tryi...

[XAML] Using ObjectDataProvider as binding source gives SQL error

Hi I have a weird problem that i can't figure out a solution for: I've made a little WPF app written in C# that uses an attached SQL Server Express .mdf database which i then manipulates through LINQ. I have a ListView on the form which datacontext is set to .DataContext = dr.FindAllBuyOrders() which returns an IQueryable BuyOrder obj...