GetPath
is defined on the picture, not on the media library.
//Save image to media library
MediaLibrary library = new MediaLibrary();
var picture = library.SavePicture("Memefy_Photo", toShare);
//Open ShareMediaTask
var task = new ShareMediaTask();
task.FilePath = picture.GetPath();
task.Show();