我什么时候应该使用Command
和何时使用该Click
活动?
如果Button
我的UWP应用程序中有我应该使用的是什么?
我正在使用AppVeyor CI构建我的UWP应用程序,并希望在每次构建期间创建一个APPX包.但是我.gitignore
是忽略了Package.StoreAssociation.xml
和MyAppName_StoreKey.pfx
我想在APPX包中包括他们正在确定在Windows商店我的应用程序.
有没有办法使用PowerShell或MSBuild或类似的东西获取这些文件?换句话说,是否有任何命令行等同于Project > Store > Associate App with the Store...
向导?
我知道我可以将这些文件作为安全文件上传到repo,但我更喜欢从开发中心获取每个版本的最新文件.
我正在调用:FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
在我的 uwp 应用程序中启动 win32 应用程序。然后我尝试打开 uwp 和 win32 应用程序之间的连接,并将消息从 uwp 发送到 win32。我创建一个ValueSet valueSet = new ValueSet();
但在编译时,它会抱怨:
Error CS0433 The type 'ValueSet' exists in both
'Windows.Foundation.FoundationContract, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=null, ContentType=WindowsRuntime' and 'Windows,
Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'
Run Code Online (Sandbox Code Playgroud)
我确实手动添加了引用以便C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Windows.winmd
能够调用 FullTrustProcessLauncher,并且我相信我想使用ValueSet
this 内部的内容Windows.winmd
。
我很困惑它在哪里Windows.Foundation.FoundationContract
,它在我的项目中怎么样?我怎样才能删除它?
谢谢!
我的应用程序使用 ContentDialog 作为数据插入的方式。换句话说; 数据形式是一个ContentDialog。在验证用户输入期间,应用程序应使用 MessageDialog 向用户提示任何错误。但是,关闭 MessageDialog 也会关闭 ContentDialog。
这是显示警报时的代码块:
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
//save item
ValidateForm();
}
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}
private async void ValidateForm()
{
//Ensure all fields are filled
String barcode = BarcodeText.Text.Trim();
String desc = DescText.Text.Trim();
String cost = CostText.Text.Trim();
String price = PriceText.Text.Trim();
String stock = StockText.Text.Trim();
if(barcode.Equals(String.Empty) || desc.Equals(String.Empty) ||
desc.Equals(String.Empty) || cost.Equals(String.Empty) ||
price.Equals(String.Empty) || stock.Equals(String.Empty))
{
var dialog = new MessageDialog("Please fill in all fields"); …
Run Code Online (Sandbox Code Playgroud) 我是UWP的新手,并且在一天中的大部分时间都在努力应该是一些简单的XAML,但我无法按照我想要的方式进行布局.我想要实现的目标如下所示.
在第1列中水平和垂直居中的单个文本.在第2列中左对齐的2个文本.在第3列中水平和垂直居中的单个文本.
这是我到目前为止的XAML.我知道我需要使用列,但即使在尝试这样做时,我根本无法获得正确的布局.
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TramTimes"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Class="TramTimes.ServicesPage"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<ListView x:Name="list" IsItemClickEnabled="False" SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<StackPanel>
<TextBlock Text="{Binding Destination}"/>
<TextBlock Text="{Binding Company}"/>
</StackPanel>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Page>
Run Code Online (Sandbox Code Playgroud)
感谢任何帮助,使列表看起来像我需要的方式.
编辑
这是我现在使用的代码和我得到的结果 - 任何人都可以帮助我让网格填满整个列表的宽度?
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TramTimes"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Maps="using:Windows.UI.Xaml.Controls.Maps"
x:Class="TramTimes.ServicesPage"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Maps:MapControl x:Name="map" Height="300" VerticalAlignment="Top"/>
<ListView x:Name="list" IsItemClickEnabled="False" Margin="0,300,0,0" SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3.5*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Scheduled}"/>
<StackPanel Grid.Column="2"> …
Run Code Online (Sandbox Code Playgroud)