我有一个来自另一个项目的SQLite数据库,我想在UWP应用程序中使用它.但我不知道如何将这个数据库导入到项目中!
我希望我的通用应用程序位于屏幕中央。我知道使用 windows 窗体很容易,但不知道如何在通用 windows 应用程序中做到这一点。
谢谢
我为Windows 10构建了一个通用应用程序,我不知道Native Tool链.当我准备创建包时,我遇到了很多错误,我找不到任何运气的解决方案.
经过几次尝试后,我决定将我的应用程序一块一块地放在一个测试项目中,看看出了什么问题,我添加了Mvvm Light 5.2的ViewModelLocator后出现了以下错误:
NUTC300F:Internal Compiler Error: Native compilation failed due to out of memory error
ILT0005: 'C:\Program Files (x86)\MSBuild\Microsoft\.NetNative\x86\ilc\Tools\nutc_driver.exe
@"C:\...\Test\obj\x86\Release\ilc\intermediate\MDIL\Test.rsp"' returned exit code 1
Warning Method 'CreateLambda' within 'System.Linq.Expressions.Expression' could not be found.
C:\....\Test\Resources.System.Linq.Expressions.rd.xml 35
Warning Method 'ParameterIsAssignable' within 'System.Linq.Expressions.Expression' could not be found.
C:\....\Test\Resources.System.Linq.Expressions.rd.xml 91
Run Code Online (Sandbox Code Playgroud)
这是我的ViewModelLocatorClass
public class ViewModelLocator
{
public const string HeroDetailsPageName = "HeroDetails";
public ViewModelLocator()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
var nav = new NavigationService();
nav.Configure(HeroDetailsPageName, typeof(HeroDetails));
SimpleIoc.Default.Register<INavigationService>(() => nav);
SimpleIoc.Default.Register<IDialogService, DialogService>();
if (ViewModelBase.IsInDesignModeStatic) …Run Code Online (Sandbox Code Playgroud) 目前,我正在设置请求消息的User-Agent,如下所示:
var rm = new HttpRequestMessage(HttpMethod.Post, new Uri("http://example.com"));
rm.Headers.Add("User-Agent", "UserAgentString");
webView.NavigateWithHttpRequestMessage(rm);
Run Code Online (Sandbox Code Playgroud)
一切都按预期工作.
但是,当我导航到另一个页面时,例如,通过单击站点上的链接,用户代理将重置为默认值WebView.
有没有办法永久设置用户代理或在每次请求时更改它?
谢谢,乔治
c# httprequest webview win-universal-app windows-10-universal
我想打开当前应用程序的Windows应用商店(因此用户可以对应用进行评级/评论).在这样做时,我需要获取App ID.但是,我在SO中看到这篇文章说CurrentApp.AppId需要花费很多时间,并提供Package ID作为替代.我以前从未在Windows应用商店上发布应用,如果没有在Windows应用商店发布/发布的应用,则无法立即测试.
任何人都可以帮我确认以下两行代码吗?
//var appId = CurrentApp.AppId.ToString();
var appId = Windows.ApplicationModel.Package.Current.Id;
Run Code Online (Sandbox Code Playgroud) windows-store-apps win-universal-app uwp windows-10-universal
我使用http://www.codeproject.com/Tips/552141/Csharp-Image-resize-convert-and-save中的代码以编程方式调整图像大小.但是,该项目使用的System.Drawing库是Windows 10应用程序无法使用的.
我尝试过使用BitmapImage该类Windows.UI.Xaml.Media.Imaging,但它似乎没有提供在System.Drawing... 中找到的功能.
有没有人能够在Windows 10中调整大小(缩小)图像?我的应用程序将处理来自多个源,不同格式/大小的图像,我试图调整实际图像的大小以节省空间,而不是让应用程序调整大小以适应Image它的显示位置.
编辑
我已经修改了上面提到的链接中的代码,并且有一个hack可以满足我的特定需求.这里是:
public static BitmapImage ResizedImage(BitmapImage sourceImage, int maxWidth, int maxHeight)
{
var origHeight = sourceImage.PixelHeight;
var origWidth = sourceImage.PixelWidth;
var ratioX = maxWidth/(float) origWidth;
var ratioY = maxHeight/(float) origHeight;
var ratio = Math.Min(ratioX, ratioY);
var newHeight = (int) (origHeight * ratio);
var newWidth = (int) (origWidth * ratio);
sourceImage.DecodePixelWidth = newWidth;
sourceImage.DecodePixelHeight = newHeight;
return sourceImage;
}
Run Code Online (Sandbox Code Playgroud)
这种方式似乎工作,但理想情况下,而不是修改原始BitmapImage,我想创建一个新的/副本来修改和返回.
刚刚安装了HoloLens仿真器的VS2015 Update 2中创建了默认项目Holographic DirectX11 App(通用Windows)并点击了F5.
HoloLens模拟器开始加载,但在某些时候
模拟器无法连接到设备操作系统:模拟器无法确定用于与来宾虚拟机通信的主机IP地址.某些功能可能已被禁用.
我可以从Hyper-V管理器启动模拟器并连接到它,但屏幕没有响应鼠标点击并停留在开始菜单(如果我从VS2015启动它,模拟器窗口中的相同图片,但在开头有这个错误消息) :
有什么想法吗?
c# win-universal-app visual-studio-2015 windows-10-universal hololens
从Microsoft Build 2016的亮点,我看到微软推出了新的Ink API.
牛仔裤链接指的是自定义识别.这是我在找什么?我觉得应该有一个选项来添加符号到查找字典.
我的应用需要内部日历.我可以像这样创建一个新日历:
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
我收到此错误:“ 应用安装程序无法安装程序包依赖项。在 Windows10客户端计算机中通过应用安装程序侧加载.appxbundle文件时,向Microsoft.VCLibs.140.00.Debug程序包询问开发人员,但是在我的(开发人员)的机器,没有任何问题。我正在使用Visual Studio 2017进行开发。在Google中找不到任何相关内容。有人帮忙.. !!
c# ×5
uwp ×5
windows-10 ×3
.net-native ×1
appx ×1
hololens ×1
httprequest ×1
image ×1
latex ×1
sideloading ×1
sqlite ×1
uwp-xaml ×1
webview ×1