图老师设计创意栏目是一个分享最好最实用的教程的社区,我们拥有最用心的各种教程,今天就给大家分享XAML 实例演示之一的教程,热爱PS的朋友们快点看过来吧!
【 tulaoshi.com - Web开发 】
本文配合免费下载的Kaxaml 工具,演示XAML 的一些基本用法。关于Kaxaml 工具的介绍和下载,请参考文章:推荐一款免费下载 XAML 编辑调试工具-Kaxaml。
XAML 系列文章为学习笔记,这是我今年春节期间安排的学习任务。
StackPanel、Menu、Expander 元素的演示
Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="Welcome" Height="300" Width="300"
StackPanel
Name="HelloWorldGrid"
Background="AntiqueWhite"
Menu
Height="21" Margin="0,0,0,0"
MenuItem Header="开源博客平台"
MenuItem Header="ASP.NET" /
MenuItem Header="C#" /
/MenuItem
MenuItem Header="开源论坛系统"
MenuItem Header="Version 1.0" /
MenuItem Header="Version 2.0" /
MenuItem Header="Version 3.0" /
MenuItem Header="Version 3.5" /
/MenuItem
/Menu
Label
Content="Welcome to http://forum.EntLib.com"
FontFamily="Verdana"
FontSize="12" Padding="20"
/
Expander Height="50"
Name="MyExpander"
VerticalAlignment="Bottom"
Content="When you click on an expander it shows its content."
/
/StackPanel
/Window
FlowDocument 元素的演示:
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/webkaifa/)Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="Welcome"
FlowDocument
Paragraph FontSize="28" Foreground="Red"
Introducing XAML: A Declarative Way to Create Windows UIs
/Paragraph
Paragraph
Before the appearance of .NET 3.0, web applications were written with "markup
languages" such as HTML and Windows applications were not. We may have
dragged controls onto forms, but the creation of the controls and their
properties was managed by the development environment, or you instantiated
them programmatically at runtime.
/Paragraph
/FlowDocument
/Window
(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/webkaifa/)
在我们的范例中,DockPanel 用来从左到右布局元素(尽管可以通过设置属性来靠边-left, right, top 和 bottom),然而 StackPanel 用来从上到下堆放元素。
来源:http://www.tulaoshi.com/n/20160219/1619836.html