I want to access a connection string defined in my app.config file to initialize a control in a .xaml file in a WPF appliction but can't quite figure out how to do it. I could set the value in the loaded event but I really want to keep all the initialization together in the .xaml file.
Below is my app.config
<?xml version="1.0" encoding="utf-8" ?>
<add name="OracleConnectionString" connectionString="Data Source=XXXXX;Persist Security Info=True;User ID=XXXXX;Password=XXXXX Max Pool Size=400"
<add key="DefaultAuctionID" value="304"/>
and here is an example of a customer user control I wrote that has a connection string property exposed.
<bs:PriceStats AuctionID="304" Width="Auto" Height="Auto"
ConnectionString="Data Source=XXXXXX;Persist Security Info=True;User ID=XXXX;Password=XXXXX; Max Pool Size=400"></bs:PriceStats>
I want to be able to access the connectionstring and the DefaultAuctionID from the app.config in the .xaml file.