Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/TestStack.White/UIItems/UIItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,18 @@ public virtual void ActionPerformed(Action action)
/// <returns>Returns an <c><see cref="IUIItemContainer"/></c> if possibe</returns>
public virtual IUIItemContainer AsContainer()
{
return AsContainerInternal();
}

#endregion

#region Internal

internal virtual IUIItemContainer AsContainerInternal()
{
// This function needs to be internal because all public method from this
// class call interceptors. Sometimes we don't need focus on element, for
// example in GetMultiple method, so this method created for internal usage.
if (Framework != WindowsFramework.Wpf)
{
Logger.Warn("Only WPF items should be treated as container items");
Expand Down
2 changes: 1 addition & 1 deletion src/TestStack.White/UIItems/WPFUIItems/WPFUIItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private static IUIItemContainer GetUiItemContainer(IUIItem uiItem)
{
throw new WhiteException("Cannot get UI Item container, uiItem must be an instance of UIItem");
}
return item.AsContainer();
return item.AsContainerInternal();
}

#endregion
Expand Down