kagula 2012-04-12
概要
以源码的形式贴出,免得忘记后,再到网上查资料。在VS2008+SP1环境下调试通过
引用的GrayscaleEffect模块,可根据参考资料《Grayscale Effect...》中的位置下载。
正文
如何布局是在App.xaml中定义源码如下
<Application x:Class="CWebsSynAssistant.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:effect="clr-namespace:GrayscaleEffect;assembly=GrayscaleEffect"
StartupUri="Window1.xaml">
<Application.Resources>
<!-- ListView的布局模板-->
<ControlTemplate x:Key="myLVTemplate" TargetType="{x:Type ListView}">
<Grid>
<ScrollViewer x:Name="ScrollViewerElement"
Background="White"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<ItemsPresenter>
</ItemsPresenter>
</ScrollViewer>
</Grid>
</ControlTemplate>
<!-- ListViewItem的布局模板-->
<DataTemplate x:Key="myLVItemTemplate">
<Grid Name="myGrid" Width="70" Margin="8,8,0,0">
<Grid.RowDefinitions>