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
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Specialized;
using System.Collections.Specialized;
using Prism.Behaviors;
using Prism.Common;
using Prism.Ioc;
using Prism.Mvvm;
using Prism.Properties;

Expand Down Expand Up @@ -29,8 +28,8 @@ public CarouselViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)
/// <param name="regionTarget">The object to adapt.</param>
protected override void Adapt(IRegion region, CarouselView regionTarget)
{
if (regionTarget == null)
throw new ArgumentNullException(nameof(regionTarget));
ArgumentNullException.ThrowIfNull(region);
ArgumentNullException.ThrowIfNull(regionTarget);

bool itemsSourceIsSet = regionTarget.ItemsSource != null || regionTarget.IsSet(ItemsView.ItemsSourceProperty);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Prism.Ioc;
using Prism.Properties;

namespace Prism.Navigation.Regions.Adapters;
Expand All @@ -25,11 +24,8 @@ public CollectionViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)
/// <param name="regionTarget">The object to adapt.</param>
protected override void Adapt(IRegion region, CollectionView regionTarget)
{
if (region == null)
throw new ArgumentNullException(nameof(region));

if (regionTarget == null)
throw new ArgumentNullException(nameof(regionTarget));
ArgumentNullException.ThrowIfNull(region);
ArgumentNullException.ThrowIfNull(regionTarget);

bool itemsSourceIsSet = regionTarget.ItemsSource != null || regionTarget.IsSet(ItemsView.ItemsSourceProperty);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Specialized;
using Prism.Ioc;
using System.Collections.Specialized;
using Prism.Properties;

namespace Prism.Navigation.Regions.Adapters;
Expand Down Expand Up @@ -27,8 +26,8 @@ public ContentViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)
/// <param name="regionTarget">The object to adapt.</param>
protected override void Adapt(IRegion region, TContentView regionTarget)
{
if (regionTarget == null)
throw new ArgumentNullException(nameof(regionTarget));
ArgumentNullException.ThrowIfNull(region);
ArgumentNullException.ThrowIfNull(regionTarget);

bool contentIsSet = regionTarget.Content != null || regionTarget.IsSet(ContentView.ContentProperty);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ public LayoutViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)
/// <param name="regionTarget">The object to adapt.</param>
protected override void Adapt(IRegion region, Layout<View> regionTarget)
{
if (region == null)
throw new ArgumentNullException(nameof(region));

if (regionTarget == null)
throw new ArgumentNullException(nameof(regionTarget));
ArgumentNullException.ThrowIfNull(region);
ArgumentNullException.ThrowIfNull(regionTarget);

bool itemsSourceIsSet = regionTarget.Children?.Any() ?? false || regionTarget.IsSet(BindableLayout.ItemsSourceProperty);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Globalization;
using System.Globalization;
using Prism.Extensions;
using Prism.Ioc;
using Prism.Navigation.Regions.Behaviors;
using Prism.Navigation.Xaml;
using Prism.Properties;
Expand Down Expand Up @@ -75,11 +74,8 @@ IRegion IRegionAdapter.Initialize(object regionTarget, string regionName)
/// <param name="regionTarget">The object to adapt.</param>
protected virtual void AttachDefaultBehaviors(IRegion region, T regionTarget)
{
if (region == null)
throw new ArgumentNullException(nameof(region));

if (regionTarget == null)
throw new ArgumentNullException(nameof(regionTarget));
ArgumentNullException.ThrowIfNull(region);
ArgumentNullException.ThrowIfNull(regionTarget);

IRegionBehaviorFactory behaviorFactory = RegionBehaviorFactory;
if (behaviorFactory != null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Specialized;
using Prism.Ioc;
using System.Collections.Specialized;
using Prism.Properties;

namespace Prism.Navigation.Regions.Adapters;
Expand All @@ -26,8 +25,8 @@ public ScrollViewRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)
/// <param name="regionTarget">The object to adapt.</param>
protected override void Adapt(IRegion region, ScrollView regionTarget)
{
if (regionTarget == null)
throw new ArgumentNullException(nameof(regionTarget));
ArgumentNullException.ThrowIfNull(region);
ArgumentNullException.ThrowIfNull(regionTarget);

// No binding check required as the ContentProperty is not Bindable
bool contentIsSet = regionTarget.Content != null;
Expand Down