WPF: Using VS, we can create 2 kinds of WPF applications, one is desktop application " WPF Application" another is Web RIA application " WPF Browser Application";
VS: An IDE;
Create a WPF "Hello world" Application:
File -> New project -> WPF Application; (HelloWorld)
We can see the auto-create file at the VS right panel Solution Explorer, where display all files of our project; And we should know the usage of each file and folder:
Properties folder contain and properties of project; we can add new resource from here;
Reference folder contain some libs for running project;
app.config is configurations file;
app.xaml is whole layout setting, the Application will load this file at first;
<Application x:Class="HelloWorld.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml"> // When app is loading, MainWindow will be start;
<Application.Resources>
</Application.Resources>
</Application>
In this files tree, every instance of window have a branch like MainWindow; And xaml file is layout file, corresponding cs file is C# file which will respond to all requests and events sent from window;
When we create a new window, we can use grid to set layout;
We need to write much C# code to deal with the event; WPF offer some basic event, to which we can depart some complex event;
My Example:
Create a new WPF App,C_SMS,
First thing we need to set the most top Grid, to build a nice frame to display your layout; you can design your Grid at UI design view, it's very easy and intuitive to make it out;
now, you have an static UI,what you need to do just add some events; there are a simple way to implement Dragging control; right click "solution explorer" to add reference, and find two lib files:
"Microsoft.Expression.Interactions.dll"
"System.Windows.Interactivity.dll"
from MS expression blend 4
then add below to MainWindow.xaml
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:b="http://schemas.microsoft.com/expression/2010/interactions"
add below to control which you want to drag it
<i:Interaction.Behaviors>
<b:MouseDragElementBehavior Dragging="" DragFinished=""/>
</i:Interaction.Behaviors>
We should write C# function to deal with events Dragging and DragFinished;
VS: An IDE;
Create a WPF "Hello world" Application:
File -> New project -> WPF Application; (HelloWorld)
We can see the auto-create file at the VS right panel Solution Explorer, where display all files of our project; And we should know the usage of each file and folder:
Properties folder contain and properties of project; we can add new resource from here;
Reference folder contain some libs for running project;
app.config is configurations file;
app.xaml is whole layout setting, the Application will load this file at first;
<Application x:Class="HelloWorld.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml"> // When app is loading, MainWindow will be start;
<Application.Resources>
</Application.Resources>
</Application>
In this files tree, every instance of window have a branch like MainWindow; And xaml file is layout file, corresponding cs file is C# file which will respond to all requests and events sent from window;
When we create a new window, we can use grid to set layout;
We need to write much C# code to deal with the event; WPF offer some basic event, to which we can depart some complex event;
My Example:
Create a new WPF App,C_SMS,
First thing we need to set the most top Grid, to build a nice frame to display your layout; you can design your Grid at UI design view, it's very easy and intuitive to make it out;
now, you have an static UI,what you need to do just add some events; there are a simple way to implement Dragging control; right click "solution explorer" to add reference, and find two lib files:
"Microsoft.Expression.Interactions.dll"
"System.Windows.Interactivity.dll"
from MS expression blend 4
then add below to MainWindow.xaml
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:b="http://schemas.microsoft.com/expression/2010/interactions"
add below to control which you want to drag it
<i:Interaction.Behaviors>
<b:MouseDragElementBehavior Dragging="" DragFinished=""/>
</i:Interaction.Behaviors>
We should write C# function to deal with events Dragging and DragFinished;