728x90
728x170
/// <summary>
/// Random Color
/// </summary>
/// <returns></returns>
private Brush RandomBrush()
{
Brush result = Brushes.Transparent;
Random random = new Random();
Type brushesType = typeof(Brushes);
PropertyInfo[] properties = brushesType.GetProperties();
int randomValue = random.Next(properties.Length);
result = (Brush)properties[randomValue].GetValue(null, null);
return result;
}
728x90
그리드형
'C# > WPF' 카테고리의 다른 글
[WPF] Background="{x:Null}" Background="Transparent" 차이 (0) | 2020.11.05 |
---|---|
[WPF] GradientStopCollection 의 Offset 컬러 구하기 (0) | 2020.10.20 |
[WPF] UpdateSourceTrigger (0) | 2020.09.07 |
[WPF] TextBox 에 PlaceHolder 설정하기 (0) | 2020.09.04 |
[WPF] DataContext 의 특정 Command 를 실행하는 코드 (0) | 2020.08.21 |