
1、.aspx .Jsp .PHP .asp (类型vb) .cgi(通用网关)
2、Ppc Wndows Mobile(微软) WinCe
3、
a) windows 2003/2008/2000Server 服务器 *** 作系统
b) Win98/win2000 专业版/winxp/win7 个人 *** 作系统
c) Wince 嵌入式开发 汽车导航仪(Wince)
4) JBuilder Delphi(聪明的程序员用delphi) PowerBuilder( DataWindow)
5) 各个运营商的3G业务:
a) 联通和移动:2g GSM
b) 移动:自主研发 tds-cdma
c) 联通3g:WCDMA
d) 电信:CDMX 2X
6)OA中 工作流(公文流)主要在定义流程 WorkFlow
请假:申请人提出申请->指定代理人->主官审批->(可选,如果请假天数>=3天)更高一阶主官审批->人资审批
电脑维修单:需要修电脑的人提出申请(部门A)-》A主官->修电脑的部门主官B部门->指定一个成员处理该单据->(通知该人员)该人员上门处理,维修电脑,修好后->提出人(验收)-》A部门主官
7)内网,我去外地出差了。 有一种技术 vpn,可以让你拔入你的企业内部网中。
8)cpu架构: X86 (32位) X64(64位) ARM(功能比较强大的单片机cpu) c51(单片机)
9)XAML是eXtensible Application Markup Language的英文缩写,相应的中文名称为可扩展应用程序标记语言XAML的发音为"Zamel"(有些人读做"zammel"),
10)Asp.net 与asp:把用户界面与程序开发逻辑进行分离
11)xaml是微软新一代的UI层技术 在wpf/sliverlight中,把Ui和程序逻辑分离。设计人员,可以用xaml设计UI,开发人设,在后台文件中写c#代码
12)Vs一般是程序员用的,主要写程序。
13)Blend是设计人员用的,主要写界面。用xaml
14)Silverlight创建后,有一个app.xaml/cs 相当于一个全局文件或程序的入口点(Program.cs)
15)MainPage.xaml 是创建项目后,默认给我们创建的一个页面
16)
Silverlight程序一但启动,会生成一个App的实现,并在Application_Startup中设置 this.RootVisual 来设置显示的主界面。
17)四种设置xaml属性的方法。
A)简单语法: Foreground="Red"
B)属性元素语法
在对象间对过 <对象.属性></对象.属性>来设置
<button Height="30" HorizontalAlignment="left" margin="130,41,0" name="button1" VerticalAlignment="top" WIDth="75" Click="button1_Click">
<button.Content>
<TextBox Text="在按钮中的文本框" Foreground="Green"></TextBox>
</button.Content>
</button>
C)内容元素语法
<button Height="23" HorizontalAlignment="left" margin="108,222,0" name="button2" VerticalAlignment="top" WIDth="75" >aaa</button>
D)隐式元素语法 就是可以省略某个节点属性
控件常用的属性:
margin
Height
WIDth
HorizontalAlignment
VerticalAlignment
TextBlock控件:
Text显示的文本
FontSize
FontFamily
Foreground
<lineBreak>换行
<Run>可以设置这个对象的字体字号等属性来改变一个TextBlock中的部本文本
CheckBox 属性:
IsChecked 是一个可空的bool类型
Radiobutton:
Groupname:同一组的Radiobutton只能选一个
把一个图片copy到silverlight项目中,记住把这个图片的生成属性,改成Resource
Image控件:
Source
Stretch fill填充满控件 none原始大小 UniForm等比例缩放(以小边) UniformToFill等比缩放(以大边为准)
Rectangle控件:
Fill填充色
border对象:
borderBrush 边框颜色
borderThickness 宽度
MediaElement播放视频或音乐:
Autoplay 是否自动播放
Source 视频源 可以指定项目中的,也可以指定网上的 http 但一定要注意格式是否支持
position 播放的位置
dispatcherTimer类:定时器和Winform中的Timer一样,属性事件也类似
Interval 触发时间
Tick事件
三个布局控件都是“容器”控件。
1)GrID三个布局控件最灵活的,和HTML中的table差不多。
2)定义列
<GrID.ColumnDeFinitions><!--要开始定义列-->
<ColumnDeFinition WIDth="150"></ColumnDeFinition>
<ColumnDeFinition></ColumnDeFinition>
</GrID.ColumnDeFinitions>
3)
<TextBlock Text="姓名" name="tbname" GrID.Row="0" GrID.Column="0" ></TextBlock>
通过 GrID.Row="0" GrID.Column="0"两个附加属性,来设置该控件在GrID容器中的位置
<button GrID.Row="4" Content="提交" Height="30" WIDth="100" GrID.ColumnSpan="2" HorizontalAlignment="left" margin="150,0" ></button>
通过GrID.ColumnSpan和GrID.rowspan可以设置控件是否跨行或跨列
StackPanel是把子控件横向或者纵向排列。用OrIEntation属性设定排列方向:Horizontal(水平)、Vertical(纵向,默认值)
<StackPanel>
<TextBox Height="23" WIDth="120" />
<TextBox Height="23" WIDth="120" />
<TextBox Height="23" WIDth="120" />
</StackPanel>
Canvas布局控件用于控件子控件的到窗口的左边和上边的距离。
<Canvas>
<button name="btnTest" WIDth="150" Height="30" Content="点我!" Canvas.left="0" Canvas.top="0" Click="button_Click"></button>
</Canvas>
通过Canvas.left="0" Canvas.top="0" 两个附加属性来设置位置
//注册,当在代码中要获得或设置一个控件的附加属性时,要用该实例的GetValue方法和SetValue方法。
double left =(double) btnTest.GetValue(Canvas.leftProperty);
double top = (double)btnTest.GetValue(Canvas.topProperty);
//btnTest.Content = "大爷,你来了!";
btnTest.SetValue(Canvas.leftProperty, left+10);
btnTest.SetValue(Canvas.topProperty, top+10);
对于这两个容器控件,如果通过代码来设置或获取其中的子控件呢?
通过Children属性,这是容器子控件的集合。
4种样式方式:
1)内联样式
<button Foreground="Red" FontSize="20"
2)页面样式:控制本页面上所有某类型所有控件的样式
<UserControl.Resources>
<Style targettype="button"> <!--可以通x:Key来给这个样式取个名字,如果没有x:Key,则这个样式应用于页面上该类型的所有控件-->
<Setter Property="Foreground" Value="Green"></Setter>
<Setter Property="FontSize" Value="16"></Setter>
<Setter Property="Opacity" Value="0.8"></Setter>
</Style>
</UserControl.Resources>
如果Sylte指定了x:key,在想应用该样式的控件中通过Style="{StaticResource x:key名称}属性设置:
<button Height="82" HorizontalAlignment="left" margin="94,162,0" name="button3" VerticalAlignment="top" WIDth="208" Style="{StaticResource buttonBlueStyle}" />
3)全局样式
要写在app.xaml文件中
<Application.Resources>
<Style targettype="TextBlock" x:Key="myappstayle">
<!--x:key如果省略,此样式用于所有页面,如果不省略,控件需要Style="{StaticResource myappstayle}"来指定-->
<Setter Property="Foreground" Value="Red"></Setter>
<Setter Property="FontSize" Value="16"></Setter>
</Style>
</Application.Resources>
4)外部样式。注意,如果页面中为button定义了一个无x:key样式,那么ResourceDictionary
节点必须有一个x:key>
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style targettype="button" x:Key="rb1">
<Setter Property="Foreground" Value="Red"></Setter>
</Style>
</ResourceDictionary>
引用外部样式文件的语法:
<ResourceDictionary x:Key="myDict">
<ResourceDictionary.MergedDictionarIEs>
<ResourceDictionary Source="Dictionary1.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionarIEs>
</ResourceDictionary>
画刷即Brush.在.net Brush是一个抽象类,那某一个属性是Brush,只能对他赋Brush的子类。那么常用的Brush子类有5种。
5种画刷:
1)实心颜色画刷 SolIDcolorBrush
在xaml中这样写:Foreground="Red" 程序会把Red默认转换成SolIDcolorBrush
<Rectangle name="myRect" WIDth="100" Height="100" margin="61,139,239,61" >
<Rectangle.Fill>
<SolIDcolorBrush>#ff0000</SolIDcolorBrush>
</Rectangle.Fill>
</Rectangle>
下面是常用的省略写法:
<Rectangle Fill="Yellow" WIDth="100" Height="100" margin="255,101,45,99"></Rectangle>
2)线性淅变画刷 linearGradIEntBrush
linearGradIEntBrush
属性:
StartPoint起始点位置 0-1
EndPoint结束点的位置 0-1
GradIEntStop 渐变点:
属性: Offset 偏移位置
color 颜色
<Rectangle WIDth="100" Height="100" margin="12,24,288,176">
<Rectangle.Fill>
<linearGradIEntBrush StartPoint="0,0.5" EndPoint="1,0.5"><!--设置一个从左到右的淅变-->
<GradIEntStopCollection><!--这个节点可以省略-->
<GradIEntStop Offset="0" color="Red"></GradIEntStop>
<GradIEntStop Offset="1" color="Yellow"></GradIEntStop>
<GradIEntStop Offset="0.5" color="Green"></GradIEntStop>
<GradIEntStop Offset="0.3" color="Black"></GradIEntStop>
</GradIEntStopCollection>
</linearGradIEntBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle WIDth="100" Height="100" margin="131,169,176">
<Rectangle.Fill>
<linearGradIEntBrush StartPoint="0.5,0" EndPoint="0.5,1">
<!--设置一个从上到下的淅变-->
<GradIEntStopCollection>
<!--这个节点可以省略-->
<GradIEntStop Offset="0" color="Red"></GradIEntStop>
<GradIEntStop Offset="1" color="Yellow"></GradIEntStop>
<GradIEntStop Offset="0.5" color="Green"></GradIEntStop>
<GradIEntStop Offset="0.3" color="Black"></GradIEntStop>
</GradIEntStopCollection>
</linearGradIEntBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle WIDth="100" Height="100" margin="257,43,176">
<Rectangle.Fill>
<linearGradIEntBrush >
<!--设置一个从上到下的淅变-->
<GradIEntStopCollection>
<!--这个节点可以省略-->
<GradIEntStop Offset="0" color="Red"></GradIEntStop>
<GradIEntStop Offset="1" color="Yellow"></GradIEntStop>
<GradIEntStop Offset="0.5" color="Green"></GradIEntStop>
<GradIEntStop Offset="0.3" color="Black"></GradIEntStop>
</GradIEntStopCollection>
</linearGradIEntBrush>
</Rectangle.Fill>
</Rectangle>
<TextBlock FontSize="100" Height="127" FontFamily="Arial Black" HorizontalAlignment="left" margin="12,153,0" name="textBlock1" Text="Text" VerticalAlignment="top" >
<TextBlock.Foreground>
<linearGradIEntBrush>
<GradIEntStop Offset="0" color="Yellow"></GradIEntStop>
<GradIEntStop Offset="0.3" color="Green"></GradIEntStop>
<GradIEntStop Offset="0.5" color="Black"></GradIEntStop>
<GradIEntStop Offset="1" color="Yellow"></GradIEntStop>
</linearGradIEntBrush>
</TextBlock.Foreground>
</TextBlock>
3)径向渐变RadialGradIEntBrush
RadialGradIEntBrush
属性:GradIEntOrigin 指示渐变开始的地方
<Rectangle WIDth="100" Height="100" margin="12,0" VerticalAlignment="top">
<Rectangle.Fill>
<RadialGradIEntBrush>
<GradIEntStop Offset="0" color="Red"></GradIEntStop>
<GradIEntStop Offset="0.3" color="Orange"></GradIEntStop>
<GradIEntStop Offset="0.5" color="Blue"></GradIEntStop>
<GradIEntStop Offset="0.8" color="Orange"></GradIEntStop>
<GradIEntStop Offset="1" color="Green"></GradIEntStop>
</RadialGradIEntBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle WIDth="100" Height="100" margin="143,157,0" VerticalAlignment="top">
<Rectangle.Fill>
<RadialGradIEntBrush GradIEntOrigin="0,0">
<GradIEntStop Offset="0" color="Red"></GradIEntStop>
<GradIEntStop Offset="0.3" color="Orange"></GradIEntStop>
<GradIEntStop Offset="0.5" color="Blue"></GradIEntStop>
<GradIEntStop Offset="0.8" color="Orange"></GradIEntStop>
<GradIEntStop Offset="1" color="Green"></GradIEntStop>
</RadialGradIEntBrush>
</Rectangle.Fill>
</Rectangle>
<Ellipse WIDth="100" Height="100" margin="276,12,188">
<Ellipse.Fill>
<RadialGradIEntBrush GradIEntOrigin="0.5,0">
<GradIEntStop Offset="0" color="Red"></GradIEntStop>
<GradIEntStop Offset="0.3" color="Orange"></GradIEntStop>
<GradIEntStop Offset="0.5" color="Blue"></GradIEntStop>
<GradIEntStop Offset="0.8" color="Orange"></GradIEntStop>
<GradIEntStop Offset="1" color="Green"></GradIEntStop>
</RadialGradIEntBrush>
</Ellipse.Fill>
</Ellipse>
<TextBox FontSize="45" FontFamily="Arial Black" Height="60" HorizontalAlignment="left" margin="22,228,0" name="textBox1" VerticalAlignment="top" WIDth="323" >
<TextBox.Foreground>
<RadialGradIEntBrush>
<GradIEntStop Offset="0" color="Yellow"></GradIEntStop>
<GradIEntStop Offset="0.3" color="Green"></GradIEntStop>
<GradIEntStop Offset="0.5" color="Black"></GradIEntStop>
<GradIEntStop Offset="1" color="Yellow"></GradIEntStop>
</RadialGradIEntBrush>
</TextBox.Foreground>
<TextBox.Background>
<RadialGradIEntBrush GradIEntOrigin="1,1">
<GradIEntStop Offset="0" color="Aqua"></GradIEntStop>
<GradIEntStop Offset="1" color="brown"></GradIEntStop>
</RadialGradIEntBrush>
</TextBox.Background>
</TextBox>
4)图片画刷 ImageBrush
<Rectangle WIDth="100" Height="100" margin="12,160">
<Rectangle.Fill>
<ImageBrush ImageSource="girl4.jpg"></ImageBrush>
</Rectangle.Fill>
</Rectangle>
<TextBox margin="0,118,54" Height="100" FontSize="64">
<TextBox.Background>
<ImageBrush ImageSource="girl5.jpg" Stretch="UniformToFill"></ImageBrush>
</TextBox.Background>
</TextBox>
<TextBlock Height="100" FontSize="65" FontFamily="Arial Black" HorizontalAlignment="left" margin="12,329,0" name="textBlock1" Text="TextBlock" VerticalAlignment="top" WIDth="367" >
<TextBlock.Foreground>
<ImageBrush ImageSource="girl6.jpg"></ImageBrush>
</TextBlock.Foreground>
</TextBlock>
第5种 视频画刷 VIDeoBrush
在使用视频画刷时,页面上必须先有一个MediaElement控件来播放视频,如果这个控件的视频不想让用户看到,则可以设置Visibility="Collapsed".
在 <VIDeoBrush Sourcename="指定上面的MediaElement控件的名称">
<TextBox WIDth="200" Height="50" FontSize="36" Text="Hello world" margin="12,21,188,229" Foreground="Red">
<TextBox.Background>
<VIDeoBrush Sourcename="meVIDeo" ></VIDeoBrush>
</TextBox.Background>
</TextBox>
<TextBlock FontFamily="Arial Black" FontSize="64" Height="95" HorizontalAlignment="left" margin="23,136,0" Text="魑魅魍魉Hel" VerticalAlignment="top" WIDth="365" >
<TextBlock.Foreground>
<VIDeoBrush Sourcename="meVIDeo"></VIDeoBrush>
</TextBlock.Foreground>
</TextBlock>
控件都有一个属性:OpacityMask 可以用它来实现淅隐效果
控件支持两种效果(Effect)
设置控件的Effect属性:
第一种:模糊
Radius:模糊程度,0为不模糊
<button Content="button" Height="23" HorizontalAlignment="left" margin="36,83,0" name="button1" VerticalAlignment="top" WIDth="75" >
<button.Effect>
<BlurEffect Radius="5"></BlurEffect>
</button.Effect>
</button>
第二种:投影效果
属性:
color:阴影颜色
Direction:投影位置
ShadowDepth:投影与控件的距离
BlurRadius:投影的模糊程度
<DropShadowEffect color="Black" Direction="320" ShadowDepth="20"
BlurRadius="11" Opacity="0.5" />
6种变换:
1)旋转
属性:
CenterX 中心点X轴坐标
CenterY 中心点Y轴坐标
Angle 旋转角度 正数表示顺时针旋转,负数表示逆时针旋转
<button Content="button" Height="24" HorizontalAlignment="left" margin="153,155,0" name="button1" VerticalAlignment="top" WIDth="80" >
<button.Rendertransform>
<Rotatetransform Angle="90" CenterX="40" CenterY="12" x:name="myRotatetransform"></Rotatetransform>
</button.Rendertransform>
</button>
2)缩放
Scaletransform
ScaleX:x轴方向放大倍数,1为原始大小,负数反方向放大
ScaleY:y轴(同上)
CenterX 缩放时的中心点坐标
CenterY
<button Content="button" Height="24" HorizontalAlignment="left" margin="131,97,0" name="button1" VerticalAlignment="top" WIDth="80" >
<button.Rendertransform>
<Scaletransform ScaleX="1" ScaleY="2" CenterX="40" CenterY="12" ></Scaletransform>
</button.Rendertransform>
</button>
3)倾斜变换
Skewtransform
AngleX x轴方向的倾斜角度(-360-360之间)
AngleY
CenterX
CenterY中心点
<TextBlock Height="50" HorizontalAlignment="left" WIDth="240" TextAlignment="Center" FontSize="32" FontFamily="Arial Black" margin="82,34,0" name="textBlock1" Text="苏坤蒋坤杨中科" VerticalAlignment="top" >
<TextBlock.Rendertransform >
<Skewtransform AngleX="0" AngleY="0" x:name="mySkew" CenterX="120" CenterY="25"></Skewtransform>
</TextBlock.Rendertransform>
</TextBlock>
4)平移变换
<Image.Rendertransform>
<Translatetransform X="30" Y="50"></Translatetransform>
</Image.Rendertransform>
X、Y表示平移的变化量。因为不推荐使用Canvas布局,所以如果动态控制元素位置、大小一般使用Scaletransform 、 Translatetransform ,不推荐修改元素的Height、WIDth和坐标。
5)复合变换transformGroup
<Image.Rendertransform>
<transformGroup>
<Rotatetransform Angle="30"></Rotatetransform>
<Scaletransform ScaleX="2"></Scaletransform>
</transformGroup>
</Image.Rendertransform>
6)3D投射(不是变换)
<Image.Projection>
<PlaneProjection RotationX="20"></PlaneProjection>
</Image.Projection>
故事板(Storyboard):用于实现动画效果
Storyboard可写在控件的Resource属性中。
给Storyboard一个x:name 为了在后台可以控件这个对象,通过调用Begin方法使故事板开始动画。
DoubleAnimation动画:用于使某一个可以自动转换成double类型的属性进行变化的一种动画对象。
Storyboard.Targetname:指定要改变哪个对象的属性,对象的name属性
Storyboard.TargetProperty:要改变上面设置对象的某个属性
From To 上面对象的某个属性由From的值变为To的值
Duration 变化时间
RepeatBehavior 重复变换的次数 3x表示重复播放3次 Forever表示一直播放下去
autoReverse 表示是否按相反的方向进行播放。例:From 0 to 30,播放完后,再放一次From 30 To 0
<UserControl.Resources>
<Storyboard x:name="sb">
<DoubleAnimation Storyboard.Targetname="myRotate" Storyboard.TargetProperty="Angle" From="0" To="360"
Duration="00:00:02" RepeatBehavior="Forever" autoReverse="True"></DoubleAnimation>
</Storyboard>
</UserControl.Resources>
colorAnimation
colorAnimation是用来实现color属性的颜色从一个颜色变化到另一个颜色的动画
<Storyboard x:name="sbFlash">
<colorAnimation From="White" To="Red" Storyboard.Targetname="e1Brush" Storyboard.TargetProperty="color"></colorAnimation>
</Storyboard>
ContentPresenter 专门用于显示Content属性
数据绑定:用的是System.Data.Binding类
代码绑定:下面的代码把slIDer1的Value属性绑定到了textBox1的Text属性上
数据源:slIDer 被绑定的控件:textBox1
Binding bind = new Binding("Value");
bind.Mode = BindingMode.TwoWay; //OneTime表示只赋一次值 OneWay:单向绑定,数据源的数据赋给被绑定的控件 TwoWay:双向绑定
bind.source = slIDer1;
textBox1.SetBinding(TextBox.TextProperty, bind);
代码绑定:
<GrID x:name="LayoutRoot" Background="White">
<SlIDer Height="23" HorizontalAlignment="left" margin="84,0" name="slIDer1" VerticalAlignment="top" WIDth="214" />
<TextBox Height="23" HorizontalAlignment="left" margin="124,79,0" name="textBox1" VerticalAlignment="top" WIDth="120"
DataContext="{Binding Elementname=slIDer1}" Text="{Binding Value,Mode=TwoWay}" />
</GrID>
定义一个可依赖的属性,在进行单向或双向绑定时,这个属性发生改变后,会通知对象重绑定这个属性
//定义一个可以改变值后通知绑定的对象值已改变的属性需要下面几步
//第一步,类必须继承自DependencyObject
//第二步,注册一个由Readonly修饰的DependencyProperty类型的静态字段,字段的名称一般要求为属性名+Property
public static Readonly DependencyProperty nameProperty =
DependencyProperty.Register("name", typeof(string), typeof(Person), null);//第一个参数:属性名,
//第二个参数 属性的类型 第三个参数:属性所在类的类型 第四个: null
//第三步,定义用户使用属性
public string name
{
get
{
return (string)GetValue(nameProperty);
}
set
{
SetValue(nameProperty, value);
}
}
当绑定两个控件属性时,这两个属性的类型不相同,那么就需要我们写一个Converter才能绑定,这个Converter是来完成两个不同类型间转换的。
1) 创建一个类,并继承自IValueConverter这个接口。
2) 实现接口的方法:Converter用于把数据源的类型转换成 绑定控件的类型
3) ConvertBack 相2)相反
在xaml实例化一个我们的类:
1)引用我们项目的命名空间 xmlns:local="clr-namespace:_02DemoBinding"
2)在资源中声明我们的类的实例
<UserControl.Resources>
<local:BoolToVisibilityConverter x:Key="myConverter"></local:BoolToVisibilityConverter>
</UserControl.Resources>
在绑定时指定转换器的实例:
<Image Height="146" HorizontalAlignment="left" Source="girl1.jpg" margin="124,27,0" name="image1" Stretch="Fill" VerticalAlignment="top" WIDth="139" DataContext="{Binding Elementname=checkBox1}" Visibility="{Binding IsChecked,Converter={StaticResource myConverter}}" />
总结以上是内存溢出为你收集整理的silverlight笔记全部内容,希望文章能够帮你解决silverlight笔记所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)