blob: 73b0a38a2fd5c596315bed6d64da503f5d946f1f (
plain)
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
|
using System.Windows;
using System.Windows.Controls.Primitives;
namespace MaterialDesignThemes.Wpf
{
public class RatingBarButton : ButtonBase
{
static RatingBarButton()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(RatingBarButton), new FrameworkPropertyMetadata(typeof(RatingBarButton)));
}
private static readonly DependencyPropertyKey ValuePropertyKey =
DependencyProperty.RegisterReadOnly(
"Value", typeof (int), typeof (RatingBarButton),
new PropertyMetadata(default(int)));
public static readonly DependencyProperty ValueProperty =
ValuePropertyKey.DependencyProperty;
public int Value
{
get { return (int) GetValue(ValueProperty); }
internal set { SetValue(ValuePropertyKey, value); }
}
private static readonly DependencyPropertyKey IsWithinValuePropertyKey =
DependencyProperty.RegisterReadOnly(
"IsWithinSelectedValue", typeof (bool), typeof (RatingBarButton),
new PropertyMetadata(default(bool)));
public static readonly DependencyProperty IsWithinSelectedValueProperty =
IsWithinValuePropertyKey.DependencyProperty;
public bool IsWithinSelectedValue
{
get { return (bool) GetValue(IsWithinSelectedValueProperty); }
internal set { SetValue(IsWithinValuePropertyKey, value); }
}
}
}
|