It is time to adapt the wrapper for joystick style devices in order to use it in our XBAP WPF application.
Note
By default, Visual Studio configures an XBAP WPF application to run as a partial trust application. We are going to change that in order to have access to DirectInput. However, this is not a recommended practice. You should only use it when working with other security resources as certificates.
1. Open the
3DInvadersXBAP
project.2. Select Project | Add Reference... and select Microsoft.DirectX.DirectInput. Then, click on OK.
3. Now, the project will list the reference to the aforementioned DLL in the Solution Explorer.
4. Right-click on 3DInvadersXBAP (the main project) in the Solution Explorer and select Properties from the context menu that appears.
5. Click on the Security tab and then activate the radio button This is a full trust application. Now, we will be able to access DirectInput and to use the joystick wrapper from our XBAP...