Не удалось найти имя типа или пространства имен (новичок в XAML)
Так что я'пытаюсь создать очень простое приложение для игры в кости с документом XAML с помощью Visual Studio 2012, но я не могуНе могу понять, что делать с ошибкой. Я'мы пытались добавить, используя bitmapimage; но все равно победилт работа.
Вот ошибки яЯ получаю:
Error 1 Undefined namespace. The 'using' URI refers to a namespace 'DiceRoll' that could not be found.
Error 2 The type or namespace name 'BitmapImage' could not be found (are you missing a using directive or an assembly reference?)
CS:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using BitmapImage;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace DiceRoll
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainPage : Page
{
public MainPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
Random num = new Random();
int Number = num.Next(1, 7);
BitmapImage Img = new BitmapImage(new Uri(@"DiceFaces\" + Number.ToString() + ".bmp", UriKind.Relative));
textBlock1.Text = Number.ToString() + " Number";
image1.Source = Img;
}
}
}
XAML: