13 private static readonly SortedDictionary<string, bool> missingStyles = [];
14 private static Timer? timer =
null;
16 private static double? smallSpacing;
17 private static ControlTemplate? radioButtonTemplate;
18 private static Thickness? smallBottomMargins;
19 private static Thickness? smallTopMargins;
20 private static Thickness? smallLeftMargins;
21 private static Thickness? smallRightMargins;
22 private static Thickness? smallMargins;
23 private static Style? sectionTitleLabelStyle;
24 private static Style? keyLabel;
25 private static Style? valueLabel;
26 private static Style? formattedValueLabel;
27 private static Style? clickableValueLabel;
28 private static Style? infoLabelStyle;
29 private static Style? filledTextButton;
30 private static Style? frameSet;
31 private static Style? frameSubSet;
32 private static Style? clickableFrameSubSet;
33 private static Style? regularCompositePicker;
34 private static Style? regularCompositeEntry;
35 private static Style? regularCompositeEntryBorder;
36 private static Style? regularCompositeDatePicker;
37 private static Style? imageOnlyButton;
38 private static Style? sendFrame;
39 private static Style? receiveFrame;
40 private static Style? requiredFieldMarker;
41 private static Style? requiredFieldMarkerSpan;
42 private static Style? tableCellEven;
43 private static Style? tableCellOdd;
44 private static Style? tableCell;
45 private static Style?[] headers;
46 private static Style? roundedBorder;
47 private static Style? baseCompositeInputView;
48 private static Style? borderSet;
49 private static Style? bottomBarBorder;
50 private static Style? tertiaryButton;
51 private static Style? transparentTemplateButtonBorder;
52 private static Style? transparentTemplateButtonLabel;
53 private static Style? transparentTemplateButtonPath;
54 private static Style? secondaryButton;
55 private static Style? secondaryImageButton;
56 private static Style? neuroIconButton;
57 private static Style? neuroIconButtonDisabled;
61 Log.Terminating += Log_Terminating;
62 headers =
new Style[9];
65 private static Task Log_Terminating(
object? sender, EventArgs e)
70 return Task.CompletedTask;
81 if ((Application.Current?.Resources.TryGetValue(Name, out
object Value) ??
false) && Value is T TypedValue)
90 missingStyles[Name] =
true;
92 timer =
new Timer(LogAlert,
null, 1000, Timeout.Infinite);
99 private static void LogAlert(
object?
_)
101 StringBuilder sb =
new();
103 sb.AppendLine(
"Missing styles:");
108 foreach (
string Key
in missingStyles.Keys)
114 missingStyles.Clear();
120 public static double SmallSpacing
124 smallSpacing ??= TryGetResource<double?>(
"SmallSpacing");
125 return smallSpacing ?? 0;
136 radioButtonTemplate ??= TryGetResource<ControlTemplate>(
"RadioButtonTemplate");
137 return radioButtonTemplate!;
148 smallBottomMargins ??= TryGetResource<Thickness>(
"SmallBottomMargins");
149 return smallBottomMargins.Value;
160 smallTopMargins ??= TryGetResource<Thickness>(
"SmallTopMargins");
161 return smallTopMargins.Value;
172 smallLeftMargins ??= TryGetResource<Thickness>(
"SmallLeftMargins");
173 return smallLeftMargins.Value;
184 smallRightMargins ??= TryGetResource<Thickness>(
"SmallRightMargins");
185 return smallRightMargins.Value;
196 smallMargins ??= TryGetResource<Thickness>(
"SmallMargins");
197 return smallMargins.Value;
208 sectionTitleLabelStyle ??= TryGetResource<Style>(
"SectionTitleLabel");
209 return sectionTitleLabelStyle!;
220 keyLabel ??= TryGetResource<Style>(
"KeyLabel");
232 valueLabel ??= TryGetResource<Style>(
"ValueLabel");
244 formattedValueLabel ??= TryGetResource<Style>(
"FormattedValueLabel");
245 return formattedValueLabel!;
256 clickableValueLabel ??= TryGetResource<Style>(
"ClickableValueLabel");
257 return clickableValueLabel!;
268 infoLabelStyle ??= TryGetResource<Style>(
"InfoLabel");
269 return infoLabelStyle!;
280 filledTextButton ??= TryGetResource<Style>(
"FilledTextButton");
281 return filledTextButton!;
292 frameSet ??= TryGetResource<Style>(
"FrameSet");
304 frameSubSet ??= TryGetResource<Style>(
"FrameSubSet");
316 clickableFrameSubSet ??= TryGetResource<Style>(
"ClickableFrameSubSet");
317 return clickableFrameSubSet!;
328 regularCompositeEntry ??= TryGetResource<Style>(
"RegularCompositeEntry");
329 return regularCompositeEntry!;
340 regularCompositeEntryBorder ??= TryGetResource<Style>(
"RegularCompositeEntryBorder");
341 return regularCompositeEntryBorder!;
352 regularCompositeDatePicker ??= TryGetResource<Style>(
"RegularCompositeDatePicker");
353 return regularCompositeDatePicker!;
364 imageOnlyButton ??= TryGetResource<Style>(
"ImageOnlyButton");
365 return imageOnlyButton!;
376 secondaryImageButton ??= TryGetResource<Style>(
"SecondaryImageButton");
377 return secondaryImageButton!;
388 sendFrame ??= TryGetResource<Style>(
"SendFrame");
400 receiveFrame ??= TryGetResource<Style>(
"ReceiveFrame");
401 return receiveFrame!;
412 requiredFieldMarker ??= TryGetResource<Style>(
"RequiredFieldMarker");
413 return requiredFieldMarker!;
424 requiredFieldMarkerSpan ??= TryGetResource<Style>(
"RequiredFieldMarkerSpan");
425 return requiredFieldMarkerSpan!;
436 tableCellEven ??= TryGetResource<Style>(
"TableCellEven");
437 return tableCellEven!;
448 tableCellOdd ??= TryGetResource<Style>(
"TableCellOdd");
449 return tableCellOdd!;
460 tableCell ??= TryGetResource<Style>(
"TableCell");
470 headers[x - 1] ??= TryGetResource<Style>($
"Header{x}");
472 return headers[x - 1]!;
475 public static Style RoundedBorder
479 roundedBorder ??= TryGetResource<Style>(
"RoundedBorder");
480 return roundedBorder!;
491 regularCompositePicker ??= TryGetResource<Style>(
"RegularCompositePicker");
492 return regularCompositePicker!;
503 baseCompositeInputView ??= TryGetResource<Style>(
"BaseCompositeInputView");
504 return baseCompositeInputView!;
515 borderSet ??= TryGetResource<Style>(
"BorderSet");
527 bottomBarBorder ??= TryGetResource<Style>(
"BottomBarBorder");
528 return bottomBarBorder!;
539 tertiaryButton ??= TryGetResource<Style>(
"TertiaryButton");
540 return tertiaryButton!;
551 transparentTemplateButtonBorder ??= TryGetResource<Style>(
"TransparentTemplateButtonBorder");
552 return transparentTemplateButtonBorder!;
563 transparentTemplateButtonLabel ??= TryGetResource<Style>(
"TransparentTemplateButtonLabel");
564 return transparentTemplateButtonLabel!;
575 transparentTemplateButtonPath ??= TryGetResource<Style>(
"TransparentTemplateButtonPath");
576 return transparentTemplateButtonPath!;
587 secondaryButton ??= TryGetResource<Style>(
"SecondaryButton");
588 return secondaryButton!;
599 neuroIconButton ??= TryGetResource<Style>(
"NeuroIconButton");
600 return neuroIconButton!;
611 neuroIconButtonDisabled ??= TryGetResource<Style>(
"NeuroIconButtonDisabled");
612 return neuroIconButtonDisabled!;
Base class that references services in the app.
static ILogService LogService
Log service.
Static class that gives access to app-specific styles
static Style BaseCompositeInputView
Style for base composite input view
static Thickness SmallMargins
Small margins
static Style TransparentTemplateButtonBorder
Style for transparent template button border
static Thickness SmallRightMargins
Right-only small margins
static Style TableCellOdd
Style for odd table cells
static Style BorderSet
Style for border set
static Style TransparentTemplateButtonPath
Style for transparent template button path
static Style RegularCompositeEntry
Style for borders in a regular composte entry control.
static Style ImageOnlyButton
Style for buttons containing only an image.
static Style BottomBarBorder
Style for bottom bar border
static Style TableCell
Style for table cells
static ControlTemplate RadioButtonTemplate
Template for radio buttons
static Style SendFrame
Style for send frames
static Style FrameSubSet
Style for frame subsets.
static Style TransparentTemplateButtonLabel
Style for transparent template button label
static Style SectionTitleLabel
Style of section title labels
static Thickness SmallBottomMargins
Bottom-only small margins
static Style RegularCompositePicker
Style for regular composite pickers
static Style RequiredFieldMarkerSpan
Style for required field marker spans
static Style TableCellEven
Style for even table cells
static Style SecondaryImageButton
Style for secondary image buttons.
static Style ClickableValueLabel
Style of clickable value labels
static Style SecondaryButton
Style for secondary button
static Style ClickableFrameSubSet
Style for clickable frame subsets.
static Style NeuroIconButtonDisabled
Style for NeuroIconButtonDisabled
static Style InfoLabel
Style of information labels
static Style ReceiveFrame
Style for receive frames
static Thickness SmallLeftMargins
Left-only small margins
static Style FrameSet
Style for frame sets.
static Style RegularCompositeEntryBorder
Style for borders in a regular composte entry control.
static ? T TryGetResource< T >(string Name)
Tries to get an embedded resource.
static Thickness SmallTopMargins
Top-only small margins
static Style RegularCompositeDatePicker
Style for CompositeDatePicker controls.
static Style KeyLabel
Style of key labels
static Style ValueLabel
Style of value labels
static Style GetHeaderStyle(int x)
Get style for header of certain size
static Style NeuroIconButton
Style for NeuroIconButton
static Style RequiredFieldMarker
Style for required field marker labels
static Style FormattedValueLabel
Style of formatted value labels
static Style FilledTextButton
Style for filled text buttons.
static Style TertiaryButton
Style for Tertiary Button