windows-10-universal

Target code for a specific version of Windows 10, like Build 10586

纵饮孤独 提交于 2019-12-12 12:27:51
问题 As you know ElementCompositionPreview.GetElementVisual is accessible on Windows 10 Build 10586, I would like to have one application that can target both Build 10586 and Build 10240. Does anyone have an idea of how I could use Compositor and ElementCompositionPreview.GetElementVisual when the application is running on Build 10586 and something else when it is running the build 10240. Something like this: #if WINDOWS_UWP Build 10586 _compositor = new Compositor(); _root =

Calling web service asynchronously in page constructor

喜你入骨 提交于 2019-12-12 12:09:28
问题 I need to load data on a XAML page in a windows 10 UWP application. For that I wrote code to call the web service in async task function, and I call this in page constructor. Could you please tell best way to do this? Following is my code. public sealed partial class MyDownloads : Page { string result; public MyDownloads() { this.InitializeComponent(); GetDownloads().Wait(); string jsonstring = result; //code for binding follows } private async Task GetDownloads() { JsonObject jsonObject =

how can i use the file that is generated by xsd.exe in windows 10 universal app

馋奶兔 提交于 2019-12-12 11:29:07
问题 I am generating .cs files from .xsd files using xsd.exe. But when I am adding the files to windows 10 universal blank app, I was getting error as "missing an assembly reference" for System.SerializableAttribute() and System.ComponentModel.DesignerCategoryAttribute(‌​"‌​code"). I fixed this by @t.ouvre's trick. Then there were no errors in any of the particular line of the code but when i am building the code i am getting an error saying that " Cannot find type System.ComponentModel

Webview BaseURL in Xamarin.Forms on UWP and Windows Phone 8.1

江枫思渺然 提交于 2019-12-12 11:12:48
问题 In my shared portable Xamarin project, this works on UWP, Windows Phone 8.1 and Windows 8.1: HtmlWebViewSource htmlSource = new HtmlWebViewSource(); htmlSource.Html = @"<html><body><img src='ms-appx-web:///Assets/somePicture.png' /></body></html>"; htmlSource.BaseUrl = DependencyService.Get<IBaseUrl>().Get(); WebView webView = new WebView { Source = htmlSource, }; Obviously, this isn't cross-platform (iOS and Android). I want this, but it doesn't work on UWP, Windows Phone 8.1 and Windows 8.1

Bundle WCF service along with Universal Windows App

…衆ロ難τιáo~ 提交于 2019-12-12 06:45:41
问题 I realize that we cannot directly access SQL Server database from a UWP app, and have to use a WCF service as a mediator for this. (Which is totally stupid, since even competitors like MySQL provides API for Microsoft's runtime, while Microsoft's own RDBMS does not!) I don't have any experience with WCF, but after going through some tutorials, I believe I can make a WCF service to communicate with my SQL Server (although I do not like making my simple application use a 3-tier architecture,

How to fill a Win10 XAML Polygon with tiles?

可紊 提交于 2019-12-12 05:59:13
问题 I am trying to make XAML Polygon filled with a transformed texture. The code worked well in WPF but in a Windows 10 app there seems to be no TileMode property. <Polygon Points="300,200 400,125 400,275" Stroke="Purple" StrokeThickness="2"> <Polygon.Fill> <ImageBrush TileMode="Tile" ImageSource="Assets/StoreLogo.png"> <ImageBrush.RelativeTransform> <TransformGroup> <ScaleTransform CenterY="0.5" CenterX="0.5" ScaleX="0.2" ScaleY="0.2"/> <SkewTransform CenterY="0.5" CenterX="0.5"/>

Background task in UWP

三世轮回 提交于 2019-12-12 04:46:08
问题 I want to use a background task for my UWP app. The below code, is my back button click event in windows mobile: private async void MainPage_BackRequested(object sender, BackRequestedEventArgs e) { var access= await BackgroundExecutionManager.RequestAccessAsync(); var task = new BackgroundTaskBuilder { Name="My task",TaskEntryPoint=typeof(backGroundTask.Class1).ToString() }; trigger = new ApplicationTrigger(); task.SetTrigger(trigger); task.Register(); //var result = await trigger

How to save WebViewBrush as image? (UWP / Universal)

假如想象 提交于 2019-12-12 04:25:55
问题 Summary: I have a collection FrameworkElements (basically web view brushes drawn on rectanlges), and I'd like to save each of these as a PNG file in my UWP app. More details: I followed the example at https://stackoverflow.com/a/17222629/2884981 to split the content of a WebView into separate "pages". I've put the main bits of code at the bottom. At the bottom of GetWebPages() I have return pages; At this point I have a list of all the "pages". What I'd like to do, is then convert each of

Manipulation events of MediaElement not fire when on FullWindows mode

筅森魡賤 提交于 2019-12-12 04:08:04
问题 When I set player not in fullscreen (player.IsFullWindows = false), event work normally but when change player to full screen all manipulation event not work. Anyone have solution? <MediaElement Name="player" Margin="10,5" ManipulationCompleted="player_ManipulationCompleted" ManipulationDelta="Grid_ManipulationDelta" ManipulationMode="TranslateX" > 回答1: I can reproduce this scenario by enabling both the IsFullWindow="True" and the AreTransportControlsEnabled="True" . I think it makes sense,

UWP Unable to register app for Windows Store release

隐身守侯 提交于 2019-12-12 03:49:56
问题 I have a C# app targeting UWP Desktop & Mobile platforms. I want to run WACK tests prior to submitting app to store. I am trying to create app package by following the steps mentioned in this MSDN page When ever I try to reserve a name for my app, I am getting the following error: An unexpected error occurred when attempting to reserve the app name Since the error info is not very useful, I am clueless as to what is going wrong. I tried with several different name but every time I get the