Vereinsmeisterschaften  22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
Loading...
Searching...
No Matches
PlaceholderAvailableContentControl.cs
3
5{
9 public class PlaceholderAvailableContentControl : ContentControl
10 {
15 {
16 get => (bool)GetValue(IsPlaceholderAvailableValueProperty);
17 set => SetValue(IsPlaceholderAvailableValueProperty, value);
18 }
19 public static readonly DependencyProperty IsPlaceholderAvailableValueProperty = DependencyProperty.Register(nameof(IsPlaceholderAvailable), typeof(bool), typeof(PlaceholderAvailableContentControl), new PropertyMetadata(false, OnAnyPropertyChanged));
20
25 {
26 get => (bool)GetValue(IsSupportedForTextProperty);
27 set => SetValue(IsSupportedForTextProperty, value);
28 }
29 public static readonly DependencyProperty IsSupportedForTextProperty = DependencyProperty.Register(nameof(IsSupportedForText), typeof(bool), typeof(PlaceholderAvailableContentControl), new PropertyMetadata(false, OnAnyPropertyChanged));
30
35 {
36 get => (bool)GetValue(IsSupportedForTableProperty);
37 set => SetValue(IsSupportedForTableProperty, value);
38 }
39 public static readonly DependencyProperty IsSupportedForTableProperty = DependencyProperty.Register(nameof(IsSupportedForTable), typeof(bool), typeof(PlaceholderAvailableContentControl), new PropertyMetadata(false, OnAnyPropertyChanged));
40
44 public ControlTemplate NotAvailableTemplate
45 {
46 get => (ControlTemplate)GetValue(NotAvailableTemplateProperty);
47 set => SetValue(NotAvailableTemplateProperty, value);
48 }
49 public static readonly DependencyProperty NotAvailableTemplateProperty = DependencyProperty.Register(nameof(NotAvailableTemplate), typeof(ControlTemplate), typeof(PlaceholderAvailableContentControl), new PropertyMetadata(null, OnAnyPropertyChanged));
50
54 public ControlTemplate AvailableOnlyTextTemplate
55 {
56 get => (ControlTemplate)GetValue(AvailableOnlyTextTemplateProperty);
57 set => SetValue(AvailableOnlyTextTemplateProperty, value);
58 }
59 public static readonly DependencyProperty AvailableOnlyTextTemplateProperty = DependencyProperty.Register(nameof(AvailableOnlyTextTemplate), typeof(ControlTemplate), typeof(PlaceholderAvailableContentControl), new PropertyMetadata(null, OnAnyPropertyChanged));
60
64 public ControlTemplate AvailableOnlyTableTemplate
65 {
66 get => (ControlTemplate)GetValue(AvailableOnlyTableTemplateProperty);
67 set => SetValue(AvailableOnlyTableTemplateProperty, value);
68 }
69 public static readonly DependencyProperty AvailableOnlyTableTemplateProperty = DependencyProperty.Register(nameof(AvailableOnlyTableTemplate), typeof(ControlTemplate), typeof(PlaceholderAvailableContentControl), new PropertyMetadata(null, OnAnyPropertyChanged));
70
74 public ControlTemplate AvailableTextAndTableTemplate
75 {
76 get => (ControlTemplate)GetValue(AvailableTextAndTableTemplateProperty);
77 set => SetValue(AvailableTextAndTableTemplateProperty, value);
78 }
79 public static readonly DependencyProperty AvailableTextAndTableTemplateProperty = DependencyProperty.Register(nameof(AvailableTextAndTableTemplate), typeof(ControlTemplate), typeof(PlaceholderAvailableContentControl), new PropertyMetadata(null, OnAnyPropertyChanged));
80
81
85 private static void OnAnyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
86 {
88 control.UpdateTemplate();
89 }
90
94 private void UpdateTemplate()
95 {
97 {
99 }
101 {
102 Template = AvailableOnlyTextTemplate;
103 }
105 {
107 }
108 else
109 {
110 Template = NotAvailableTemplate;
111 }
112 ApplyTemplate();
113 }
114
118 public override void OnApplyTemplate()
119 {
120 base.OnApplyTemplate();
122 }
123 }
124}
Content control that selects its template based on the availability of a placeholder.
ControlTemplate NotAvailableTemplate
Dependency property for a template that is used, when the placeholder is not available.
void UpdateTemplate()
Updates the template based on the current values.
static void OnAnyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
Callback for when any of the properties change.
ControlTemplate AvailableOnlyTableTemplate
Dependency property for a template that is used, when the placeholder is only available inside tables...
bool IsPlaceholderAvailable
Dependency property for the boolean value that determines if the placeholder is available.
ControlTemplate AvailableTextAndTableTemplate
Dependency property for a template that is used, when the placeholder is available inside normal text...
override void OnApplyTemplate()
Called when the control's template is applied.
bool IsSupportedForTable
Dependency property for the boolean value that determines if the placeholder is supported inside tabl...
ControlTemplate AvailableOnlyTextTemplate
Dependency property for a template that is used, when the placeholder is only available inside normal...
bool IsSupportedForText
Dependency property for the boolean value that determines if the placeholder is supported inside norm...