24 lines
1019 B
C#
24 lines
1019 B
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Media;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace BeWo.View
|
|
{
|
|
public class DeleteButton : Button
|
|
{
|
|
private readonly Canvas _Canvas;
|
|
|
|
public DeleteButton()
|
|
{
|
|
this.IsEnabledChanged += (s, e) => this._Canvas.Opacity = this.IsEnabled ? 1d : 0.2d;
|
|
|
|
this._Canvas = new Canvas { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch };
|
|
this._Canvas.Children.Add(new Path { Stroke = Brushes.White, StrokeThickness = 1.5d, StrokeStartLineCap = PenLineCap.Round, StrokeEndLineCap = PenLineCap.Round, Data = Geometry.Parse("M -3,-3 L 3, 3") });
|
|
|
|
this._Canvas.Children.Add(new Path { Stroke = Brushes.White, StrokeThickness = 1.5d, StrokeStartLineCap = PenLineCap.Round, StrokeEndLineCap = PenLineCap.Round, Data = Geometry.Parse("M 3,-3 L -3, 3") });
|
|
|
|
this.Content = this._Canvas;
|
|
}
|
|
}
|
|
} |