代码改变世界

随笔档案-2011年4月29日

WP7备注(26)(StopWatch)

2011-04-29 17:00 by 血糯米Otomii, 310 阅读, 收藏,
摘要: App.xaml.cs using System;using System.Collections.Generic;using System.IO.IsolatedStorage;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Doc... 阅读全文

WP7备注(25)(Jot)

2011-04-29 15:11 by 血糯米Otomii, 238 阅读, 收藏,
摘要: Jot Settings: public List<StrokeCollection> StrokeCollections { get; set; }public int PageNumber { set; get; }public Color Foreground { set; get; }public Color Background { set; get; }public int Strok... 阅读全文

WP7备注(24)(ApplicationBar|MediaElement)

2011-04-29 12:45 by 血糯米Otomii, 392 阅读, 收藏,
摘要: ApplicationBar常规用法: <shell:ApplicationBar IsVisible="False"> <shell:ApplicationBarIconButton IconUri="Images/appbar.transport.pause.rest.png" Text="Pause" IsEnabled="False" Click="OnAppBarPauseClick" ... 阅读全文

WP7备注(23)(Canvas改变Size|ZIndex|Canvas Touch)

2011-04-29 12:43 by 血糯米Otomii, 529 阅读, 收藏,
摘要: 首先,Canvas有四个Attached属性:Left,Top,Right,Buttom,它们的赋值,是在子项生成的时候,以Canvas的SetXxx的形式的方法赋值上去的,所以当Canvas改变大小的时候,也要重新更新这些Attached属性: <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"><Canvas Name="ca... 阅读全文

WP7备注(22)(多类型Panel自定义)

2011-04-29 11:31 by 血糯米Otomii, 241 阅读, 收藏,
摘要: 单Cell的Grid自定义 namespace SingleCellGridDemo{public class SingleCellGrid : Panel{protected override Size MeasureOverride(Size availableSize){Size compositeSize = new Size();foreach (UIElement child in C... 阅读全文

WP7备注(21)(ScrollViewer)

2011-04-29 10:22 by 血糯米Otomii, 392 阅读, 收藏,
摘要: <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"><ScrollViewer HorizontalScrollBarVisibility="Auto"><StackPanel Name="stackPanel" /></ScrollViewer></Grid>当横向数据过长时候,显示滚动条,没有过长,则不显示using Sys... 阅读全文

WP7备注(20)(Visibility|Opacity|IsHitTestVisible)

2011-04-29 10:07 by 血糯米Otomii, 895 阅读, 收藏,
摘要: 当Visibility为Collapsed的时候,该控件会消失在界面上,通过设置控件的Size 为0来实现 <TextBlock Text="Left, Top, ZIndex" Visibility="Collapsed" /> Opacity为设置透明度为0,但是Size依旧,所以留有空位并可以获取焦点,为了让透明度为0的控件无法获取焦点,所以设置IsHitTestVisible="False... 阅读全文