I'm working on writing automated UI tests and using singleton pattern (lazy) to store UI object references.
How can I dispose _appMenu.Value? Could anyone please help?
private static Lazy<AppMenu> _appMenu = new Lazy<AppMenu>(() => new AppMenu(_logger,_reporter));
public static AppMenu Instance
{
get
{
return _appMenu.Value;
}
}
private AppMenu(ILogger logger, IReporter reporter)
{
_logger = logger;
_reporter = reporter;
AppMenuContainer = MainWindow.Instance.MainWindowContainer.FindSingle<TabPageList>(GenericProperties.AppMenu);
}