win-universal-app

Reference native c++ dll in UWP project

纵然是瞬间 提交于 2019-12-25 03:26:40
问题 I have a c++ dll that I want to utilize in the UWP project that I am working on. I need some assistant on how to achieve that. 回答1: C++ doesn't have a concept of "referencing DLLs". All you need to do to use them is to make sure they're copied next to your executable when you build your app. If you're using Visual Studio C# project (.csproj), add it to it as "Content" type: <ItemGroup Condition="'$(Platform)' == 'x86'"> <Content Include="$(ProjectDir)MyDLL\x86\MyDLL.dll">

How to access and change the values of Resources in Resource Dictionary at runtime in Windows Universal Apps?

放肆的年华 提交于 2019-12-24 23:27:55
问题 I am migrating my Windows Phone 8 App to Windows Universal Apps. I have created a Resource Dictionary with some values in Windows 8.1 project and included its path in App.xaml file. Below is Resource Dictionary and App.xaml. Resource Dictionary <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:MyApp.Styles"> <SolidColorBrush Color="#388941" x:Key="AppBackGroundColor" />

Populate ComboBox items and SelectedValue in a ComboBox that is within a GridView DataTemplate

 ̄綄美尐妖づ 提交于 2019-12-24 21:19:34
问题 I am developing a Windows 10 Universal App and I have trouble getting items to populate in a ComboBox (both ComboBox items and SelectedValue) that is within a GridView DataTemplate. I don't seem to be able to find a way to do this. Here are the details: I have an object ( UserData ) that can contain multiple instances of another object ( List<VisitedCity> ). On the XAML page, the multiple instances of VisitedCity are shown on a vertical GridView. Each instance of VisitedCity can contain the

Write to a .txt file using data from TextBox when UWP app is closed

耗尽温柔 提交于 2019-12-24 18:26:16
问题 When user closes the app, I believe the OnSuspending method in App.xaml.cs is called first before termination. So, I put my code in there in order to automatically save what the user wrote in the TextBox to a .txt file called TextFile1.txt. The program runs without errors but it doesn't save the user's data to the .txt file when app is closed. Code in App.xaml.cs : private MainPage mainFrame; private async void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e

Pure XAML approach to evenly distributing an unknown number of children in a container

家住魔仙堡 提交于 2019-12-24 17:13:06
问题 Let's say I have a StackPanel (Orientation="Horizontal") with a fixed width and a variable/unknown amount of children, how do I tell all the children in XAML (not in code) to set their widths' to all be equal and fill up the entire StackPanel's width? It's easy enough to do with Grid when you know the number of children (just use ColumnDefinitions with Width="*"), but I'm not sure how to do it with panels (StackPanel, PivotHeaderPanel, etc) or lists (GridView, ListView, etc). 回答1: According

How to build c# UWP-based project to one .exe file?

风格不统一 提交于 2019-12-24 16:11:23
问题 I want to use universal windows in my project for windows 10 only. I need to compile all my UI&logic stuff to one exe-file (or dll). Like I could do the same with usual WPF application. But results of build contains a lot of .xbf files and .net-libraries. I already tryed to set "Compile with .NET Native tool chain" options in project's build settings, but the results still contains a lot of files. 回答1: Within the uwp development framework, there's no such thing as an exe file. From the MSDN:

Retrieve the request data from URI in Webview Windows 8.1

可紊 提交于 2019-12-24 15:41:49
问题 I'm developing a Windows phone 8.1 app and there's this scenario where I should open the webview for the user to enter the card details. Once the card details are entered and processed, the payment API will send the transaction details back as a POST request to the webview. I'm not able to get the POST data, tried so many methods. How do I get the post data returned back from the server? Thanks in Advance 回答1: If you have access to webpage code then you can use WebBrowser.ScriptNotify for

Visual Studio “An unhandled win32 expcetion occured” when clicking button often

梦想的初衷 提交于 2019-12-24 14:58:06
问题 I have a strange issue with my C# UWP-Win10 app. When I re-size the window often or clicking a random button often (>3 times), I'm getting the error: An unhandled win32 exception occurred in bla.exe [bla-id] After closing this window the app crashes and in the output-window I get: The program '[bla-id] bla.exe' has exited with code -1073741811 (0xc000000d). No more information from Visual Studio. I'm using the serial-port in this app and I've noticed that this error occurs only when I'm

Holding event for desktop app not firing

安稳与你 提交于 2019-12-24 14:53:10
问题 In my Universal Windows App , I am subscribing to the Holding event in my ListViewItem DataTemplat e: <ListView.ItemTemplate> <DataTemplate> <Grid Holding="ListViewItem_Holding"> <FlyoutBase.AttachedFlyout> <MenuFlyout Placement="Right"> <!-- using the Click event --> <MenuFlyoutItem Text="delete" Click="DeleteProductClick" /> <MenuFlyoutItem Text="edit" /> </MenuFlyout> </FlyoutBase.AttachedFlyout> <TextBlock Text="{Binding Name}" /> </Grid> </DataTemplate> </ListView.ItemTemplate> All works

Using CreateInstance in Windows 10 Universal Apps

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 14:08:57
问题 The following code doesn't compile in a Windows 10 Universal App, but does in a .Net console app (both using Reflection): string objType = "MyObjType"; var a = Assembly.GetExecutingAssembly(); var newObj = a.CreateInstance(objType); It would appear that universal windows apps don't contain the method Assembly.GetExecutingAssembly() ; nor do the Assembly objects seem to contain CreateInstance . Activator.CreateInstance has 16 overloads in .Net and only 3 in A Win 10 app. I'm referencing the