I'm trying to load a local image and use it for the cursor. In order to do so I have to send a stream from the image to the Cursor(Stream cursorStream) constructor.
var res = Application.GetResourceStream(new Uri("pack://application:,,,/MyProj;component/Images/delete-icon.png"));
this.Cursor = new Cursor(res.Stream);
The problem is that I always get this exception
ReadTimeout = (res.Stream).ReadTimeout threw an exception of type 'System.InvalidOperationException'
WriteTimeout = (res.Stream).WriteTimeout threw an exception of type 'System.InvalidOperationException'
How should I do it?