本文整理汇总了C#中System.Windows.Media.GradientStop.Freeze方法的典型用法代码示例。如果您正苦于以下问题:C# GradientStop.Freeze方法的具体用法?C# GradientStop.Freeze怎么用?C# GradientStop.Freeze使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.GradientStop
的用法示例。
在下文中一共展示了GradientStop.Freeze方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetResourceKeyValues
public override IEnumerable<Tuple<object, object>> GetResourceKeyValues(MyHighlightingColor hlColor) {
var br = new LinearGradientBrush() {
StartPoint = StartPoint,
EndPoint = EndPoint,
};
if (MappingMode != null)
br.MappingMode = MappingMode.Value;
for (int i = 0; i < GradientOffsets.Length; i++) {
var gs = new GradientStop(((SolidColorBrush)hlColor.GetHighlightingBrush(i).GetBrush(null)).Color, GradientOffsets[i]);
gs.Freeze();
br.GradientStops.Add(gs);
}
br.Freeze();
yield return new Tuple<object, object>(ResourceKey, br);
}
示例2: MakeGradientStop
private GradientStop MakeGradientStop(Color color, double offset)
{
var gradStop = new GradientStop(color, offset);
gradStop.Freeze();
return gradStop;
}
示例3: GetResourceKeyValues
public override IEnumerable<Tuple<object, object>> GetResourceKeyValues(ThemeColor hlColor)
{
var br = new LinearGradientBrush() {
StartPoint = StartPoint,
EndPoint = EndPoint,
};
for (int i = 0; i < GradientOffsets.Length; i++) {
var gs = new GradientStop(((SolidColorBrush)hlColor.GetBrushByIndex(i)).Color, GradientOffsets[i]);
gs.Freeze();
br.GradientStops.Add(gs);
}
br.Freeze();
yield return new Tuple<object, object>(ResourceKey, br);
}