Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lindexi_gd
Uno
提交
325864ff
U
Uno
项目概览
lindexi_gd
/
Uno
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
Uno
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
325864ff
编写于
6月 02, 2023
作者:
A
Andres Pineda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test(CommandBar): add native style manual test
上级
184187fb
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
150 addition
and
2 deletion
+150
-2
src/SamplesApp/UITests.Shared/Assets/closeIcon.png
src/SamplesApp/UITests.Shared/Assets/closeIcon.png
+0
-0
src/SamplesApp/UITests.Shared/Assets/filter.png
src/SamplesApp/UITests.Shared/Assets/filter.png
+0
-0
src/SamplesApp/UITests.Shared/UITests.Shared.projitems
src/SamplesApp/UITests.Shared/UITests.Shared.projitems
+11
-2
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBarViewModel.cs
...indows_UI_Xaml_Controls/CommandBar/CommandBarViewModel.cs
+14
-0
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Native_With_AppBarButton_Binding.xaml
...mmandBar/CommandBar_Native_With_AppBarButton_Binding.xaml
+47
-0
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Native_With_AppBarButton_Binding.xaml.cs
...ndBar/CommandBar_Native_With_AppBarButton_Binding.xaml.cs
+78
-0
未找到文件。
src/SamplesApp/UITests.Shared/Assets/closeIcon.png
0 → 100644
浏览文件 @
325864ff
382 字节
src/SamplesApp/UITests.Shared/Assets/filter.png
0 → 100644
浏览文件 @
325864ff
219 字节
src/SamplesApp/UITests.Shared/UITests.Shared.projitems
浏览文件 @
325864ff
...
...
@@ -1266,6 +1266,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\CommandBar_Native_With_AppBarButton_Binding.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\IconSourceTests\IconSourceElementTests.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
...
...
@@ -2905,7 +2909,7 @@
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ContentControlTestsControl\ContentControl_ComboBoxSetNull.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ContentControlTestsControl\ContentControl_FindName.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
...
...
@@ -5693,6 +5697,9 @@
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\BorderTests\BorderWithNullBrushAndNonZeroThickness.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\BorderTests\PanelWithNullBrushAndNonZeroThickness.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\CommandBar\CommandBar_Native_With_AppBarButton_Binding.xaml.cs">
<DependentUpon>CommandBar_Native_With_AppBarButton_Binding.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\ImageTests\ImageSourceWriteableBitmapInvalidate_Stretch.xaml.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Windows_UI_Xaml_Controls\IconSourceTests\IconSourceElementTests.xaml.cs">
<DependentUpon>IconSourceElementTests.xaml</DependentUpon>
...
...
@@ -8923,6 +8930,7 @@
<Content Include="$(MSBuildThisFileDirectory)Assets\cart.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\check.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\CheckBox.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\closeIcon.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\colored-ellipse.jpg" />
<Content Include="$(MSBuildThisFileDirectory)Assets\ColorPicker.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\colors300.png" />
...
...
@@ -8934,6 +8942,7 @@
<Content Include="$(MSBuildThisFileDirectory)Assets\Diagnostics\exclamation.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Diagnostics\movie_type_dbox.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\DropdownButton.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\filter.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\FlipView.png" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Fonts\Even Badder Mofo.ttf" />
<Content Include="$(MSBuildThisFileDirectory)Assets\Fonts\FamilyGuy-4grW.ttf" />
...
...
@@ -9088,4 +9097,4 @@
<Content Include="$(MSBuildThisFileDirectory)Assets\libre-camera-panorama.svg" />
</ItemGroup>
<Import Project="ItemExclusions.props" />
</Project>
</Project>
\ No newline at end of file
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBarViewModel.cs
浏览文件 @
325864ff
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Input
;
using
Uno.UI.Samples.UITests.Helpers
;
using
Windows.UI.Core
;
...
...
@@ -12,12 +13,15 @@ namespace Uno.UI.Samples.Presentation.SamplePages
private
string
_dynamicTitle
;
private
string
_dynamicSubTitle1
;
private
string
_dynamicSubTitle2
;
private
bool
_isChecked
;
public
CommandBarViewModel
(
CoreDispatcher
dispatcher
)
:
base
(
dispatcher
)
{
ToggleChecked
=
GetOrCreateCommand
(()
=>
IsChecked
=
!
IsChecked
);
StartData
();
}
public
ICommand
ToggleChecked
{
get
;
}
private
async
void
StartData
()
{
...
...
@@ -59,5 +63,15 @@ namespace Uno.UI.Samples.Presentation.SamplePages
_dynamicSubTitle2
=
value
;
RaisePropertyChanged
();
}
}
public
bool
IsChecked
{
get
{
return
_isChecked
;
}
set
{
_isChecked
=
value
;
RaisePropertyChanged
();
}
}
}
}
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Native_With_AppBarButton_Binding.xaml
0 → 100644
浏览文件 @
325864ff
<Page
x:Class="UITests.Windows_UI_Xaml_Controls.CommandBar.CommandBar_Native_With_AppBarButton_Binding"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UITests.Windows_UI_Xaml_Controls.CommandBar"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:xamarin="http://nventive.com/xamarin"
xmlns:ios="http://nventive.com/ios"
xmlns:android="http://nventive.com/android"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d xamarin ios android"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.Resources>
<Style x:Name="NativeCommandbarStyle"
TargetType="CommandBar"
xamarin:BasedOn="{StaticResource NativeDefaultCommandBar}">
<Setter Property="Background"
Value="Blue" />
<Setter Property="Foreground"
Value="White" />
</Style>
<local:FromNullableBoolToCustomValueConverter x:Key="IsCheckedToIcon"
TrueValue="ms-appx:///Assets/closeIcon.png"
NullOrFalseValue="ms-appx:///Assets/filter.png" />
</Page.Resources>
<StackPanel Background="White">
<xamarin:Grid>
<CommandBar Content="CommandBar with DataContext Set"
Style="{StaticResource NativeCommandbarStyle}"
Grid.Row="0">
<CommandBar.PrimaryCommands>
<AppBarButton Command="{Binding [ToggleChecked]}"
Label="Order"
Foreground="White">
<AppBarButton.Icon>
<BitmapIcon ShowAsMonochrome="True"
UriSource="{Binding [IsChecked], Converter={StaticResource IsCheckedToIcon}}" />
</AppBarButton.Icon>
</AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
</xamarin:Grid>
</StackPanel>
</Page>
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Native_With_AppBarButton_Binding.xaml.cs
0 → 100644
浏览文件 @
325864ff
using
System
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.IO
;
using
System.Linq
;
using
System.Runtime.InteropServices.WindowsRuntime
;
using
Uno.UI.Samples.Controls
;
using
Uno.UI.Samples.Presentation.SamplePages
;
using
Windows.Foundation
;
using
Windows.Foundation.Collections
;
using
Windows.UI.Xaml
;
using
Windows.UI.Xaml.Controls
;
using
Windows.UI.Xaml.Controls.Primitives
;
using
Windows.UI.Xaml.Data
;
using
Windows.UI.Xaml.Input
;
using
Windows.UI.Xaml.Media
;
using
Windows.UI.Xaml.Navigation
;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
namespace
UITests.Windows_UI_Xaml_Controls.CommandBar
{
[
SampleControlInfo
(
"CommandBar"
,
"Native_AppBarButton_Binding"
,
typeof
(
CommandBarViewModel
),
isManualTest
:
true
)]
public
sealed
partial
class
CommandBar_Native_With_AppBarButton_Binding
:
Page
{
public
CommandBar_Native_With_AppBarButton_Binding
()
{
this
.
InitializeComponent
();
}
}
public
class
FromNullableBoolToCustomValueConverter
:
IValueConverter
{
public
object
NullOrFalseValue
{
get
;
set
;
}
public
object
TrueValue
{
get
;
set
;
}
public
object
Convert
(
object
value
,
Type
targetType
,
object
parameter
,
string
language
)
{
if
(
parameter
!=
null
)
{
throw
new
ArgumentException
(
$"This converter does not use any parameters. You should remove \"
{
parameter
}
\" passed as parameter."
);
}
if
(
value
!=
null
&&
!(
value
is
bool
))
{
throw
new
ArgumentException
(
$"Value must either be null or of type bool. Got
{
value
}
(
{
value
.
GetType
().
FullName
}
)"
);
}
if
(
value
==
null
||
!
System
.
Convert
.
ToBoolean
(
value
,
CultureInfo
.
InvariantCulture
))
{
return
NullOrFalseValue
;
}
else
{
return
TrueValue
;
}
}
public
object
ConvertBack
(
object
value
,
Type
targetType
,
object
parameter
,
string
language
)
{
if
(
parameter
!=
null
)
{
throw
new
ArgumentException
(
$"This converter does not use any parameters. You should remove \"
{
parameter
}
\" passed as parameter."
);
}
if
(
object
.
Equals
(
this
.
TrueValue
,
this
.
NullOrFalseValue
))
{
throw
new
InvalidOperationException
(
"Cannot convert back if both custom values are the same"
);
}
return
this
.
TrueValue
!=
null
?
value
.
Equals
(
TrueValue
)
:
!
value
.
Equals
(
this
.
NullOrFalseValue
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录