The type or namespace name could not be found (New to XAML)

前端 未结 1 1461
心在旅途
心在旅途 2021-01-19 03:27

So I\'m trying to work a very simple dice app on a XAML document using Visual Studio 2012, but I can\'t figure out what to do with the error. I\'ve tried adding using bitmap

相关标签:
1条回答
  • 2021-01-19 03:51

    Try

    using System.Windows.Media.Imaging.BitmapImage;
    

    Instead of

    using BitmapImage;
    

    An easier way is to let Visual Studio do it for you : Right click on BitmapImage in your code -> resolve, and select the right namespace (there is generaly only one)

    For the xaml, let Visual studio do it for you too, or :

    <Page ...
        xmlns:local="clr-namespace:System.Windows;assembly=DiceRoll"
    />
    
    0 讨论(0)
提交回复
热议问题