Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can add the <code>DataSourceController</code> as a resource (you'll have to do this from code-behind if you don't have a parameterless constructor) and use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.data.objectdataprovider.objectinstance.aspx" rel="nofollow noreferrer">ObjectDataProvider.ObjectInstance</a> property to get the <code>DataSourceController</code> instance, then you can execute methods on it:</p> <pre><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) { //------------------------------------------------------- // Initialize connections conn = new OracleSQLConnection("connectionStringHere"); //------------------------------------------------------- // Initialize controllers dataSource = new DataSourceController(conn); this.Resources.Add("myDataController", dataSource); base.OnStartup(e); } </code></pre> <p><code>ObjectInstance</code> can take a resource:</p> <pre><code>&lt;ObjectDataProvider ObjectInstance="{StaticResource myDataController}" x:Key="DataSource" MethodName="GetVenues" /&gt; </code></pre> <p>There might be issues if your <code>ObjectDataProvider</code> is in App.xaml where it could be parsed before the <code>DataSourceController</code> resource is added, in which case you'd get an error because the "<code>myDataController</code>" resources wouldn't exist yet.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload