Tag: windows 10

弹出窗口或弹出窗口以显示附加信息

我希望在我的应用程序顶部显示弹出窗口以及其他信息,我的信息是Listview有~500项我已经尝试过: flyout问题 – >它可能里面有scrollViewer,所以我的listview没有正确虚拟化其他一切正常。 有我的代码: Flyout myFlyout = new Flyout(); myFlyout.Placement = FlyoutPlacementMode.Full; myFlyout.Content = myListView; myFlyout.ShowAt(this); popup问题 – >它不居中,verticalAlignment不起作用,水平也不起作用 Popup myPopup = new Popup(); myPopup.Child = myListView; myPopup.IsOpen = true; 那么我应该走哪条路,尝试编辑弹出模板或通过设置垂直和水平偏移来居中弹出窗口? 或者有更好的方式来显示像窗口一样的弹出窗口,如项目列表或其他类似的信息

C#检测重音颜色更改WinRT XAML

我正在尝试检测Application.Resources资源字典中的更改,因此我可以在更新时自动将Titlebar更改为Accent Color。 所有XAML控件和元素都会自动更改,并且在将纯色画笔设置为DSDFS画笔的地址时,其内部值会更改。 这是我尝试用来检测更改的代码: public static DependencyProperty accent = DependencyProperty.Register(“DictChange”, typeof(ResourceDictionary), typeof(Shell), new PropertyMetadata(Application.Current.Resources, new PropertyChangedCallback(accent_PropertyChanged))); public ResourceDictionary DictChange { get { return (ResourceDictionary)GetValue(accent); } set { SetValue(accent, value); } } private static void accent_PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { _app.SetTitlebar(); } 我假设它错了,或者我不确定检测更改是否正确。 之前的迭代中,我使用Application.Current.Resources[“SystemControlBackgroundAccentBrush”] as SolidColorBrush并尝试检测其属性,但这也无效。 我究竟做错了什么? 请帮忙 :)

视觉工作室2015年建设需要很长时间

我从VS 2013开始到VS 2015,当我进行构建时,它需要90多秒左右。 有什么办法可以加快速度吗? (VS 2013花了大约10秒钟)。 另外,原因是什么? 我确实看到它在构建期间运行了一些额外的东西(我不认为2013年做了所有这些): 启动.NET Native编译 处理应用程序代码 计算应用程序关闭并生成互操作代码 编译互操作代码 生成序列化代码 清理未引用的代码 运行本机编译器

BackgroundTask UWP Windows 10 TimeTriggeredTask示例已注册但从未激活

我正在使用Scenario4测试后台示例,它从不调用Run,我按照步骤操作,这就是我所看到的: 1.-打电话后 BackgroundTaskRegistration task = builder.Register(); 该任务具有Trigger = null 它应该是之前指定的触发器吗? builder.SetTrigger(trigger); ? 2.-理论上,当我注册后台任务时,它应该出现在这里EventViewer – BackgroundTaskInfrastructure但它没有,应该出现在这里? 3.-尝试调试我的调试位置 – 暂停应用程序,但超过15分钟它永远不会到达,应该简单的暂停和等待? 我在里面添加了一个通知: var toastXML = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01); var toastTextElements = toastXML.GetElementsByTagName(“text”); toastTextElements.First().AppendChild(toastXML.CreateTextNode(“Hello World:”)); var toastNotification = new ToastNotification(toastXML); toastNotification.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(30); ToastNotificationManager.CreateToastNotifier().Show(toastNotification); 但它永远不会出现。 BackgroundTask和TimeTrigger一起工作吗?

XAML Designer未加载

我正在尝试为Windows 10开发通用应用程序,但XAML设计器无法加载。 我尝试重新安装Visual Studio但似乎没有任何工作。 错误 : System.Runtime.InteropServices.COMException 该应用程序没有启动。 (HRESULTexception:0x8027025B) Stacktrace : 在Microsoft.VisualStudio.DesignTools.HostUtility.AppPackage.AppPackageNativeMethods.IApplicationActivationManager.ActivateApplication(String appUserModelId,String activationContext,ActivateOptions options,Int32&processId) 在Microsoft.VisualStudio.DesignTools.HostUtility.AppPackage.DesignerWrtUtility.ActivateApplication(String appUserModelId,String activationContext,Object site,Boolean isRunningElevated) 在Microsoft.VisualStudio.DesignTools.HostUtility.Platform.AppContainerProcessDomainFactory.ActivateApplicationInternal(String appUserModelId,String activationContext,Object site) 在Microsoft.VisualStudio.DesignTools.HostUtility.Platform.AppContainerProcessDomainFactory.CreateDesignerProcess(String applicationPath,String clientPort,Uri hostUri,IDictionary environmentVariables,Int32&processId,Object&processData) 在Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.ProcessDomainFactory.ProcessIsolationDomain..ctor(ProcessDomainFactory factory,IIsolationBoundary boundary,AppDomainSetup appDomainInfo,IIsolationTarget isolationTarget,String baseDirectory) 在Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.ProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary) 在Microsoft.VisualStudio.DesignTools.HostUtility.Platform.AppContainerProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary) 在Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.IsolationBoundary.Initialize() 在Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.IsolationBoundary.CreateInstance [T](类型类型) 在Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolatedObjectFactory.Initialize() 在Microsoft.VisualStudio.DesignTools.DesignerHost.Services.VSIsolationService.CreateObjectFactory(IIsolationTarget isolationTarget,IObjectCatalog目录) 在Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget) 在Microsoft.VisualStudio.DesignTools.DesignerContract.IsolatedDesignerService.CreateLease(IIsolationTarget isolationTarget,CancellationToken cancelToken,DesignerServiceEntry&entry,IServiceProvider serviceOverrides) 在Microsoft.VisualStudio.DesignTools.DesignerContract.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken) 在Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolatedTaskScheduler.InvokeWithCulture [T](CultureInfo […]

`PrintQueue.AddJob`没有完成

我尝试在某些PC上使用代码。 using (var lps = new LocalPrintServer()) using(var pqueue = lps.GetPrintQueue(“PRINTER-NAME”)) { pqueue.AddJob(“job-name”, @”C:\example.xps”, false, pticket); } 仅在一台PC上,它无法正常工作。 该应用程序冻结在AddJob方法。 即使等了很长时间,它也从未结束。 没有例外。 出现此问题的PC是Windows10并应用了CreatorsUpdate。 其他PC是Windows7,Windows8.1和Windows10应用的AnniversaryUpdate。 这个问题是CreatorsUpdate的错误吗? 补充: 具有CreatorsUpdate的PC可以通过此代码打印xps文件。 using (var lps = new LocalPrintServer()) using(var pqueue = lps.GetPrintQueue(“PRINTER-NAME”)) using (var doc = new XpsDocument(@”C:\example.xps”, System.IO.FileAccess.Read)) { var writer = PrintQueue.CreateXpsDocumentWriter(pqueue); var docSeq = doc.GetFixedDocumentSequence(); writer.Write(doc, pticket); }

使用DateTime.ToString(“tt”)时,Windows 10中的时间输出(AM / PM)发生了变化

我最近升级到Windows 10 – 我现在看到使用“tt”格式说明符时日期输出中出现了一些意外的变化。 以下是一些演示此问题的代码: using System.IO; using System; using System.Globalization; using System.Threading.Tasks; class Program { static void Main() { var cultures = new string[] {null, “en-NZ”, “en-US”, “en-AU”, “en-GB”}; foreach (var culture in cultures) { if (culture != null) { var c = CultureInfo.GetCultureInfo(culture); System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture = c; } DateTime dt = new […]

Windows 10 UWP上的应用内购买问题

我正在尝试在我的应用上启用应用内购买项目(已在Windows 10商店中),但在尝试购买此商品时,我始终收到相同的错误消息: MyAppName中不再提供此应用内购买项目 代码非常简单,只是文档推荐的内容: var itemName = “app.advanced_items.full”; if (CurrentApp.LicenseInformation.ProductLicenses[itemName].IsActive) { return true; } var results = await CurrentApp.RequestProductPurchaseAsync(itemName); if (results.Status == ProductPurchaseStatus.Succeeded || results.Status == ProductPurchaseStatus.AlreadyPurchased) { return true; } else { return false; } 更多信息: 在文档告诉我之前,我在构建包之前创建并将应用内项目提交到商店 商店和应用程序上的项目名称相同(代码上的itemName ) 我在提交到商店之前尝试了这个 我提交到商店后尝试了这个(我的应用程序目前在那里破了! – 无法购买该商品) 我怀疑问题可能与以下内容有关: 应用程序显示名称(在Package.appxmanifest )与商店中的应用程序名称不同(我想要的名称不可用,因此我将其设置得更长,但安装后的应用程序将显示原始名称)。 这个较短的名称是错误消息中的名称… 我将“显示名称”更改为应用程序的全名,但错误是相同的。 我不知道是否将它发送到商店可能会改变这一点(我并不想为了测试这个理论而部署另一个错误的版本) 额外:我在网上找到的关于这个问题的唯一资源是无用的,与Windows 8相关: 链接 建议?

WPF桌面应用程序,Windows 10通知Toast 2016(UWP社区工具包)

我正在尝试使用我的WPF C#Desktop应用程序显示Windows 10 Toast。 可悲的是,关于非UWP或商店应用程序中的Windows 10通知的API和一般支持似乎非常有限和混乱。 最近发布了UWP社区工具包 ,它似乎试图让我们更容易。 还有这个商店应用程序Notifications Visualizer ,它可以帮助制作像这样的Toasts: 我接着尝试使用C#和UWP社区工具包提供的API生成Toast。 使用Microsoft.Toolkit.Uwp.Notifications; ToastContent toastContent = new ToastContent() { Visual = new ToastVisual() { BindingGeneric = new ToastBindingGeneric() { Children = { new AdaptiveText() { Text = “Matt sent you a friend request” }, new AdaptiveText() { Text = “Hey, wanna dress up as wizards […]

如何从源代码管理中丢失后生成新的.pfx文件?

我正在使用GitHub来托管我正在开发的开源Windows 10应用程序。 我不小心gitignored我的应用程序的PFX文件,所以当我删除我的本地副本并重新克隆回购时,我没有MyApp_TemporaryKey.pfx文件。 现在Visual Studio抱怨这个,我无法构建解决方案。 如何重新生成此文件以便我可以再次运行该应用程序? 谢谢你的帮助。