Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Prism
提交
5891f002
P
Prism
项目概览
jobily
/
Prism
8 个月 前同步成功
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Prism
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5891f002
编写于
8月 26, 2023
作者:
D
Dan Siegel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: removing duplicate platform extensions
上级
84cbb447
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
228 deletion
+5
-228
e2e/Maui/MauiRegionsModule/MauiTestRegionsModule.cs
e2e/Maui/MauiRegionsModule/MauiTestRegionsModule.cs
+2
-2
e2e/Maui/MauiRegionsModule/ViewModels/RegionViewModelBase.cs
e2e/Maui/MauiRegionsModule/ViewModels/RegionViewModelBase.cs
+3
-3
src/Maui/Prism.Maui/Regions/IRegionManagerExtensions.cs
src/Maui/Prism.Maui/Regions/IRegionManagerExtensions.cs
+0
-121
src/Maui/Prism.Maui/Regions/Navigation/NavigationAsyncExtensions.cs
...rism.Maui/Regions/Navigation/NavigationAsyncExtensions.cs
+0
-102
未找到文件。
e2e/Maui/MauiRegionsModule/MauiTestRegionsModule.cs
浏览文件 @
5891f002
...
@@ -8,7 +8,7 @@ public class MauiTestRegionsModule : IModule
...
@@ -8,7 +8,7 @@ public class MauiTestRegionsModule : IModule
public
void
OnInitialized
(
IContainerProvider
containerProvider
)
public
void
OnInitialized
(
IContainerProvider
containerProvider
)
{
{
var
regionManager
=
containerProvider
.
Resolve
<
IRegionManager
>();
var
regionManager
=
containerProvider
.
Resolve
<
IRegionManager
>();
regionManager
.
RegisterViewWithRegion
(
"ContentRegion"
,
"RegionViewA
"
);
regionManager
.
RegisterViewWithRegion
<
RegionViewA
>(
"ContentRegion
"
);
}
}
public
void
RegisterTypes
(
IContainerRegistry
containerRegistry
)
public
void
RegisterTypes
(
IContainerRegistry
containerRegistry
)
...
@@ -23,4 +23,4 @@ public class MauiTestRegionsModule : IModule
...
@@ -23,4 +23,4 @@ public class MauiTestRegionsModule : IModule
.
RegisterForRegionNavigation
<
RegionViewB
,
RegionViewBViewModel
>()
.
RegisterForRegionNavigation
<
RegionViewB
,
RegionViewBViewModel
>()
.
RegisterForRegionNavigation
<
RegionViewC
,
RegionViewCViewModel
>();
.
RegisterForRegionNavigation
<
RegionViewC
,
RegionViewCViewModel
>();
}
}
}
}
\ No newline at end of file
e2e/Maui/MauiRegionsModule/ViewModels/RegionViewModelBase.cs
浏览文件 @
5891f002
...
@@ -15,7 +15,7 @@ public abstract class RegionViewModelBase : BindableBase, IRegionAware, IPageLif
...
@@ -15,7 +15,7 @@ public abstract class RegionViewModelBase : BindableBase, IRegionAware, IPageLif
_pageAccessor
=
pageAccessor
;
_pageAccessor
=
pageAccessor
;
}
}
public
bool
IsNavigationTarget
(
I
NavigationContext
navigationContext
)
=>
public
bool
IsNavigationTarget
(
NavigationContext
navigationContext
)
=>
navigationContext
.
NavigatedName
()
==
Name
;
navigationContext
.
NavigatedName
()
==
Name
;
private
string
?
_message
;
private
string
?
_message
;
...
@@ -34,12 +34,12 @@ public abstract class RegionViewModelBase : BindableBase, IRegionAware, IPageLif
...
@@ -34,12 +34,12 @@ public abstract class RegionViewModelBase : BindableBase, IRegionAware, IPageLif
public
string
?
PageName
=>
_pageAccessor
.
Page
?.
GetType
()?.
Name
;
public
string
?
PageName
=>
_pageAccessor
.
Page
?.
GetType
()?.
Name
;
public
void
OnNavigatedFrom
(
I
NavigationContext
navigationContext
)
public
void
OnNavigatedFrom
(
NavigationContext
navigationContext
)
{
{
}
}
public
void
OnNavigatedTo
(
I
NavigationContext
navigationContext
)
public
void
OnNavigatedTo
(
NavigationContext
navigationContext
)
{
{
if
(
navigationContext
.
Parameters
.
ContainsKey
(
nameof
(
Message
)))
if
(
navigationContext
.
Parameters
.
ContainsKey
(
nameof
(
Message
)))
Message
=
navigationContext
.
Parameters
.
GetValue
<
string
>(
nameof
(
Message
));
Message
=
navigationContext
.
Parameters
.
GetValue
<
string
>(
nameof
(
Message
));
...
...
src/Maui/Prism.Maui/Regions/IRegionManagerExtensions.cs
已删除
100644 → 0
浏览文件 @
84cbb447
using
Prism.Navigation
;
using
Prism.Regions.Navigation
;
namespace
Prism.Regions
;
/// <summary>
/// NavigationExtensions for the <see cref="IRegionManager" />
/// </summary>
public
static
class
IRegionManagerExtensions
{
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="regionManager">The navigation object.</param>
/// <param name="regionName">The name of the Region to navigate to.</param>
/// <param name="target">The navigation target</param>
public
static
void
RequestNavigate
(
this
IRegionManager
regionManager
,
string
regionName
,
string
target
)
{
RequestNavigate
(
regionManager
,
regionName
,
target
,
nr
=>
{
});
}
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="regionManager">The navigation object.</param>
/// <param name="regionName">The name of the Region to navigate to.</param>
/// <param name="target">The navigation target</param>
/// <param name="navigationCallback">The callback executed when the navigation request is completed.</param>
public
static
void
RequestNavigate
(
this
IRegionManager
regionManager
,
string
regionName
,
string
target
,
Action
<
NavigationResult
>
navigationCallback
)
{
if
(
regionManager
==
null
)
throw
new
ArgumentNullException
(
nameof
(
regionManager
));
if
(
target
==
null
)
throw
new
ArgumentNullException
(
nameof
(
target
));
var
targetUri
=
new
Uri
(
target
,
UriKind
.
RelativeOrAbsolute
);
regionManager
.
RequestNavigate
(
regionName
,
targetUri
,
navigationCallback
);
}
/// <summary>
/// Initiates navigation to the target specified by the <see cref="Uri"/>.
/// </summary>
/// <param name="regionManager">The navigation object.</param>
/// <param name="regionName">The name of the Region to navigate to.</param>
/// <param name="target">The navigation target</param>
public
static
void
RequestNavigate
(
this
IRegionManager
regionManager
,
string
regionName
,
Uri
target
)
{
if
(
regionManager
==
null
)
throw
new
ArgumentNullException
(
nameof
(
regionManager
));
regionManager
.
RequestNavigate
(
regionName
,
target
,
nr
=>
{
});
}
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="regionManager">The navigation object.</param>
/// <param name="regionName">The name of the Region to navigate to.</param>
/// <param name="target">The navigation target</param>
/// <param name="navigationCallback">The callback executed when the navigation request is completed.</param>
/// <param name="regionParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param>
public
static
void
RequestNavigate
(
this
IRegionManager
regionManager
,
string
regionName
,
string
target
,
Action
<
NavigationResult
>
navigationCallback
,
INavigationParameters
regionParameters
)
{
if
(
regionManager
==
null
)
throw
new
ArgumentNullException
(
nameof
(
regionManager
));
if
(
target
==
null
)
throw
new
ArgumentNullException
(
nameof
(
target
));
var
targetUri
=
new
Uri
(
target
,
UriKind
.
RelativeOrAbsolute
);
regionManager
.
RequestNavigate
(
regionName
,
targetUri
,
navigationCallback
,
regionParameters
);
}
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="regionManager">The RegionManager object.</param>
/// <param name="regionName">The name of the Region to navigate to.</param>
/// <param name="target">A Uri that represents the target where the region will navigate.</param>
/// <param name="regionParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param>
public
static
void
RequestNavigate
(
this
IRegionManager
regionManager
,
string
regionName
,
Uri
target
,
INavigationParameters
regionParameters
)
{
if
(
regionManager
==
null
)
throw
new
ArgumentNullException
(
nameof
(
regionManager
));
regionManager
.
RequestNavigate
(
regionName
,
target
,
nr
=>
{
},
regionParameters
);
}
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="regionManager">The RegionManager object.</param>
/// <param name="regionName">The name of the Region to navigate to.</param>
/// <param name="target">A string that represents the target where the region will navigate.</param>
/// <param name="regionParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param>
public
static
void
RequestNavigate
(
this
IRegionManager
regionManager
,
string
regionName
,
string
target
,
INavigationParameters
regionParameters
)
{
if
(
regionManager
==
null
)
throw
new
ArgumentNullException
(
nameof
(
regionManager
));
if
(
target
==
null
)
throw
new
ArgumentNullException
(
nameof
(
target
));
regionManager
.
RequestNavigate
(
regionName
,
new
Uri
(
target
,
UriKind
.
RelativeOrAbsolute
),
nr
=>
{
},
regionParameters
);
}
/// <summary>
/// Associate a view with a region, by registering a type. When the region get's displayed
/// this type will be resolved using the ServiceLocator into a concrete instance. The instance
/// will be added to the Views collection of the region
/// </summary>
/// <typeparam name="T">The type of the view to register with the <see cref="IRegion"/>.</typeparam>
/// <param name="regionManager">The current <see cref="IRegionManager"/>.</param>
/// <param name="regionName">The name of the region to associate the view with.</param>
/// <returns>The <see cref="IRegionManager"/>, for adding several views easily</returns>
public
static
IRegionManager
RegisterViewWithRegion
<
T
>(
this
IRegionManager
regionManager
,
string
regionName
)
=>
regionManager
.
RegisterViewWithRegion
(
regionName
,
typeof
(
T
));
}
src/Maui/Prism.Maui/Regions/Navigation/NavigationAsyncExtensions.cs
已删除
100644 → 0
浏览文件 @
84cbb447
using
Prism.Navigation
;
namespace
Prism.Regions.Navigation
;
/// <summary>
/// Provides additional methods to the <see cref="INavigateAsync"/> interface.
/// </summary>
public
static
class
NavigationAsyncExtensions
{
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="navigation">The navigation object.</param>
/// <param name="target">The navigation target</param>
public
static
void
RequestNavigate
(
this
INavigateAsync
navigation
,
string
target
)
{
RequestNavigate
(
navigation
,
target
,
nr
=>
{
});
}
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="navigation">The navigation object.</param>
/// <param name="target">The navigation target</param>
/// <param name="navigationCallback">The callback executed when the navigation request is completed.</param>
public
static
void
RequestNavigate
(
this
INavigateAsync
navigation
,
string
target
,
Action
<
NavigationResult
>
navigationCallback
)
{
if
(
navigation
==
null
)
throw
new
ArgumentNullException
(
nameof
(
navigation
));
if
(
target
==
null
)
throw
new
ArgumentNullException
(
nameof
(
target
));
var
targetUri
=
new
Uri
(
target
,
UriKind
.
RelativeOrAbsolute
);
navigation
.
RequestNavigate
(
targetUri
,
navigationCallback
);
}
/// <summary>
/// Initiates navigation to the target specified by the <see cref="Uri"/>.
/// </summary>
/// <param name="navigation">The navigation object.</param>
/// <param name="target">The navigation target</param>
public
static
void
RequestNavigate
(
this
INavigateAsync
navigation
,
Uri
target
)
{
if
(
navigation
==
null
)
throw
new
ArgumentNullException
(
nameof
(
navigation
));
navigation
.
RequestNavigate
(
target
,
nr
=>
{
});
}
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="navigation">The navigation object.</param>
/// <param name="target">The navigation target</param>
/// <param name="navigationCallback">The callback executed when the navigation request is completed.</param>
/// <param name="regionParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param>
public
static
void
RequestNavigate
(
this
INavigateAsync
navigation
,
string
target
,
Action
<
NavigationResult
>
navigationCallback
,
INavigationParameters
regionParameters
)
{
if
(
navigation
==
null
)
throw
new
ArgumentNullException
(
nameof
(
navigation
));
if
(
target
==
null
)
throw
new
ArgumentNullException
(
nameof
(
target
));
var
targetUri
=
new
Uri
(
target
,
UriKind
.
RelativeOrAbsolute
);
navigation
.
RequestNavigate
(
targetUri
,
navigationCallback
,
regionParameters
);
}
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="navigation">The navigation object.</param>
/// <param name="target">A Uri that represents the target where the region will navigate.</param>
/// <param name="regionParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param>
public
static
void
RequestNavigate
(
this
INavigateAsync
navigation
,
Uri
target
,
INavigationParameters
regionParameters
)
{
if
(
navigation
==
null
)
throw
new
ArgumentNullException
(
nameof
(
navigation
));
navigation
.
RequestNavigate
(
target
,
nr
=>
{
},
regionParameters
);
}
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="navigation">The navigation object.</param>
/// <param name="target">A string that represents the target where the region will navigate.</param>
/// <param name="regionParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param>
public
static
void
RequestNavigate
(
this
INavigateAsync
navigation
,
string
target
,
INavigationParameters
regionParameters
)
{
if
(
navigation
==
null
)
throw
new
ArgumentNullException
(
nameof
(
navigation
));
if
(
target
==
null
)
throw
new
ArgumentNullException
(
nameof
(
target
));
navigation
.
RequestNavigate
(
new
Uri
(
target
,
UriKind
.
RelativeOrAbsolute
),
nr
=>
{
},
regionParameters
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录