diff --git a/src/Logging/Logger.cs b/src/Logging/Logger.cs index fe3afdcc..ccd5c904 100644 --- a/src/Logging/Logger.cs +++ b/src/Logging/Logger.cs @@ -30,7 +30,14 @@ public static Action Writer set => writer = value ?? throw new ArgumentNullException(nameof(value)); } - internal static void Write( + /// + /// Writes message to . + /// + /// Message to log. + /// Calling file path. + /// Calling member name. + /// + public static void Write( string message, [CallerFilePath] string callerFilePath = "", [CallerMemberName] string callerMemberName = "") @@ -39,4 +46,4 @@ internal static void Write( Writer($"[{Path.GetFileNameWithoutExtension(callerFilePath)}.{callerMemberName}] {message}"); } -} \ No newline at end of file +} diff --git a/src/Views/IView.cs b/src/Views/IView.cs index 09c2b5ef..b0ae13ae 100644 --- a/src/Views/IView.cs +++ b/src/Views/IView.cs @@ -5,7 +5,7 @@ namespace MvvmDialogs.Views; /// /// Interface describing a view in WPF. /// -internal interface IView +public interface IView { /// /// Occurs when the view is laid out, rendered, and ready for interaction. @@ -36,4 +36,4 @@ internal interface IView /// Gets the owning . /// Window GetOwner(); -} \ No newline at end of file +} diff --git a/src/Views/ViewWrapper.cs b/src/Views/ViewWrapper.cs index a88c3ce9..977f39bb 100644 --- a/src/Views/ViewWrapper.cs +++ b/src/Views/ViewWrapper.cs @@ -3,25 +3,40 @@ namespace MvvmDialogs.Views; -internal class ViewWrapper : IView +/// +/// Wraps objects for the properties needed. +/// +public class ViewWrapper : IView { private readonly WeakReference viewReference; - internal ViewWrapper(FrameworkElement view) + /// + /// Initializes a new instance of the class. + /// + /// that makes up the view. + /// + public ViewWrapper(FrameworkElement view) { if (view == null) throw new ArgumentNullException(nameof(view)); viewReference = new WeakReference(view); } + + /// public event RoutedEventHandler Loaded { add => Source.Loaded += value; remove => Source.Loaded -= value; } + + /// public int Id { get; } = IdGenerator.Generate(); + + /// + /// public FrameworkElement Source { get @@ -33,14 +48,29 @@ public FrameworkElement Source } } + /// public object DataContext => Source.DataContext; + /// public bool IsAlive => viewReference.IsAlive; + + /// public Window GetOwner() => Source.GetOwner(); + + /// + /// GetHashCode override based on the Source property + /// + /// HashCode of Source property public override int GetHashCode() => Source.GetHashCode(); + + /// + /// Equals Override comparing the Source property + /// + /// Object of type + /// True if the object is the same public override bool Equals(object? obj) { if (!(obj is ViewWrapper other)) @@ -48,4 +78,4 @@ public override bool Equals(object? obj) return Source.Equals(other.Source); } -} \ No newline at end of file +}