随笔分类 -  XAML

准备些一系列的文章来使自己熟悉这个东西,主要是从网上看到的代码的个人实践。争取至少每天一篇。
Frame 控件
摘要:WPF中有个很好的机制,就是Frame,Frame不仅可以像网页中的Frame一样加载Wpf的page对象,还可以加载WEB,使用方法:frame1.Source = new Uri("http://localhost:2613/Default.aspx");当然也可以用Navigate方法设置Source的Uri,还可以通过设置Content,但是稍微麻烦一点,因为需要创建一个WebBrowser对象作为Content在MainWindows.xaml中引用Fram控件 <Frame x:Name="frame1" Margin="0, 阅读全文
posted @ 2013-03-05 11:58 振宇爸爸 阅读(367) 评论(0) 推荐(0) 编辑
Canvas 控件
摘要:Canvas为容器控件,用于定位,在此容器下面的控件,都可以采用绝对定位的方式来进行定位。<Canvas> <Rectangle Canvas.ZIndex="3" Width="100" Height="100" Canvas.Top="100" Canvas.Left="100" Fill="blue"/> <Rectangle Canvas.ZIndex="1" Width="100" Height= 阅读全文
posted @ 2013-03-05 11:44 振宇爸爸 阅读(378) 评论(0) 推荐(0) 编辑
Expander 控件
摘要:Expander是一个可以展开和折叠的控件,它包含两部分——标头和内容。标头通Header属性来设置,内容通过Conent属性设置,如下面一个简单的例子: <StackPanel Margin="20,20" Width="100" Height="460" HorizontalAlignment="Left" VerticalAlignment="Top"> <Expander VerticalAlignment="Stretch" ExpandDirec 阅读全文
posted @ 2013-03-05 11:40 振宇爸爸 阅读(590) 评论(0) 推荐(0) 编辑
Popup 控件
摘要:Popup:在一个单独的窗口中显示内容,该窗口浮动在当前应用程序窗口之上。<Window x:Class="MaterialStorage.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width=" 阅读全文
posted @ 2013-02-28 17:44 振宇爸爸 阅读(177) 评论(0) 推荐(0) 编辑
Menu 菜单栏
摘要:XAML中的菜单栏不再像WINFORM一样有一个专用的控件来实现它,我们通过DockPanel来实现这样的一个功能。<Window x:Class="MaterialStorage.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="3 阅读全文
posted @ 2013-02-28 17:36 振宇爸爸 阅读(188) 评论(0) 推荐(0) 编辑
Slider 控件
摘要:Slider:表示一种控件,该控件使用户可以通过沿着一条轨道移动Thumb控件来从一个值范围中进行选择。(官方文档上面写的很难懂,其实就是一个可以用鼠标拖拉来改变值的条)<Window x:Class="MaterialStorage.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Main 阅读全文
posted @ 2013-02-28 17:20 振宇爸爸 阅读(337) 评论(0) 推荐(0) 编辑
Border 控件
摘要:Border:在另一个对象的周围绘制边框、背景或同时绘制二者。<Window x:Class="MaterialStorage.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525&qu 阅读全文
posted @ 2013-02-28 17:07 振宇爸爸 阅读(201) 评论(0) 推荐(0) 编辑
Grid 网格布局控件
摘要:Grid定义一个内容修饰器,该修饰器可拉伸和缩放单个子元素以填满可用空间。为什么先介绍这个控件呢,因为在程序中少不了对界面进行排版,所以我们先介绍这个控件。<Window x:Class="MaterialStorage.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow& 阅读全文
posted @ 2013-02-28 16:49 振宇爸爸 阅读(224) 评论(0) 推荐(0) 编辑
自定义样式
摘要:在app.xaml中定义 <Style x:Key="Big" TargetType="TextBlock"> <Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}"/> <Setter Property="FontSize" Value="36"/> <Setter Property="FontFamily 阅读全文
posted @ 2012-11-26 14:01 振宇爸爸 编辑

点击右上角即可分享
微信分享提示