Doubt on using in Visual Studio

1

I create a new project but I can not put those using as in this example below. It appears as in the other code below ... Please help me = /

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
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 Windows.UI.Popups; // Não esqueça de adicionar este using

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?        LinkId=234238

namespace App1
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();
    }

    private async void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
    {
        // Aqui crio uma mensagem de dialog e a exibo.
        MessageDialog dialog = new MessageDialog("Teste", "Teste Dialog");
        await dialog.ShowAsync();
    }
}
}

It starts like this one:

using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication3
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        MessageBox.Show("Teste");
    }
}
}
    
asked by anonymous 10.04.2015 / 19:10

2 answers

2

The namespace Windows.UI.Xaml is present for the development of applications for Windows Store , so it was said that only works on Windows 8 ... there is no Windows Store for Windows 7. >

If you want to program for Windows 7, you can use WPF which is what it seems to be doing ... for your second snippet of code. However, the ready code you picked up will not work.

More information: #

About appearance

WPF supports themes (i.e. skins). This is the way to make WPF programs look like anything else.

Here you have two options:

10.04.2015 / 19:21
1

These using appear when you create a new Project / Solution in VisualStudio.

They are automatically placed by the IDE depending on the type of project you choose.

To develop a Desktop application you should choose one of these:

  • Windows Forms Application
  • WPF Application
  • Console Application

The one that comes closest to Windows 8 is WPF Application.

    
10.04.2015 / 19:34