You've copied the code sample from
MSDN document[
^]. Was it a headache reading more from there? That was just the first page, continue reading more on MSDN you will learn drap and drop in WPF from there.
Since that code is not yours, you will not be able to understand any other code that we might share as a solution or suggestion. I will suggest, you keep reading those documents and trying out their code. MSDN codes are for examples and trial sort of stuff.