string template = @"
<ControlTemplate xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" x:Key=""ClusterSymbol"">
<Grid HorizontalAlignment=""Center"" VerticalAlignment=""Center"">
<Ellipse
Fill=""{Binding Attributes[Color]}""
Width=""{Binding Attributes[Size]}""
Height=""{Binding Attributes[Size]}"" />
<Grid HorizontalAlignment=""Center"" VerticalAlignment=""Center"">
<TextBlock
Text=""{Binding Attributes[Count]}""
FontSize=""19"" Margin=""1,1,0,0"" FontWeight=""Bold""
Foreground=""#99000000"" />
<TextBlock
Text=""{Binding Attributes[Count]}""
FontSize=""19"" Margin=""0,0,1,1"" FontWeight=""Bold""
Foreground=""White"" />
</Grid>
</Grid>
</ControlTemplate>";
this.ControlTemplate = System.Windows.Markup.XamlReader.Load(template) as ControlTemplate;
从字段串创建 Silverlight 对象
最新推荐文章于 2024-06-16 08:00:00 发布