提交 db3f1c8d 编写于 作者: D Dan Siegel

chore: update code format

上级 2838d270
using System;
using System;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Adapters;
using Prism.Navigation.Regions.Behaviors;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions;
using Xamarin.Forms;
namespace Prism.Ioc
......
using System.ComponentModel;
using System.Reflection;
using Prism.Navigation;
using Prism.Navigation.Xaml;
using Prism.Navigation.Regions;
using Prism.Navigation.Xaml;
using NavigationMode = Prism.Navigation.NavigationMode;
using TabbedPage = Microsoft.Maui.Controls.TabbedPage;
......@@ -22,10 +22,10 @@ public static class MvvmHelpers
action(viewModelAsT);
}
if(view is Page page)
if (view is Page page)
{
var children = page.GetChildRegions();
if(children is not null)
if (children is not null)
foreach (var child in children)
InvokeViewAndViewModelAction<T>(child, action);
}
......@@ -46,7 +46,7 @@ public static class MvvmHelpers
if (view is Page page)
{
var children = page.GetChildRegions();
if(children is not null)
if (children is not null)
foreach (var child in children)
await InvokeViewAndViewModelActionAsync<T>(child, action);
}
......@@ -60,7 +60,7 @@ public static class MvvmHelpers
InvokeViewAndViewModelAction<IDestructible>(view, v => v.Destroy());
if(view is Page page)
if (view is Page page)
{
page.Behaviors?.Clear();
page.BindingContext = null;
......@@ -301,7 +301,7 @@ public static class MvvmHelpers
{
var navigationService = Navigation.Xaml.Navigation.GetNavigationService(navigationPage.CurrentPage);
var result = await navigationService.GoBackAsync();
if(result.Exception is NavigationException navEx && navEx.Message == NavigationException.CannotPopApplicationMainPage)
if (result.Exception is NavigationException navEx && navEx.Message == NavigationException.CannotPopApplicationMainPage)
{
Application.Current.Quit();
}
......
......@@ -24,4 +24,4 @@ public class ObservableObject<T> : BindableObject, INotifyPropertyChanged
get => (T)GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
}
\ No newline at end of file
}
using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Compatibility;
using Prism.Mvvm;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Adapters;
using Prism.Navigation.Regions.Behaviors;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions;
namespace Prism.Ioc;
......
......@@ -29,4 +29,4 @@ public class GoBackExtension : NavigationExtensionBase
Log(result.Exception, parameters);
}
}
}
\ No newline at end of file
}
using System;
using Prism.Navigation;
namespace Prism.Navigation.Regions
{
......
......@@ -14,6 +14,5 @@ namespace Prism.Navigation.Regions
/// Attaches the behavior to the specified region.
/// </summary>
void Attach();
}
}
......@@ -37,10 +37,10 @@ namespace Prism.Navigation.Regions
bool ContainsRegionWithName(string regionName);
/// <summary>
/// Adds a region to the <see cref="RegionManager"/> with the name received as argument.
/// Adds a region to the <see cref="IRegionManager"/> with the name received as argument.
/// </summary>
/// <param name="regionName">The name to be given to the region.</param>
/// <param name="region">The region to be added to the <see cref="RegionManager"/>.</param>
/// <param name="region">The region to be added to the <see cref="IRegionManager"/>.</param>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="region"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentException">Thrown if <paramref name="regionName"/> and <paramref name="region"/>'s name do not match and the <paramref name="region"/> <see cref="IRegion.Name"/> is not <see langword="null"/>.</exception>
void Add(string regionName, IRegion region);
......
......@@ -38,10 +38,10 @@ namespace Prism.Navigation.Regions
}
/// <summary>
/// Initializes a new instance of the <see cref="UpdateRegionsException"/> class with serialized data.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
/// Initializes a new instance of the <see cref="UpdateRegionsException"/> class with serialized data.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
protected UpdateRegionsException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
......
using System;
using System;
using System.Collections.Generic;
using System.Text;
using Moq;
......@@ -6,7 +6,6 @@ using Prism.Ioc;
using Prism.Ioc.Internals;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions;
using Xamarin.Forms;
using Xunit;
using Region = Prism.Navigation.Regions.Region;
......
......@@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Text;
using Prism.Forms.Regions.Mocks;
using Prism.Navigation.Regions.Adapters;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Adapters;
using Xamarin.Forms;
using Xunit;
......
......@@ -2,15 +2,15 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Moq;
using NuGet.Frameworks;
using Prism.Ioc;
using Prism.Navigation;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions.Navigation;
using Xamarin.Forms;
using Xunit;
using Region = Prism.Navigation.Regions.Region;
using NuGet.Frameworks;
namespace Prism.Forms.Regions.Tests
{
......
......@@ -117,7 +117,7 @@ namespace Prism.Forms.Regions.Tests
originalCollection.Remove(filteredInObject);
Assert.NotNull(oldItemsPassed);
Assert.Equal(1, oldItemsPassed.Count);
Assert.Single(oldItemsPassed);
Assert.Same(filteredInObject.Item, oldItemsPassed[0]);
}
......@@ -133,7 +133,7 @@ namespace Prism.Forms.Regions.Tests
originalCollection.Add(filteredInObject);
Assert.NotNull(newItemsPassed);
Assert.Equal(1, newItemsPassed.Count);
Assert.Single(newItemsPassed);
Assert.Same(filteredInObject.Item, newItemsPassed[0]);
}
......
......@@ -112,7 +112,7 @@ public class RegionFixture : TestBase
[Fact]
public void RegionManager_HasTwoRegions()
{
var mauiApp = CreateBuilder(prism =>
var mauiApp = CreateBuilder(prism =>
prism.RegisterTypes(container =>
{
container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();
......
......@@ -117,7 +117,7 @@ namespace Prism.Wpf.Tests.Regions
originalCollection.Remove(filteredInObject);
Assert.NotNull(oldItemsPassed);
Assert.Equal(1, oldItemsPassed.Count);
Assert.Single(oldItemsPassed);
Assert.Same(filteredInObject.Item, oldItemsPassed[0]);
}
......@@ -133,7 +133,7 @@ namespace Prism.Wpf.Tests.Regions
originalCollection.Add(filteredInObject);
Assert.NotNull(newItemsPassed);
Assert.Equal(1, newItemsPassed.Count);
Assert.Single(newItemsPassed);
Assert.Same(filteredInObject.Item, newItemsPassed[0]);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册