cancel
 

 

Job type :

Zip Code :

community forums

Featuring over 100 topics of interest to DoItYourselfers.

How to Use the Solution Explorer in MS Visual Studio

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Video Transcript

So this is the Solution Explorer, and the first thing to notice that we have both a solution and a project and this might seem a little bit redundant in our case, but a solution can actually contain multiple projects. And so, it make sense that you would have a solution in that the solution can only contain one project.

Now, let us take a look at what is in this project. We work our way down from the top. For the time being, we would not do to let with the first two notes, so I will cover those quickly. We will use properties in this project, but this is a really cool way to store application settings on the system. This is a .NET thing though and that is a way to specific to WPF.

I do want to explain a little bit about references though. If you expand the references note, you will see that this project has a lot of references. References come into play when there is external code like a DLL or an external library that we want to use from within inside of our project. All the references that you see here are standard to the WPF application. In fact most of these are references to standard .NET assemblies. A couple of them though are WPF specific and I want to explain just a little bit about each of those.

The first of these is presentation core. Presentation core contains some of the core WPF services in libraries. These includes things like media or shapes, some of the other media things that WPF can do. The second of these is presentation framework and presentation framework contains what we generally refer to as the framework in WPF. These includes things like controls, and layout, and data binding. These are the high level concepts which you use when you are creating an application or when you are creating UI.

And then the last of these is window base. The windows base contains some of the base classes and basic services the WPF offers. You do not really need to think too much about these references though. They have already been added to the project for you by the template that we use. And this will be available to anybody that has .NET installed on their machine so you will not need to redistribute those with an application you build.

The last two files that you see here are what we call XAML files. You will notice that they have the extension XAML, eventhough it might not look like it refers that is actually pronounce XAML. The XAML stands for Extensible Application Markup Language. You can think of XAML as being something along the line of HTML. XAML are markup language, it is XAML based, and we use it in WPF to create the UI for the application. In fact, most of what we do this training is going to be about becoming familiar with the capabilities in XAML. So you will notice that the file we have opened right now is this bottom file, Window1.XAML and as when you look at it, you can see the XAML in here.

The really cool thing about XAML is that every single tab corresponds to an actual object that gets created. So when you see a tag like this one, you can know that that means, that in this XAML, we are actually creating a new object of type window. The other thing to know about this, is that each attribute to get set on XAML note, corresponds to a property on that object. So when we create this window, we are setting a number of properties as well. Some of the more interesting lines are title, height, and width. You can see that we are creating a window. We are setting its title to be music player. We are setting the height to be 300 and we are setting the width to also be 300.

We will also setting some rather clip top clicking properties. This is actually an exception to that rule. There is for example no XMLNS property declared on the window class. XMLNS is actually a standard XML attribute which what has declare a namespace for the tags and the document. We declared two namespaces so far. The first of these is the default namespace. The default namespace is the namespace that contains all of the standard WPF tags that we are going to use like window and grid, or button, or even rectangular ellipse. Most of what we will use inside of this application actually comes from this default namespace.

There are times though that you want to bring in some code that does not actually exist in the default namespace and in order to bring in that code, you declare the an additional namespace like the X colon namespace which is declared here. The X colon namespace actually defines a number of special attributes that are XAML specific. For now, do not let the X throw you off. You will be seeing it a lot. A good example of something that uses the X colon namespace is up at the top of our window and that is the X colon class attribute which we set. We will talk more about that in just a minute.

So remember that when you first run this application, we had a fairly small window that was pure white. I want to show you what happens when we actually change some of the attributes on the window class. First thing we can do is change the title. You can go ahead and call this whatever you want. I am going to call this My WPF music player. We are also going to set the width and the height properties to some values that will become useful later on the application. I am going to change the height to be 330 and I am going to change the width to be 460. Now if you are running a monitor that is running a 96 DPI, this will actually correspond to pixel values. But one of the great things that WPF does is, is it can work in virtual pixels and that means that if you are running a monitor that is bigger or has a higher DPI than 96 by 96. The WPF will actually scale this up for you automatically and correspond to the size that what have been if the monitor had been 96 DPI. This means that as an application author, you do not need to take high DPI monitors into account as you are creating a software but you always get the best possible experience for that monitor.

Finally, I am going to set to new properties on this window that we do not have here.
So this is the Solution Explorer, and the first thing to notice that we have both a solution and a project and this might seem a little bit redundant in our case, but a solution can actually contain multiple projects. And so, it make sense that you would have a... click to read more


Painting Stylish Wall Borders

sponsored articles of the day

diy centers

Research and explore a wealth of wisdom on these topics