none
I have just been told that my code in XAML VS studio 2015 is wrong - or could be after Windows 10

    Question

  • Below is what I was told for each sound:-

    Severity Code Description Project File Line Suppression State
    Warning 'PlayToPreferredSourceUri' is deprecated: PlayToPreferredSourceUri may be altered or unavailable for releases after Windows 10.0. Instead, use GetAsCastingSource().PreferredSourceUri. FUNATC C:\Users\Admin\Desktop\FinalATC2015\FUNATC\FUNATC\MainPage.xaml 147

    Could anybody tell me how to code the GetAsCastingSource().PreferredSourceURI?

    Where does the Assets\beep-07.wav go in the above

    Thanks

    Malcolm Bain



    Malcolm Bain

    Sunday, April 16, 2017 2:29 PM

Answers

All replies

  • Hi Malcolm,

    What kind of project are you developing in Visual Studio?

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, April 17, 2017 9:21 AM
  • Hi Fletch,

    It's a game written in VS 2015 in Visual Basic. However it is only how to code in XAML using what they said should be used for making sounds. It comes up as a warning that what I am using, and have for a long time, might not work in future versions of Windows 10.

    I have actually got the sound working in VS 2013 but would still like to know how to code what they suggested.

    Many thanks,

    Malcolm


    Malcolm Bain

    Monday, April 17, 2017 10:28 AM
  • Hi Malcolm, 

    >>  GetAsCastingSource().PreferredSourceURI

    It seem the issue is about how to use the method above, right? 


    I found this docs which just show the GetAsCastingSource() methods, I hope it could help you out 

    https://docs.microsoft.com/en-us/uwp/api/windows.media.playback.mediaplayer#Windows_Media_Playback_MediaPlayer_GetAsCastingSource

    Best regards, 

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, April 19, 2017 1:27 PM