1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Tango.FSE.Common.Controls
{
public class ToggleIconButton : ToggleButton
{
public PackIconKind CheckedIcon
{
get { return (PackIconKind)GetValue(CheckedIconProperty); }
set { SetValue(CheckedIconProperty, value); }
}
public static readonly DependencyProperty CheckedIconProperty =
DependencyProperty.Register("CheckedIcon", typeof(PackIconKind), typeof(ToggleIconButton), new PropertyMetadata(PackIconKind.Circle));
public PackIconKind UncheckedIcon
{
get { return (PackIconKind)GetValue(UncheckedIconProperty); }
set { SetValue(UncheckedIconProperty, value); }
}
public static readonly DependencyProperty UncheckedIconProperty =
DependencyProperty.Register("UncheckedIcon", typeof(PackIconKind), typeof(ToggleIconButton), new PropertyMetadata(PackIconKind.CircleOutline));
public Brush CheckedForeground
{
get { return (Brush)GetValue(CheckedForegroundProperty); }
set { SetValue(CheckedForegroundProperty, value); }
}
public static readonly DependencyProperty CheckedForegroundProperty =
DependencyProperty.Register("CheckedForeground", typeof(Brush), typeof(ToggleIconButton), new PropertyMetadata(null));
public Brush UncheckedForeground
{
get { return (Brush)GetValue(UncheckedForegroundProperty); }
set { SetValue(UncheckedForegroundProperty, value); }
}
public static readonly DependencyProperty UncheckedForegroundProperty =
DependencyProperty.Register("UncheckedForeground", typeof(Brush), typeof(ToggleIconButton), new PropertyMetadata(null));
public String CheckedText
{
get { return (String)GetValue(CheckedTextProperty); }
set { SetValue(CheckedTextProperty, value); }
}
public static readonly DependencyProperty CheckedTextProperty =
DependencyProperty.Register("CheckedText", typeof(String), typeof(ToggleIconButton), new PropertyMetadata(null));
public String UncheckedText
{
get { return (String)GetValue(UncheckedTextProperty); }
set { SetValue(UncheckedTextProperty, value); }
}
public static readonly DependencyProperty UncheckedTextProperty =
DependencyProperty.Register("UncheckedText", typeof(String), typeof(ToggleIconButton), new PropertyMetadata(null));
public TextAlignment TextAlignment
{
get { return (TextAlignment)GetValue(TextAlignmentProperty); }
set { SetValue(TextAlignmentProperty, value); }
}
public static readonly DependencyProperty TextAlignmentProperty =
DependencyProperty.Register("TextAlignment", typeof(TextAlignment), typeof(ToggleIconButton), new PropertyMetadata(TextAlignment.Center));
static ToggleIconButton()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ToggleIconButton), new FrameworkPropertyMetadata(typeof(ToggleIconButton)));
}
}
}
|