所以,我刚刚开始使用Windows应用程序,有一些我无法按照自己的意愿工作(可能是因为我找不到任何样本,而且Channel9视频没有覆盖我的情况).
从这篇文章开始,我决定"重新定位"技术是适合我的app从大屏幕移动到较小屏幕的技术.
我所做的是使用a StackPanel并使用两个AdaptiveTriggers 改变其方向(一个用于0宽度,另一个用于720,基于此处的表格).
这种方式有效,但我会用一些丑陋的油漆编辑截图来说明一些问题.
这就是当我处于这种BigScreen情况时会发生的情况,那里有足够的空间让A和B同时在同一行上.这里的问题是B应该占据剩余的全部宽度,覆盖所有蓝色部分.

第二个问题与调整大小有关.当没有足够的空间时,绿色部分会被切割而不是调整大小(您可以看到右侧边框消失).在使用StackPanel布局响应之前没有发生这种情况.

最后,当我们处于这种SmallScreen情况时,方向变为垂直方向,我们遇到与第一个相同的问题:绿色部分的高度不会填满屏幕.

这是XAML用于页面的:
<Page
x:Class="Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WifiAnalyzerFinal.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mvvm="using:Mvvm"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SmallScreen">
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="StackPanel.Orientation"
Value="Vertical"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="BigScreen">
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="720"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="StackPanel.Orientation"
Value="Horizontal"/>
<Setter Target="Rect.Width"
Value="200"/>
<Setter Target="Rect.Height"
Value="Auto"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<StackPanel Orientation="Vertical"
Background="Blue"
x:Name="StackPanel">
<Rectangle Fill="Red"
Height="50" …Run Code Online (Sandbox Code Playgroud) 这是详细信息:
我首先得到以下错误:
错误:DEP3321:要部署此应用程序,您的部署目标应运行Windows Universal Runtime版本10.0.10240.0或更高版本.您当前运行的是版本10.0.10166.0.请更新您的操作系统,或将部署目标更改为具有相应版本的设备.
现在我在这里找到了第一个错误的解决方案,所以我在App1.csproj文件中更改了以下内容:
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
Run Code Online (Sandbox Code Playgroud)
至
<TargetPlatformMinVersion>10.0.10166.0</TargetPlatformMinVersion>
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试将应用程序部署到手机时,我收到以下错误,但我找不到解决方案:
Error : DEP0001 : Unexpected Error: Element not found. (Exception from HRESULT: 0x80070490)
Run Code Online (Sandbox Code Playgroud)
任何人都知道如何解决这个问题?我可以将应用程序部署到模拟器,而不是运行Windows 10的物理手机.
windows-phone windows-phone-8.1 visual-studio-2015 windows-10-mobile
我使用下面的代码来隐藏UWP中的状态栏.当我在计算机中以开发模式运行应用程序时,状态栏不会显示在Windows Phone中.我在Windows应用商店中部署了应用,在下载应用后,我看到状态栏出现在我的应用中.
这是我的代码:
var isAvailable = Windows.Foundation.Metadata.ApiInformation.IsTypePresent(typeof(StatusBar).ToString());
if (isAvailable)
hideBar();
async void hideBar()
{
StatusBar bar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
await bar.HideAsync();
}
Run Code Online (Sandbox Code Playgroud)
问题是,为什么上面的代码不适用于Windows商店?此外,我有链接到我的应用程序链接在Windows商店,但当我在Windows商店中搜索确切的关键词时,我的应用程序没有显示在Windows商店中,但点击链接将在窗口商店中显示我的应用程序.
谢谢!
我们公司正在开发一个我们想要在"企业"中分发的通用Windows平台(Windows 10)应用程序.我们不希望通过Windows应用商店公开它.在正常情况下,设备是不受管理的("带上您自己的设备").
对于Windows Phone 8,我们使用从Symantec购买的Mobile Enterprise证书对我们的应用程序进行了签名.然后我们将文件与注册令牌一起分发.安装过程分为两步,非常简单.我还没有发现可以应用于UWP应用程序的内容.
UWP与Windows 10 Mobile有类似的流程吗?
我尝试过:我在Visual Studio中找到右键单击,存储,创建应用程序包...以创建具有appx扩展名的包.我还读到你应该在手机的"设置"下启用Sideload应用程序.但如何通过无线电话安装手机?
只是尝试从Web服务器下载appx文件不起作用.(刚刚下载了该文件,并且不知道如何打开它.)
deployment win-universal-app visual-studio-2015 windows-10-mobile
我想将本地存储的文件读入字节数组.我怎么做?这是我的尝试:
StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(filePath);
var file = await folder.GetFileAsync(filePath);
var buffer = await FileIO.ReadBufferAsync(file);
DataReader dataReader = Windows.Storage.Streams.DataReader.FromBuffer(buffer);
// doesn't work because ReadBytes wants a byte[] as parameter and also isn't asynchronous
byte[] result = dataReader.ReadBytes(buffer.Length);
Run Code Online (Sandbox Code Playgroud) 我的应用需要内部日历.我可以像这样创建一个新日历:
var store = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AppCalendarsReadWrite);
var cacheCalendar = await store.CreateAppointmentCalendarAsync("unique name here");
Run Code Online (Sandbox Code Playgroud)
这成功了,我得到了一个新日历.但是这个日历在手机的内置日历应用程序中可见.我不希望这个日历可见,因为它是内部簿记.
所以我试着像这样隐藏日历:
var store = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AppCalendarsReadWrite);
var cacheCalendar = await store.CreateAppointmentCalendarAsync("unique name here");
cacheCalendar.IsHidden = true; // <---- make calendar hidden
await cacheCalendar.SaveAsync(); // <---- save; error here
Run Code Online (Sandbox Code Playgroud)
在调用时SaveAsync我得到以下异常:
访问被拒绝.(HRESULT异常:0x80070005(E_ACCESSDENIED))"
为什么我无法在内置手机日历应用程序中隐藏我的日历?这是一个无证件限制吗?还有其他方法吗?
(注意:我在Windows 10 Mobile以及桌面Win 10上测试了这个 - 同样的错误.)
编辑/添加:由于Anthony发现该IsHidden属性在MSDN中被记录为只读,因此Visual Studio中的屏幕截图显示了公共setter(使其编译,运行并且看似合法的调用):
(该应用程序针对的是Win 10 Build 10586 - 也许它是新的,但尚未完成?)
windows-10 windows-10-mobile uwp windows-10-universal uwp-xaml
在Visual Studio 2015 Update 3中,我创建了一个JavaScript -> Windows -> Windows 8 -> Windows Phone -> Blank App (Windows Phone)项目.然后我改变了default.html包含这样的<select>元素:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>App1</title>
<!-- WinJS references -->
<!-- At runtime, ui-themed.css resolves to ui-themed.theme-light.css or ui-themed.theme-dark.css
based on the user’s theme setting. This is part of the MRT resource loading functionality. -->
<link href="/css/ui-themed.css" rel="stylesheet" />
<script src="//Microsoft.Phone.WinJS.2.1/js/base.js"></script>
<script src="//Microsoft.Phone.WinJS.2.1/js/ui.js"></script>
<!-- App1 references -->
<link href="/css/default.css" rel="stylesheet" />
<script …Run Code Online (Sandbox Code Playgroud) 从我的应用程序,我使用StoredContact和创建联系人ContactStore,使用KnwonContactProperties.MobileTelephonevia 设置手机号码GetPropertiesAsync.
这很好,我可以看到People中的手机号码.
但...
如果我尝试访问编程通过接触ContactManager.RequestStoreAsync,我没有看到contact.Phones收集这个电话号码.
有没有办法让数字写入Phones系列?
(相关问题)
使用Windows Phone 8.1,下一行运行良好,但现在当用户更换为Windows 10手机时,设备出现故障.
ProductLicense inAppLicense = CurrentApp.LicenseInformation.ProductLicenses["Keyfor"];
Run Code Online (Sandbox Code Playgroud)
正如前面提到的,WP 8.1非常适用,许可信息被很好地读取和存储.现在使用Windows 10手机,该行只会产生异常.
"来自HRESULT的异常:0x803F6107".
与真实设备以及仿真器的结果相同.
那么,如何LicenseInformation从具有WP 8.1项目环境的Windows 10手机(即使用8.1项目制作的代码)中检查?