Tested this demo in Win10 1803 version, seems it can not work well, there are some exceptions.
one exception is "Windows.Graphics.Capture.GraphicsCaptureItem" is not registered.
After checking the notes of "Windows.UI.Composition-Win32-Samples/dotnet/WPF/ScreenCapture/", the demo need run in win 10 1903 or higher version. So close this issue now.