windows-runtime

how to translate sign under appbar buttom

佐手、 提交于 2019-12-12 04:44:36
问题 Hello I want to localize text below standard AddAppBarButton <Style x:Key="AddAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}"> <Setter Property="AutomationProperties.AutomationId" Value="AddAppBarButton"/> <Setter Property="AutomationProperties.Name" Value="Add"/> <Setter Property="Content" Value=""/> </Style> I've tried in Resource filead add something like ButtonId.AutomationProperties.Name = value But it doesn not work. I get errors when app starts.

Creating a Byte array from an Image

天大地大妈咪最大 提交于 2019-12-12 04:43:54
问题 What is the best way to create a byte array from an Image? I have seen many methods but in WinRT none of them worked. 回答1: static class ByteArrayConverter { public static async Task<byte[]> ToByteArrayAsync(StorageFile file) { using (IRandomAccessStream stream = await file.OpenReadAsync()) { using (DataReader reader = new DataReader(stream.GetInputStreamAt(0))) { await reader.LoadAsync((uint)stream.Size); byte[] Bytes = new byte[stream.Size]; reader.ReadBytes(Bytes); return Bytes; } } } } 回答2

How can I use SQLite query parameters in a WinRT app?

不羁岁月 提交于 2019-12-12 04:36:29
问题 I want to use query parameters in my update sql, and had this code: internal static int UpdatePhotosetName(string oldPhotosetName, string newPhotosetName) { String qryUpdateBaseTable = "UPDATE PhotraxBaseData SET photosetName = @newName WHERE photosetName = @oldName"; int rowsUpdated; using (var db = new SQLite.SQLiteConnection(App.DBPath)) { SQLiteCommand cmd = new SQLiteCommand(db); cmd.CommandText = qryUpdateBaseTable; cmd.Parameters.Add(new SQLiteParameter("@newName")); cmd.Parameters.Add

AsymmetricKeyAlgorithmProvider Import

蹲街弑〆低调 提交于 2019-12-12 04:23:27
问题 My problem is that with UWP-Apps I can not use RSACryptoServiceProvider . That means I have to use CryptographicEngine to en/decrypt data. How can I Import my Public/Private Key to AsymmetricKeyAlgorithmProvider 's ImportKeyPair -Method? How do I have to create the IBuffer parameter? I have two Pem or alternatively xml files, one for Private and one for Public key, which I want to use for en/decryption. They are externally created. I already found a Solution with Chilkat's Rsa Class. But this

Launcher.LaunchFileAsync(…) not working

做~自己de王妃 提交于 2019-12-12 03:56:59
问题 I'm working on an App for Win8 which should include the possibility of saving contact information. The service I use offers VCard support so I decided on using them. I can succesfully download and save them, only opening them automatically doesn't work. The files are "correct", and can be opened from the explorer without any problem. Any ideas why LaunchFileAsync isn't working? Here's a dump of the code: private async void SaveContactSelected() { IRandomAccessStreamReference img =

Bind to UIElement in code-behind crashing

丶灬走出姿态 提交于 2019-12-12 03:48:29
问题 In my code, I have an UIElement variable I set with certain button presses. Now, I have this variable: public UIElement currentMenu; Set to this value: currentMenu = (UIElement)Resources["Home"]; I get it from the Resources so I don't have to manage it messily in the code-behind, I will export the Resources to a seperate ResourceDictionary once I get this problem solved. My SplitView looks like this: <SplitView x:Name="NavPane" OpenPaneLength="250" CompactPaneLength="50" Content="{x:Bind

Create sub folders in My Pictures from Windows Store application

有些话、适合烂在心里 提交于 2019-12-12 03:46:01
问题 I'm trying to create a folder structure within My Pictures folder from a Windows store app. But I can't seem to get pass the first level. I create my first level folder using the following code: IAsyncOperation<StorageFolder> appFolder = Windows.Storage.KnownFolders.PicturesLibrary.GetFolderAsync("AppPhotos"); if (appFolder==null) { //Create folder appFolder = Windows.Storage.KnownFolders.PicturesLibrary.CreateFolderAsync("AppPhotos"); } Now I want to create another folder below this call

How to implement AES Encrypt (AesManaged Rfc2898DeriveBytes) in Windows Runtime

瘦欲@ 提交于 2019-12-12 03:07:07
问题 I met a blocking issue when I tried to immigrate my project from Windows Phone Silverlight 8.1 to Windows Runtime. In Windows Runtime the AES-encrypted string is not the same as the one on Silverlight before. In Silverlight: public static string EncryptAES(string encryptString) { AesManaged aes = null; MemoryStream ms = null; CryptoStream cs = null; string encryptKey = "testtest123"; string salt = "abcabcabcd"; try { Rfc2898DeriveBytes rfc2898 = new Rfc2898DeriveBytes(encryptKey, Encoding

WinRT library not working in Release mode

浪尽此生 提交于 2019-12-12 03:06:33
问题 I've have been trying to build a desktop application using WinRT libraries in Visual Studio 2012. The code snippet goes as follows. [STAThread] int wmain (Platform :: Array <String ^> ^ args) { wcout << L"Copyright (c) Microsoft Corporation. All rights reserved." << endl; wcout << L"FindPackages sample" << endl << endl; try { auto packageManager = ref new Windows::Management::Deployment::PackageManager(); auto packages = packageManager->FindPackages(); int packageCount = 0; std::for_each

How to change MediaCapture to Byte[]

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:58:21
问题 How to change MediaCapture to byte[] in Windows Store App for Windows 8.1. From lib: Windows.Media.Capture.MediaCapture asd = new Windows.Media.Capture.MediaCapture(); Thans! 回答1: I assume you want to get a byte array from what the camera is seeing at the moment, although it's hard to interpret from your question. There is a sample on the Microsoft github page that is relevant, although they target Windows 10. You may be interested in migrating your project to get this functionality.