uwp

UWP C++: Writing only instead of reading to a global variable?

倾然丶 夕夏残阳落幕 提交于 2020-01-06 06:26:26
问题 I have a separate header file for where I declare global variables. I have included that header file in pch.h which is included in every .cpp file. #include "variable.h" I now need to call the variable and read it in an if statment to start some code. Before compilation, no errors are shown in Visual Studio. However, when I compile the code, it returns error: Error LNK2005 "bool ahschecked" (?ahschecked@@3_NA) already defined in checkin.xaml.obj pch.h The variable is "ahschecked" which is

Use SHGetKnownFolderPath() instead of ApplicationData class to get LocalAppData path

耗尽温柔 提交于 2020-01-06 06:00:34
问题 In an desktop-bridge app, I want to find the LocalAppData (or LocalCache) folder of that specific package. I can get the LocalCache folder path with ApplicationData class: using Windows.Storage; string appData = ApplicationData.Current.LocalCacheFolder.Path; Alternatively, if I use SHGetKnownFolderPath function I can also get that same path: wchar_t* appData; SHGetKnownFolderPath(FOLDERID_LocalAppData, KF_FLAG_FORCE_APP_DATA_REDIRECTION, NULL, &appData); So my question: Is it appropriate to

MvvmLightLibsStd10 and UWP

空扰寡人 提交于 2020-01-06 05:06:30
问题 How can you create a binding between a ViewModel and a View? In the past there was a Locater created in App.xaml and then on the view you had this: DataContext="{Binding MainViewModel, Source={StaticResource ViewModelLLocator}}" I can't even click in the Properties of the View and then create DataContext binding. 回答1: In recent versions of MVVM light they changed how ViewModelLocator works due to it taking a dependency on Microsoft.Practices.ServiceLocation and the former not being .NET

How to achieve LayoutTransform in UWP?

我怕爱的太早我们不能终老 提交于 2020-01-06 05:00:51
问题 I'm trying to transform a view as like LayoutTranform in WPF. Can we achieve LayoutTransform in UWP? 回答1: Is your question How to use layouttransform in uwp? I find this post and the answer can help you. The image is that I open the app and I click the button that rotate image. The rotate image. The first thing is create a class. using System; using System.Diagnostics.CodeAnalysis; using Windows.Foundation; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media;

SignalR class library for both UWP and WPF

陌路散爱 提交于 2020-01-06 04:59:06
问题 I'm interested in writing a class library that can be consumed from both a UWP application and a WPF (desktop) application. This library will incorporate SignalR to allow those two application types to function as servers pushing data. The client will most likely be another UWP application. According to Microsoft in such cases the class library should target .NET Standard. My current understanding is that .NET Core is an implementation of the .NET Standard. Since SignalR has now been included

Image resource not available at runtime

谁说我不能喝 提交于 2020-01-06 04:08:27
问题 Windows 10, UWP, C#, VS2015: I am trying to set a FallbackValue=ms-appx:///Assets/image.png in Xaml That works well when running the app within Vs2015. However, when creating a store package, the installed version does not display the image at all. What could go wrong? The same scenario worked well in Win8 来源: https://stackoverflow.com/questions/33431135/image-resource-not-available-at-runtime

How to make comboBox as Editable in UWP?

荒凉一梦 提交于 2020-01-06 02:51:07
问题 Is there any property available to make comboBox as Editable in UWP. Please share your opinion. 回答1: You might be able to use the AutoSuggestBox instead, although this doesn't behave exactly like an editable ComboBox 回答2: Use IsEditable="True" property in ComboBox 回答3: UWP ComboBox is not editable. You can chose items only through drop down. Instead you can try with Syncfusion's SfComboBox. 来源: https://stackoverflow.com/questions/37693230/how-to-make-combobox-as-editable-in-uwp

TrySetWallpaperImageAsync() always returns false

时光毁灭记忆、已成空白 提交于 2020-01-06 02:44:06
问题 I'm trying to set the wallpaper to an image on my Windows 10 device: var fileName = postInf.title + ".jpg"; BitmapImage img = new BitmapImage(); bool success = false; if (UserProfilePersonalizationSettings.IsSupported()) { // read from pictures library var pictureFile = await KnownFolders.PicturesLibrary.GetFileAsync(fileName); using (var pictureStream = await pictureFile.OpenAsync(FileAccessMode.Read)) { img.SetSource(pictureStream); } UserProfilePersonalizationSettings profileSettings =

Exif tags on universal Windows Platform C#

佐手、 提交于 2020-01-06 01:35:07
问题 How do I add Tags to a jpeg picture on UWP (universal Windows Platform) / Windows Phone 10. WindowsBase and PresentationCore not available. 回答1: Here is an example about how to write the Artist exif tag to a jpeg image in Windows Runtime. You can find all of the EXIF tag ids in this web page: http://www.exiv2.org/tags.html var src = await KnownFolders .PicturesLibrary .GetFileAsync("210644575939381015.jpg"); using (var stream = await src.OpenAsync(FileAccessMode.ReadWrite)) { var decoder =

Unity 3D UWP build fails: System.Xml cannot be found

匆匆过客 提交于 2020-01-05 12:16:14
问题 I am trying to build my project for UWP, HoloLens to be specific. I am getting XML data from the web and parse that using NewtonSoft.JsonConvert.SerializeXmlNode (XmlNode node) (returns string). Here's a list of stuff you need to know and stuff that I tried already: My Unity version is 2018.1.3f1, Scripting Runtime Version is .NET 4,x Equivalent, Scripting Backend is Mono, API Comp. Lvl is .NET 4.x as well. The exact error message: Assets\Scripts\RestManager.cs(62,23): error CS7069: Reference