Write the following code in a WPF application in C#: In a given real matrix of size 3 x 4, swap the row containing the element with the largest value with the row containing the element with the smallest value. It is assumed that these elements are singular.
Here's an example implementation of the described functionality in C# for a WPF application:

```c#
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        double[,] matrix = new double[,] {
            { 1.2, 3.4, 5.6, 7.8 },
            { 9.0, 8.0, 6.0, 4.0 },
            { 3.2, 5.1, 2.0, 1.5 }
        };

        int maxRowIndex = 0;
        int minRowIndex = 0;

        double maxValue = matrix[0, 0];
        double minValue = matrix[0, 0];

        // Find the row containing the element with the largest and smallest values
        for (int i = 0; i < matrix.GetLength(0); i++)
        {
            for (int j = 0; j < matrix.GetLength(1); j++)
            {
                if (matrix[i, j] > maxValue)
                {
                    maxValue = matrix[i, j];
                    maxRowIndex = i;
                }
                if (matrix[i, j] < minValue)
                {
                    minValue = matrix[i, j];
                    minRowIndex = i;
                }
            }
        }

        // Swap the rows
        for (int j = 0; j < matrix.GetLength(1); j++)
        {
            double temp = matrix[maxRowIndex, j];
            matrix[maxRowIndex, j] = matrix[minRowIndex, j];
            matrix[minRowIndex, j] = temp;
        }

        // Output the resulting matrix
        for (int i = 0; i < matrix.GetLength(0); i++)
        {
            for (int j = 0; j < matrix.GetLength(1); j++)
            {
                Console.Write("{0,6}", matrix[i, j]);
            }
            Console.WriteLine();
        }
    }
}
```

This code initializes a 3x4 real matrix, finds the row containing the element with the largest and smallest values, and swaps the rows. Finally, the resulting matrix is output to the console. This code can be easily adapted to a WPF application by replacing the console output with a display in a text box or other UI element.