3.9 KiB
3.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T02:12:32.595603+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 37911183d8b2e17a |
Resources
Documentation: Resource Definitions and UI Event Handling
1. Purpose
This module provides centralized string constants for storyboard resource names used in UI transitions and a partial class implementing a tooltip event handler for help text propagation in the WPF UI layer. Specifically, ResourceNames defines stable identifiers for entry/exit transition storyboards, while MainTabControlResource facilitates contextual help by publishing HelpTextEvent events via Prism’s IEventAggregator when tooltips are invoked.
2. Public Interface
ResourceNames (internal static class)
EntryStoryboardName(public const string)
Value:"InTransition". Represents the name of the storyboard used for entering a view/page.ExitStoryboardName(public const string)
Value:"OutTransition". Represents the name of the storyboard used for exiting a view/page.
MainTabControlResource (public partial class)
ToolTipEventHandler(object sender, ToolTipEventArgs e)(public void)
HandlesToolTipOpeningevents. Setse.Handled = trueto suppress default tooltip behavior, retrievesIEventAggregatorviaServiceLocator, and publishes aHelpTextEventwith aHelpTextEventArgcontaining the originalsenderandToolTipEventArgs.
3. Invariants
EntryStoryboardNameandExitStoryboardNameare compile-time constants and must not be modified at runtime.ToolTipEventHandlermust be attached to aToolTipOpeningevent (or similar) on a WPF control to function as intended.ServiceLocator.Currentmust be initialized and configured with a valid container that resolvesIEventAggregator; otherwise, a runtime exception will occur.HelpTextEventArgconstructor requiresSenderandEparameters (as shown); no validation is performed beyond parameter passing.
4. Dependencies
This module depends on:
- WPF:
System.Windows.Controls.ToolTipEventArgsandpartial classsupport. - Prism Library:
IEventAggregator,IEvent, andHelpTextEvent/HelpTextEventArgtypes (not shown in source but referenced). - Microsoft.Practices.ServiceLocation:
ServiceLocatorfor resolving services. - DTS.Common.Events: Namespace containing
HelpTextEventandHelpTextEventArg(inferred fromusing DTS.Common.Events).
This module is depended on by:
- UI XAML files (e.g.,
MainTabControlResource.xaml) referencingEntryStoryboardName/ExitStoryboardNameas static resources. - Event subscribers to
HelpTextEvent(e.g., help service modules) that consumeHelpTextEventArgto display context-sensitive help.
5. Gotchas
internalvisibility:ResourceNamesisinternal, so its constants are only accessible within the same assembly (likelyDTS.CommonCore). External consumers must reference via fully qualified name if exposed elsewhere, but no public accessors exist.- Hardcoded storyboard names:
"InTransition"and"OutTransition"assume matching storyboard resources exist in XAML; mismatched names will cause silent transition failures (no compile-time check). - ServiceLocator usage: Relies on the deprecated
ServiceLocatorpattern (Prism recommends constructor injection). This may complicate testing and violate DI best practices. - No error handling: If
IEventAggregatoris not registered,ServiceLocator.Current.GetInstance<IEventAggregator>()throws an exception. No fallback or logging is present. e.Handled = true: Suppresses default tooltip behavior entirely—any other tooltip logic (e.g., staticToolTipproperty) will be overridden.
None identified beyond these.