0

in my App.xaml iv'e initialized an object which i wan't to use in different classes in my application

 <Application.Resources>
      <local:DalEngine x:Key="_engine" x:Name="_engine"/>        
 </Application.Resources>   

how can i Reference this object in code from a class with in the same namespace ?

4

1 回答 1

1

Namespace does not matter, you can use Application.Current.FindResource. (Or directly Application.Current.Resources["_engine"])

于 2012-04-06T04:23:32.977 回答