windows-10-universal

How can I detect Windows 10 light/dark mode?

感情迁移 提交于 2019-11-30 17:16:27
问题 I'm using Windows.UI.ViewManagement.UISettings to get system accent color but it seems this class does not have any method or property for light/dark mode. I failed to find a document for this feature, how can I detect this? PS: I'm making a JS app which does not have access for Windows.UI.Xaml namespace. 回答1: I have found an easier solution, which should work in JavaScript apps as well, without requiring the Windows Runtime Component - the UISettings class: var uiSettings = new Windows.UI

Cannot bind Icon property in NavigationView MenuItemTemplate

点点圈 提交于 2019-11-30 16:27:08
I've tried to use a NavigationView because it looks very useful, but I'm struggling to make it work with the MVVM pattern. I've attached the MenuItemsSource property like in this snippet: <Page x:Class="App5.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:App5" ...> <Page.DataContext> <local:MainViewModel></local:MainViewModel> </Page.DataContext> <NavigationView MenuItemsSource="{Binding Items}"> <NavigationView.MenuItemTemplate> <DataTemplate> <TextBlock Text="{Binding Name}" /> <

Custom Content Dialog in UWP with 3+ buttons

这一生的挚爱 提交于 2019-11-30 15:57:33
问题 I'd like to display a content dialog box that has more than the traditional Primary and Secondary results. Since I can't override the ContentDialogResult enum and add options to that property, it seems my only choice may be to create my own custom control that works similarly to a ContentDialog. For additional context: Often, one might see a Dialog box show up during a computer/app operation, when the action is redundant, i.e. copying files to a folder, the computer generally offers a dialog

Custom Content Dialog in UWP with 3+ buttons

感情迁移 提交于 2019-11-30 15:04:30
I'd like to display a content dialog box that has more than the traditional Primary and Secondary results. Since I can't override the ContentDialogResult enum and add options to that property, it seems my only choice may be to create my own custom control that works similarly to a ContentDialog. For additional context: Often, one might see a Dialog box show up during a computer/app operation, when the action is redundant, i.e. copying files to a folder, the computer generally offers a dialog box with not 2 options, but 4. -> "Yes to All", "No to All", "Yes", "No". I can't seem to find any

How can I get a Win32 HANDLE for a StorageFile or StorageFolder in UWP?

丶灬走出姿态 提交于 2019-11-30 07:30:24
I know I can use Win32 APIs for accessing files within my own local data folder (eg, see this answered question ) but I need to access files outside of my app (eg, from the Pictures Library) and the libraries I'm trying to use are all based on Win32 file HANDLE s and / or they rely on using relative filenames. Since the only way to get at files in the Pictures Library (or to get files / folders returned from a picker) is via StorageFile objects, how can I re-use my existing code? Do I have to re-write it all to be asynchronous and rely on the WinRT storage APIs? Starting in the "Anniversary

Cannot bind Icon property in NavigationView MenuItemTemplate

回眸只為那壹抹淺笑 提交于 2019-11-29 23:58:22
问题 I've tried to use a NavigationView because it looks very useful, but I'm struggling to make it work with the MVVM pattern. I've attached the MenuItemsSource property like in this snippet: <Page x:Class="App5.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:App5" ...> <Page.DataContext> <local:MainViewModel></local:MainViewModel> </Page.DataContext> <NavigationView MenuItemsSource="{Binding

Windows 10 Mobile Error: DEP6200

拜拜、爱过 提交于 2019-11-29 14:24:43
I am trying to deploy a Windows 10 app to a Lumia 635 running 10.0.10586.11 and I get this error: Error : DEP6100 : The following unexpected error occurred during bootstrapping stage 'Connecting to the device 'DEVICE GUID'.': SEHException - External component has thrown an exception. Error : DEP6200 : Bootstrapping 'Device' failed. Device cannot be found. The data necessary to complete this operation is not yet available. Unlike most, I am capable of deploying to an Emulator, just not the physical device. Based on this question: Error : DEP6200 : Bootstrapping 'Device' failed. Device cannot be

How can I get a Win32 HANDLE for a StorageFile or StorageFolder in UWP?

青春壹個敷衍的年華 提交于 2019-11-29 09:40:32
问题 I know I can use Win32 APIs for accessing files within my own local data folder (eg, see this answered question) but I need to access files outside of my app (eg, from the Pictures Library) and the libraries I'm trying to use are all based on Win32 file HANDLE s and / or they rely on using relative filenames. Since the only way to get at files in the Pictures Library (or to get files / folders returned from a picker) is via StorageFile objects, how can I re-use my existing code? Do I have to

How to easily allow users to update Styles used be elements in XAML (UWP)

北城余情 提交于 2019-11-29 08:54:24
This is for a Windows 10 UWP. I need to allow users to update values on Styles that are associated with elements used throughout the application (i.e allow users to change the font size of various textblocks, background color stackpanels etc.) . I currently have all my Styles in a separately file. My App.xaml is as below: <Application x:Class="MyTestApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="

How to use pre-designed SQLite in UWP project?

喜欢而已 提交于 2019-11-29 04:18:00
I have a SQLite database from another project and I want to use it in a UWP application. But I don't know how to import this database to the project and! I can create a new Database and use it but I don't know how to copy database file from project. I use from SQLite.Net-PCL nuget package. For how to access an exist file, there are two locations that all apps can access. Details please reference the file-access-permissions . One is Application install directory . As @Henk Holterman said, you can import your existed database file into your project by right-click one folder and select Add-