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;
分享到:
相关推荐
基于Visual Studio 2010,C# 4, ASP.NET 4, and WPF快速入门电子书。
Visual Studio 2017 C#WPF用MaterialDesign实现工控界面
实现仿Visual_Studio风格的控件DockPanel,可实现VS工具箱一样可悬浮和隐藏的控件。很不错的控件哦!文档里面有下载地址!
WPF In Action with Visual Studio 2008 WPF In Action with Visual Studio 2008
Mastering Visual Studio 2019, 2nd Edition: Explore the new features in Visual Studio 2019 and build apps using WPF, .NET Core, TypeScript, and Azure Visual Studio 2019 is the latest IDE from ...
As a technical buff, Kunal has in-depth knowledge of OOPs, C#, XAML, .NET, WPF, UWP, Visual Studio, Windows 10 and Microsoft Azure. He is also proficient in entire Software Development Life Cycle ...
用Visual Studio 2017 C# WPF DependencyProperty实现依赖属性演示程序2022-02-21
用Visual Studio 2017C#WPF实现换肤技术拥有20多套皮肤不同风格的样式.rar
Professional Visual Studio 2008Microsoft Visual Studio 2008 is the latest version in the ongoing evolution of the Integrated Development Environment (IDE), and this resource examines the diverse ...
009.Visual Studio 2017 C#WPF实时曲线图的使用和沿轴移动的效果[DynamicDataDisplay ]
在Visual Studio Code中运行和调试WPF项目在Visual Studio Code中运行和调试WPF项目时要考虑的特殊事项是:在* .csproj中: 目标平台必须为x64: x64 ; PDB需要可移植:可移植在* .xaml文件上设置生成器: MSBuild:...
ASP.NET 4, and WPF, with Visual Studio 2010 Jump Start.pdf
Visual Studio2017实现WPF3D动画在6轴联动机器人运动控制
The goal of this book is to provide a practical guide to building WPF applications using Visual Studio 2008 SP1. It isn’t intended to ...Covers Visual Studio 2008 SP1 and .NET 3.5 SPI. Released in 2009.
wpf in action with visual studio 2008 wpf in action with visual studio 2008
this comprehensive guide explains how Visual Studio 2010 offers you a unique look at the beginning of the IDE’s evolution: improved code navigation, annotation and extensibility with the WPF-based ...
VS自带的Blend for visual studio是专门用来做WPF、Metro等的界面设计的可视化工具,其功能和PS类似。其目的让做界面和后台的程序分开,能快速设计图形和样式。 Blend的四大功能介绍和实例 1、绘制形状和路径 2、...
WPF学习的例子 用VS2010编译的 来源WPF揭秘一书
012.Visual Studio 2017 C#WPF弹出进度条.rar