Skip to content

Commit

Permalink
Changed the access modifier of the AutowireViewModel method for the U…
Browse files Browse the repository at this point in the history
…WP/WinUI method from internal to public.
tstephansen committed Sep 10, 2021

Verified

This commit was signed with the committer’s verified signature.
tstephansen Tim Stephansen
1 parent 4180d8a commit fd7bdc2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Wpf/Prism.Wpf/Common/MvvmHelpers.cs
Original file line number Diff line number Diff line change
@@ -18,7 +18,16 @@ namespace Prism.Common
public static class MvvmHelpers
{
#if HAS_UWP || HAS_WINUI
internal static void AutowireViewModel(object viewOrViewModel)
/// <summary>
/// Sets the AutoWireViewModel property to true for the <paramref name="viewOrViewModel"/>.
/// </summary>
/// <remarks>
/// The AutoWireViewModel property will only be set to true if the view
/// is a <see cref="FrameworkElement"/>, the DataContext of the view is null, and
/// the AutoWireViewModel property of the view is null.
/// </remarks>
/// <param name="viewOrViewModel">The View or ViewModel.</param>
public static void AutowireViewModel(object viewOrViewModel)
{
if (viewOrViewModel is FrameworkElement view && view.DataContext is null && ViewModelLocator.GetAutowireViewModel(view) is null)
{

0 comments on commit fd7bdc2

Please sign in to comment.