Skip to content

Commit

Permalink
Simplified DialogServiceViews Views property (FantasticFiasco#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
i28423 authored and i28423 committed Sep 27, 2023
1 parent 6236553 commit fc1e4d7
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/DialogServiceViews.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,13 @@ private static void IsRegisteredChanged(
/// <summary>
/// Gets the registered views.
/// </summary>
internal static IEnumerable<IView> Views
{
get
{
var threadId = System.Windows.Threading.Dispatcher.CurrentDispatcher.Thread.ManagedThreadId;
return InternalViews
internal static IEnumerable<IView> Views => InternalViews
.Where(view =>
view.Key.ThreadId == threadId &&
view.Key.ThreadId == System.Windows.Threading.Dispatcher.CurrentDispatcher.Thread.ManagedThreadId &&
view.Value.IsAlive)
.Select(view => view.Value)
.ToArray();
}
}



/// <summary>
/// Registers specified view.
Expand Down

0 comments on commit fc1e4d7

Please sign in to comment.