12 private static readonly SortedDictionary<string, bool> missingStyles = [];
13 private static Timer? timer =
null;
15 private static ControlTemplate? radioButtonTemplate;
16 private static Thickness? smallBottomMargins;
17 private static Thickness? smallTopMargins;
18 private static Thickness? smallLeftMargins;
19 private static Thickness? smallRightMargins;
20 private static Style? sectionTitleLabelStyle;
21 private static Style? keyLabel;
22 private static Style? valueLabel;
23 private static Style? formattedValueLabel;
24 private static Style? clickableValueLabel;
25 private static Style? infoLabelStyle;
26 private static Style? filledTextButton;
27 private static Style? frameSet;
28 private static Style? frameSubSet;
29 private static Style? clickableFrameSubSet;
30 private static Style? regularCompositeEntry;
31 private static Style? regularCompositeEntryBorder;
32 private static Style? unicodeCharacterButton;
33 private static Style? imageOnlyButton;
34 private static Style? transparentImageButton;
35 private static Style? sendFrame;
36 private static Style? receiveFrame;
40 Log.Terminating += Log_Terminating;
43 private static void Log_Terminating(
object? sender, EventArgs e)
57 if ((Application.Current?.Resources.TryGetValue(Name, out
object Value) ??
false) && Value is T TypedValue)
66 missingStyles[Name] =
true;
68 timer =
new Timer(LogAlert,
null, 1000, Timeout.Infinite);
75 private static void LogAlert(
object? _)
77 StringBuilder sb =
new();
79 sb.AppendLine(
"Missing styles:");
84 foreach (
string Key
in missingStyles.Keys)
90 missingStyles.Clear();
103 radioButtonTemplate ??= TryGetResource<ControlTemplate>(
"RadioButtonTemplate");
104 return radioButtonTemplate!;
115 smallBottomMargins ??= TryGetResource<Thickness>(
"SmallBottomMargins");
116 return smallBottomMargins.Value;
127 smallTopMargins ??= TryGetResource<Thickness>(
"SmallTopMargins");
128 return smallTopMargins.Value;
139 smallLeftMargins ??= TryGetResource<Thickness>(
"SmallLeftMargins");
140 return smallLeftMargins.Value;
151 smallRightMargins ??= TryGetResource<Thickness>(
"SmallRightMargins");
152 return smallRightMargins.Value;
163 sectionTitleLabelStyle ??= TryGetResource<Style>(
"SectionTitleLabel");
164 return sectionTitleLabelStyle!;
175 keyLabel ??= TryGetResource<Style>(
"KeyLabel");
187 valueLabel ??= TryGetResource<Style>(
"ValueLabel");
199 formattedValueLabel ??= TryGetResource<Style>(
"FormattedValueLabel");
200 return formattedValueLabel!;
211 clickableValueLabel ??= TryGetResource<Style>(
"ClickableValueLabel");
212 return clickableValueLabel!;
223 infoLabelStyle ??= TryGetResource<Style>(
"InfoLabel");
224 return infoLabelStyle!;
235 filledTextButton ??= TryGetResource<Style>(
"FilledTextButtonNoRoundedCorners");
236 return filledTextButton!;
247 frameSet ??= TryGetResource<Style>(
"FrameSet");
259 frameSubSet ??= TryGetResource<Style>(
"FrameSubSet");
271 clickableFrameSubSet ??= TryGetResource<Style>(
"ClickableFrameSubSet");
272 return clickableFrameSubSet!;
283 regularCompositeEntry ??= TryGetResource<Style>(
"RegularCompositeEntryNoRoundedCorners");
284 return regularCompositeEntry!;
295 regularCompositeEntryBorder ??= TryGetResource<Style>(
"RegularCompositeEntryBorderNoRoundedCorners");
296 return regularCompositeEntryBorder!;
307 unicodeCharacterButton ??= TryGetResource<Style>(
"UnicodeCharacterButtonNoRoundedCorners");
308 return unicodeCharacterButton!;
319 imageOnlyButton ??= TryGetResource<Style>(
"ImageOnlyButton");
320 return imageOnlyButton!;
331 transparentImageButton ??= TryGetResource<Style>(
"TransparentImageButton");
332 return transparentImageButton!;
343 sendFrame ??= TryGetResource<Style>(
"SendFrame");
355 receiveFrame ??= TryGetResource<Style>(
"ReceiveFrame");
356 return receiveFrame!;
Base class that references services in the app.
static ILogService LogService
Log service.
Static class that gives access to app-specific styles
static Thickness SmallRightMargins
Right-only small margins
static Style RegularCompositeEntry
Style for borders in a regular composte entry control.
static Style ImageOnlyButton
Style for buttons containing only an image.
static ControlTemplate RadioButtonTemplate
Template for radio buttons
static Style SendFrame
Style for send frames
static Style FrameSubSet
Style for frame subsets.
static Style SectionTitleLabel
Style of section title labels
static Thickness SmallBottomMargins
Bottom-only small margins
static Style ClickableValueLabel
Style of clickable value labels
static Style ClickableFrameSubSet
Style for clickable frame subsets.
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 UnicodeCharacterButton
Style for buttons containing a single Unicode character.
static Style KeyLabel
Style of key labels
static Style ValueLabel
Style of value labels
static Style FormattedValueLabel
Style of formatted value labels
static Style TransparentImageButton
Style for transparent image buttons.
static Style FilledTextButton
Style for filled text buttons.