完整代码下载地址1:
http://aqqcms.codeplex.com/releases/view/53184
完整代码下载地址2:
随笔思路:
1CMS粗略介绍
@1本来昨晚就弄好了的。今天又改了一天,加入了我去年写的一个CMS做后台管理和与数据库交互。
这一下整个东西在功能上就略显完整了。
那个CMS是基于ASP.NET 的Web Form 和ACCESS 数据库的环保型经典三层网站。(感谢LTP)
特别应对小门户和个人展示型的。跟我现在这个一样麻雀型的。
@2已经开源在 http://aqqcms.codeplex.com 需要的去下载各更新版本。。。
或者在线查看其源码。
@3平心而论:这只是一个把一些知识集成的小应用,没有太大的技术含量和思想。
更多的是给初学者一个走通一个CMS的流程的一个源码级别的帮助。
2具体介绍
下面来看一下解决方案:
@1其中数据交互技术有2种
#1 RIA SERVICE
数据库SQL2005 =>AEF=>RIASERVICE 交互。
#2 DATA SERVICE
ACCESS =>ADO.NET =>BLL层=》DATA SERVICE
@2
RIAServiceLib 这个解决方案 是使用了 其分离类库的技术。
RIAServiceLib 类库的代码在两个项目中都存在。
这样使其结构更清晰明了。也增加了可移植性。
具体做法见文档。。。。。
(我发现自己好懒。。。
PS:最近园子里Silverlight版块多了好多截图文。。我深感惭愧,但也觉得这些不太难就不
自我装傻了。。。已开源)
@3他的技术含量
#1 首页导航框架。
##1 使用 URIMAP集 让URL 友好。
##2 导航跳转示例
#2列表页 ListBox 自定义呈现
##1几种用XAML做效果的东东
##2分页排序等。
#3内容页
使用控件呈现 HTML。参考感谢:在Silverlight中嵌入HTML、Flash和PDF文件。
#4交互技术
3一个ListBox的效果实例
右边那种排法还不错,我把整个XAML贴出来。
< navigation:Page x:Class ="SLCMS.Views.CMS.Channel"
xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d ="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc ="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable ="d"
Style =" {StaticResource PageStyle} "
xmlns:sdk ="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:toolkit ="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
xmlns:navigation ="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
d:DesignWidth ="640"
d:DesignHeight ="480"
Title ="Channel Page" >
< Grid x:Name ="LayoutRoot" >
< ScrollViewer x:Name ="PageScrollViewer"
Style =" {StaticResource PageScrollViewerStyle} " >
< Grid x:Name ="ContentStackPanel" >
< Grid.ColumnDefinitions >
< ColumnDefinition Width ="498*" />
< ColumnDefinition Width ="115*" />
</ Grid.ColumnDefinitions >
< Grid.RowDefinitions >
< RowDefinition Height ="429*" />
< RowDefinition Height ="13*" />
< RowDefinition Height ="0*" />
</ Grid.RowDefinitions >
<!-- 图片列表 -->
< ListBox Height ="270"
HorizontalAlignment ="Left"
Margin ="88,69,0,0"
Name ="listBox1"
VerticalAlignment ="Top"
ItemsSource =" {Binding} "
Width ="252"
Grid.Column ="1" >
< ListBox.Style >
< Style TargetType ="ListBox" >
< Setter Property ="ScrollViewer.HorizontalScrollBarVisibility"
Value ="Disabled" />
</ Style >
</ ListBox.Style >
< ListBox.ItemsPanel >
< ItemsPanelTemplate >
< toolkit:WrapPanel HorizontalAlignment ="Left"
VerticalAlignment ="Top" ></ toolkit:WrapPanel >
</ ItemsPanelTemplate >
</ ListBox.ItemsPanel >
< ListBox.ItemTemplate >
< DataTemplate >
< Grid x:Name ="LBIT"
Width ="50" >
< Image Grid.Row ="1"
HorizontalAlignment ="Left"
Name ="image1"
Stretch ="Fill"
VerticalAlignment ="Top"
Source =" {Binding Path=_id, Converter={StaticResource NumToImg}} " />
</ Grid >
</ DataTemplate >
</ ListBox.ItemTemplate >
</ ListBox >
<!-- 分页控件 -->
< sdk:DataPager Height ="26"
HorizontalAlignment ="Left"
Margin ="298,0,0,0"
Name ="dataPager1"
PageSize ="10"
VerticalAlignment ="Top"
Width ="200"
Grid.Row ="1" />
<!-- 文章列表 -->
< ListBox Height ="550"
HorizontalAlignment ="Left"
Margin ="7,9,0,0"
Name ="listBox2"
VerticalAlignment ="Top"
Width ="491" >
< ListBox.Style >
< Style TargetType ="ListBox" >
< Setter Property ="BorderThickness"
Value ="0" />
</ Style >
</ ListBox.Style >
< ListBox.ItemTemplate >
< DataTemplate >
< Grid x:Name ="LBIT"
Height ="80"
Width ="400" >
< Grid.RowDefinitions >
< RowDefinition Height ="46*" />
< RowDefinition Height ="104*" />
</ Grid.RowDefinitions >
< Grid.ColumnDefinitions >
< ColumnDefinition Width ="0*" />
< ColumnDefinition Width ="0*" />
< ColumnDefinition Width ="104*" />
< ColumnDefinition Width ="339*" />
</ Grid.ColumnDefinitions >
< Image Grid.Column ="2"
Height ="61"
HorizontalAlignment ="Left"
Margin ="12,12,0,0"
Name ="image1"
Stretch ="None"
VerticalAlignment ="Top"
Width ="59"
Source =" {Binding Path=_id, Converter={StaticResource NumToImg}} "
Grid.RowSpan ="2" />
< HyperlinkButton Grid.Column ="3"
Height ="26"
HorizontalAlignment ="Left"
Margin ="33,6,0,0"
Name ="textBlock1"
Content =" {Binding Path=_title} "
VerticalAlignment ="Top"
Width ="178"
Tag =" {Binding Path=_id} "
Click ="Link2Article" />
< TextBlock Grid.Column ="3"
Grid.Row ="1"
Height ="40"
HorizontalAlignment ="Left"
Margin ="16,8,0,0"
Name ="textBlock2"
Text ="Content"
VerticalAlignment ="Top"
Width ="237" />
< TextBlock Grid.Column ="3"
Grid.Row ="1"
Height ="23"
HorizontalAlignment ="Left"
Margin ="143,54,0,0"
Name ="textBlock3"
Text =" {Binding Path=_adddate, StringFormat=/{0:d/}} "
VerticalAlignment ="Top"
Width ="148" />
</ Grid >
</ DataTemplate >
</ ListBox.ItemTemplate >
</ ListBox >
</ Grid >
</ ScrollViewer >
</ Grid >
</ navigation:Page >
=============================================
4 一些RIA Service 效果实例
见源码。
=============================================
5 Silverlight CMS 的样子
@1 导航的首页。
@2列表页
@3内容显示页
=============================================
6下一步?
如果有时间的话把粗糙的地方做好去,增加一些必备功能。美工(...纠结...)
有兴趣的可以一起。
- CMS粗略介绍
- CMS具体说明
- 一个ListBox的效果实例
- 一些RIA Service 实例
- 那个SL CMS 的效果。
- 下一步