When you select your WPF application in the File -> Open With dialog you will get it as parameter passed to your Application.
So if you're setting up your App.xaml like this:
<Application x:Class="WpfApp1.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApp1" StartupUri="MainWindow.xaml" Startup="Application_Startup"> ... </Application>
You can listen in your App.xaml.cs for the Startup Event:
private void Application_Startup(object sender, StartupEventArgs e) { foreach (var arg in e.Args) { MessageBox.Show(arg); } }
For demo purpose I just output all the arguments in a message box as it's hard to attach a debuger to the process in time. Now if we open any file with that app:

We will see this:

So the file path will be passed in as the first parameter to the application. From there you can do with it whatever you need to.
If you would associate a filetype with your application you'll get the same behavior via double-clicking the file. If your application will be installed using an installed like Wix you would have the option to associate certain filetypes as part of the installation directly.