I canβt believe that no one has dealt with this, or maybe I just missed something.
I have a custom DataSourceController that processes data and provides it to the rest of the application controls. Naturally, it uses a sql connection, which is also initialized.
My application code:
private ISQLConnection conn;
public ISQLConnection SqlConnection { get { return conn; } }
private DataSourceController dataSource;
public DataSourceController DataSource { get { return dataSource; } }
protected override void OnStartup(StartupEventArgs e) {
conn = new OracleSQLConnection("connectionStringHere");
base.OnStartup(e);
}
Now I want to create an ObjectDataProvider in XAML and then use it to bind data in controls:
<ObjectDataProvider ObjectType="{x:Type data:DataSourceController}" x:Key="DataSource" MethodName="GetVenues" />
The problem is that the DataSourceController does not have a constructor without parameters and requires that the OracleSQLConnection object be passed (which is a public property in my application code).
? DataContext , ?!