在WF4.0中修改自定义Activity的Icon
"Icon" is a property on the main <sap:ActivityDesigner> element of the designer and it's of type "DrawingBrush".
If you want to set an image (BMP, JPG...) as the Icon, just add this XAML exactly after the starting element of the designer:
代码
<sap:ActivityDesigner.Icon>
<DrawingBrush>
<DrawingBrush.Drawing>
<ImageDrawing>
<ImageDrawing.Rect>
<Rect Location="0,0" Size="16,16" ></Rect>
</ImageDrawing.Rect>
<ImageDrawing.ImageSource>
<BitmapImage UriSource="D:\Public\Foto\IMG_2560.JPG" ></BitmapImage>
</ImageDrawing.ImageSource>
</ImageDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</sap:ActivityDesigner.Icon>
<DrawingBrush>
<DrawingBrush.Drawing>
<ImageDrawing>
<ImageDrawing.Rect>
<Rect Location="0,0" Size="16,16" ></Rect>
</ImageDrawing.Rect>
<ImageDrawing.ImageSource>
<BitmapImage UriSource="D:\Public\Foto\IMG_2560.JPG" ></BitmapImage>
</ImageDrawing.ImageSource>
</ImageDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</sap:ActivityDesigner.Icon>
Obviously, change the UriSource to match your Icon/Bitmap. If you want to apply a WPF DrawingBrush, design the Icon with Expression Designer and copy/paste XAML/ResourceDicrionary and use it.
If you want to set a vectorial drawing, like I do:
代码
<sap:ActivityDesigner.Icon>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Geometry="F1 M 35,-124C 45.2172,-124 53.5,-115.717 53.5,-105.5C 53.5,-95.2827 45.2173,-86.9999 35,-86.9999C 24.7827,-86.9999 16.5,-95.2827 16.5,-105.5C 16.5,-115.717 24.7828,-124 35,-124 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="0.32" LineJoin="Round" Brush="#57008898"/>
</GeometryDrawing.Pen>
<GeometryDrawing.Brush>
<RadialGradientBrush RadiusX="0.5" RadiusY="0.5" Center="0.71625,0.283751" GradientOrigin="0.71625,0.283751">
<RadialGradientBrush.GradientStops>
<GradientStop Color="#57FFFFFF" Offset="0.0104712"/>
<GradientStop Color="#5712C5DB" Offset="0.65445"/>
<GradientStop Color="#5714C5DB" Offset="0.654727"/>
<GradientStop Color="#5717C6DB" Offset="0.905759"/>
<GradientStop Color="#5711A5B7" Offset="1"/>
</RadialGradientBrush.GradientStops>
<RadialGradientBrush.RelativeTransform>
<TransformGroup/>
</RadialGradientBrush.RelativeTransform>
</RadialGradientBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</sap:ActivityDesigner.Icon>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Geometry="F1 M 35,-124C 45.2172,-124 53.5,-115.717 53.5,-105.5C 53.5,-95.2827 45.2173,-86.9999 35,-86.9999C 24.7827,-86.9999 16.5,-95.2827 16.5,-105.5C 16.5,-115.717 24.7828,-124 35,-124 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="0.32" LineJoin="Round" Brush="#57008898"/>
</GeometryDrawing.Pen>
<GeometryDrawing.Brush>
<RadialGradientBrush RadiusX="0.5" RadiusY="0.5" Center="0.71625,0.283751" GradientOrigin="0.71625,0.283751">
<RadialGradientBrush.GradientStops>
<GradientStop Color="#57FFFFFF" Offset="0.0104712"/>
<GradientStop Color="#5712C5DB" Offset="0.65445"/>
<GradientStop Color="#5714C5DB" Offset="0.654727"/>
<GradientStop Color="#5717C6DB" Offset="0.905759"/>
<GradientStop Color="#5711A5B7" Offset="1"/>
</RadialGradientBrush.GradientStops>
<RadialGradientBrush.RelativeTransform>
<TransformGroup/>
</RadialGradientBrush.RelativeTransform>
</RadialGradientBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</sap:ActivityDesigner.Icon>
(全文完)
以下为广告部分
您部署的HTTPS网站安全吗?
如果您想看下您的网站HTTPS部署的是否安全,花1分钟时间来 myssl.com 检测以下吧。让您的HTTPS网站变得更安全!
快速了解HTTPS网站安全情况。
安全评级(A+、A、A-...)、行业合规检测、证书信息查看、证书链信息以及补完、服务器套件信息、证书兼容性检测等。
安装部署SSL证书变得更方便。
SSL证书内容查看、SSL证书格式转换、CSR在线生成、SSL私钥加解密、CAA检测等。
让服务器远离SSL证书漏洞侵扰
TLS ROBOT漏洞检测、心血漏洞检测、FREAK Attack漏洞检测、SSL Poodle漏洞检测、CCS注入漏洞检测。
作者:朱祁林
出处:http://zhuqil.cnblogs.com
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。