摘要:<ResourceDictionaryxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"><SolidColorBrush x:Key="brush" Color="Blue" /></ResourceDicti... 阅读全文
WP7备注(38)(VisualStateManager)
2011-05-09 13:47 by 血糯米Otomii, 483 阅读, 0 推荐, 收藏, 编辑
摘要:TemplateVisualStateAttribute: [TemplateVisualStateAttribute(Name = "Disabled", GroupName = "CommonStates")][TemplateVisualStateAttribute(Name = "Normal", GroupName = "CommonStates")][TemplateVisualSta... 阅读全文
WP7备注(37)(Template)
2011-05-09 13:28 by 血糯米Otomii, 321 阅读, 0 推荐, 收藏, 编辑
摘要:ContentTemplate: <Button.ContentTemplate><DataTemplate><StackPanel><TextBlock Text="The time is:"TextAlignment="Center" /><StackPanel Orientation="Horizontal"HorizontalAlignment="Center"><TextBlock Te... 阅读全文
WP7备注(36)(动画)
2011-05-09 09:48 by 血糯米Otomii, 379 阅读, 0 推荐, 收藏, 编辑
摘要:使用代码来配置UIElement的Animation: void OnButtonClick(object sender, RoutedEventArgs args){Button btn = sender as Button;RotateTransform rotateTransform = btn.RenderTransform as RotateTransform;// Create and... 阅读全文
WP7备注(35)(Vector Graphics|Raster Graphics)
2011-05-09 09:40 by 血糯米Otomii, 404 阅读, 0 推荐, 收藏, 编辑
摘要:Vector Graphics Pass -------------------------------------------------------------------------------------------------- Raster Graphics: BitmapSource拥有2个字段,1个方法: PixelWidth,PixelHeight SetSource(Strea... 阅读全文
WP7备注(34)(UpdateSourceTrigger|ValidatesOnExceptions|NotifyOnValidationError)
2011-05-03 15:44 by 血糯米Otomii, 506 阅读, 0 推荐, 收藏, 编辑
摘要:UpdateSourceTrigger 枚举 描述绑定源更新的执行时间。 Default 绑定目标属性的默认 UpdateSourceTrigger 值。 多数依赖项属性的默认值为 PropertyChanged,而Text属性的默认值为 LostFocus。 确定依赖项属性的默认UpdateSourceTrigger值的编程方法是使用GetMetadata来获取属性的属性元数据,然后检查Defa... 阅读全文
WP7备注(33)(DataContext)
2011-05-03 14:39 by 血糯米Otomii, 449 阅读, 0 推荐, 收藏, 编辑
摘要:DataContext为所有内部元素提供所需要的数据源 实例1: <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"><StackPanel DataContext="{Binding Source={StaticResource clock}}"Orientation="Horizontal"HorizontalAlignmen... 阅读全文
WP7备注(32)(Relative Source|在自定义控件的属性中为子控件的属性赋值|INotifyPropertyChanged)
2011-05-03 13:31 by 血糯米Otomii, 420 阅读, 0 推荐, 收藏, 编辑
摘要:Relative Source: <TextBlock Text="{Binding RelativeSource={RelativeSource Self}, Path=FontFamily}" /> 在自定义控件的属性中为子控件的属性赋值: public partial class BorderedText : UserControl{public static readonly Depend... 阅读全文
WP7备注(31)(Converter)
2011-05-03 12:23 by 血糯米Otomii, 266 阅读, 0 推荐, 收藏, 编辑
摘要:基本代码: namespace SliderBindings{public class TruncationConverter : IValueConverter{public object Convert(object value, Type targetType,object parameter, CultureInfo culture){if (value is double)return ... 阅读全文
WP7备注(30)(数据绑定基本)
2011-05-03 11:36 by 血糯米Otomii, 312 阅读, 0 推荐, 收藏, 编辑
摘要:基础模式: <TextBlock … Text="{Binding ElementName=slider, Path=Value, Mode=TwoWay}" … /> 树结构元素赋值: Text="{Binding ElementName=ContentPanel, Path=Children[0].Value}" Text="{Binding ElementName=LayoutRoot, P... 阅读全文