uwp

How to use System.Console in UWP

我们两清 提交于 2019-12-20 07:09:52
问题 I want to use windows console in UWP. I know that there is System.Diagnostic.Debug but it provides me only methods to display message in windows console and I want to read from the console. 回答1: System.Console is not available for UWP apps. If you want to create console app, use .NET Framework or .NET Core not Universal Windows Platform. The System.Diagnostics.Debug class is just for debugging purposes and users don't see its output. However there are many other ways how to get user's input

C# UWP ListView remove all visual effects

浪尽此生 提交于 2019-12-20 07:04:43
问题 In UWP I have a listview. XAML: <Grid Background="Gray"> <ListView Name="lvMain" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="120" ItemsSource="{x:Bind ItemsList, Mode=OneWay}"> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsStackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemTemplate> <DataTemplate x:DataType="x:Int32"> <Grid Width="100" Height="100" Padding="10"> <Grid Background="Green"/> </Grid> </DataTemplate> </ListView

C# UWP ListView remove all visual effects

一个人想着一个人 提交于 2019-12-20 07:04:20
问题 In UWP I have a listview. XAML: <Grid Background="Gray"> <ListView Name="lvMain" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="120" ItemsSource="{x:Bind ItemsList, Mode=OneWay}"> <ListView.ItemsPanel> <ItemsPanelTemplate> <ItemsStackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemTemplate> <DataTemplate x:DataType="x:Int32"> <Grid Width="100" Height="100" Padding="10"> <Grid Background="Green"/> </Grid> </DataTemplate> </ListView

Cannot get file sent from UWP app using Windows.Web.Http to WebAPI web service controller

余生长醉 提交于 2019-12-20 06:47:50
问题 I have the following code on my Windows 10 UWP app to send a file to a WebAPI web service. public async void Upload_FileAsync(string WebServiceURL, string FilePathToUpload) { //prepare HttpStreamContent IStorageFile storageFile = await StorageFile.GetFileFromPathAsync(FilePathToUpload); IRandomAccessStream stream=await storageFile.OpenAsync(FileAccessMode.Read); Windows.Web.Http.HttpStreamContent streamContent = new Windows.Web.Http.HttpStreamContent(stream); //send request var myFilter = new

UWP StackedLineSeries doesn't show values

廉价感情. 提交于 2019-12-20 06:45:42
问题 I am trying to use WinRTXamlToolkit.Controls.DataVisualization.UWP trying to draw any of the stacked charts like this: But only this comes out: Please help me, I have to use stacked series but the framework doesn't act as it should be.. 回答1: Since I don't know how you define the code behind, I just provide the sample code as follows which can create a StackedLineSeries chart successfully. XAML Code <Page x:Class="CStackLineChat.MainPage" ... xmlns:charting="using:WinRTXamlToolkit.Controls

Getting “a function that returns 'auto' cannot be used before it is defined” while using CoreDispatcher::RunAsync in C++/WinRT project

送分小仙女□ 提交于 2019-12-20 06:33:30
问题 In my C++/WinRT project, I am trying to run some code on UI thread but getting an error that says: "winrt::impl::consume_Windows_UI_Core_ICoreDispatcher<winrt::Windows::UI::Core::ICoreDispatcher>::RunAsync': a function that returns 'auto' cannot be used before it is defined" I am invoking the method like this: Dispatcher().RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, [=]() { // Code to be executed. }); The implementation is coming from auto generated winrt file which returns

How can used semantic zoom for 3 level in UWP?

与世无争的帅哥 提交于 2019-12-20 06:32:29
问题 I want to use semantic zoom (or its effect) for selecting a location in my UWP Application. I want to select the county first, and second select city, and third select the location. Has anyone a true idea about this? I searched multiple zooms for semantic zoom, but it's apparently impossible. I used two semantic zoom parallax, but that has its problems also. Can anyone help? 回答1: I found my solution, https://blogs.msdn.microsoft.com/shashankyerramilli/2014/02/14/implementing-a-custom-semantic

How do i add data from XML to list<>?

淺唱寂寞╮ 提交于 2019-12-20 06:29:39
问题 I try to read from an xml file, but its very clonky and a lot of the data I get is in bunch from a child. I get the Name, Age, and so on in one and therefor I can't add it to a list. My xml-file looks like this: <?xml version="1.0" encoding="UTF-8"?><People> <Person> <Age>30</Age> <Name>Boy</Name> <Sex>Male</Sex> </Person> <Person> <Age>28</Age> <Name>Girl</Name> <Sex>Female</Sex> </Person> And in my xaml.cs file I have: List<listTest> a = new List<listTest>(); var localFolder =

StartupTask class is not recognized

好久不见. 提交于 2019-12-20 06:17:34
问题 I'm trying to get my Centennial application to autostart on logon. According to this post that can be done. But then to disable it programmatically I'd need to use the Windows.ApplicationModel.StartupTask class and Visual Studio refuses to recognize it. So how is that class used? 回答1: You need to add a reference to the Desktop Extension SDK. 来源: https://stackoverflow.com/questions/45849937/startuptask-class-is-not-recognized

UWP: How can I attach an image to an InkCanvas?

社会主义新天地 提交于 2019-12-20 06:00:12
问题 I have to capture a photo with camera or loading it from file into a canvas which should be edited for highlighting some stuff on it after that saved into a folder. As for now I use this: <Grid x:Name="grid"> <Image Source="/Assets/stainless-images-110606.jpg" x:Name="ImageToEdit" Stretch="Uniform" /> <StackPanel Background="LightGreen" Width="700" Height="700" x:Name="StackPanel"> <InkCanvas x:Name="MyInkCanvas" Width="{Binding Width, ElementName=StackPanel}" Height="{Binding Height,