windows-runtime

How to detect ALT (Menu) button keydown on global page level in a WinRT app

本秂侑毒 提交于 2019-12-11 19:39:45
问题 I use following code to detect all key events in a WinRT app page: Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown; ... private void CoreWindow_KeyDown(CoreWindow sender, KeyEventArgs args) { //Handle key event } But the Alt (Menu in the VirtualKey enumeration) key does not trigger the CoreWindow.KeyDown event. It does also block any other key to trigger the event while pressed. Anyone know how to detect the Alt keydown event on a global page level in a WinRT app? 回答1: It seems to be

data binding property of a other control to a style while animating it

旧城冷巷雨未停 提交于 2019-12-11 19:29:28
问题 i'm trying to implement a tab style radio button. this style contains a textblock as a child of a grid which changes it's color when checked and the grid is a child of border element. i'm trying to bind the grid's background only when it is in checked state but the button end's up bieng transparent </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="CheckStates"> <VisualState x:Name="Checked"> <Storyboard> <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement

Highlight days on WinRTXamlToolkit.Controls.Calendar

老子叫甜甜 提交于 2019-12-11 19:06:24
问题 I wrote a Windows Phone 8.1 (WINRT) App. I need to show Calendar in the page with Highlighted days like holiays. So, I added WinRT XAML Toolkit - Calendar Control from nuget. PM> Install-Package WinRTXamlToolkit.Controls.Calendar <Page x:Class="DrFit.Pages.ActivityTimeTablePage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:DrFit.Pages" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

HRESULT E_FAIL when trying to create a folder that's name contains a colon in WinRT

只谈情不闲聊 提交于 2019-12-11 18:35:16
问题 Having a StorageFolder object and trying to create a folder with a name that contains a colon somewhere inside (not at the beginning or the end) results in a COM error with HRESULT 80004005 (HRESULT E_FAIL). Example: await ApplicationData.Current.TemporaryFolder.CreateFolderAsync("abc:xyz", CreationCollisionOption.OpenIfExists); If the colon is at the beginning ot at the end I get a HRESULT 8007007b with the message "The filename, directory name, or volume label syntax is incorrect". That's

Role based View XAML

走远了吗. 提交于 2019-12-11 18:34:25
问题 I am developing a WinRT app which has many user roles. The View of many pages in my app change based on the Userrole For eg. I have a Student role and a Professor role. When the Student logs in he will see personal-info, performance chart, todos and badges received and when a professor logs in she will see her personal-info, todos and feedback received How do I only show the components which are necessary? Is binding Grid.Visibility a good way of doing this or is there any better way? Update:

C++/CX - Check the type of an object?

大憨熊 提交于 2019-12-11 18:23:38
问题 Is it possible to check the type of an object in C++/CX ? I have a Vector of objects which derive from ICustomObject and as I enumerate the objects from the Vector, i'd like to know what the actual object type is. This is so that I know what properties of that object should be accessible to me. 回答1: You can use dynamic_cast - if the object is an object of MyObjectType, the result will be non null, if it's another type, the result will be nullptr. 回答2: I found that this works just fine! Type^

Disable interpolation of child elements in Windows RT

喜夏-厌秋 提交于 2019-12-11 18:14:42
问题 Right now I have a ScrollViewer control in a Windows Store Application which surrounds an Image element. I am trying to make a pixel art editor but when the ScrollViewer is zoomed in the Image's contents are interpolated. Is there currently any way to force the image to be scaled in nearest neighbor mode? EDIT: I decided I should put some code to clarify what I'm trying to do, so here it is: <ScrollViewer x:Name="Container" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ZoomMode=

How do I perform a SHA512 hash in C++ WinRT?

风流意气都作罢 提交于 2019-12-11 18:12:38
问题 What is the equivalent of the C# method SHA512CryptoServiceProvider.ComputeHash() in C++ WinRT? 回答1: See Windows.Security.Cryptography.Core.CryptographicHash and friends. There is an example on that page demonstrating one usage, and the documentation for related classes and functions have examples as well. For a "complete" example, you can take a look at the compute_sha1_hash function from my Boost-licensed CxxReflect library. It computes an SHA1 hash; computing an SHA512 hash should simply

Debugging Surface RT 8.1 from Visual Studio 2012

南楼画角 提交于 2019-12-11 18:03:31
问题 It seems only the VS 2013 Remote tools for ARM works on Windows 8.1. Does this mean that Visual Studio 2012 is obsolete now for WinRT development? 回答1: Update on 25 Nov 2013: Just saw Moche's answer and was about to post the update. Yes VSE2012 on Win8.0 can now remote debug on Surface2 / Win8.1 using VS2012 Update 4 which was released over the weekend. Also it is required to download the Remote Tools for Arm that are part of the Update 4: http://www.microsoft.com/en-au/download/details.aspx

Put a View Control in its ViewModel

被刻印的时光 ゝ 提交于 2019-12-11 17:58:09
问题 I'm developing a Windows 8.1 Store app with C# and .Net Framework 4.5.1. I'm trying to bind Password.SecurePassword to a ViewModel, and reading this SO answer I found a way to do it: Put the PasswordBox in my ViewModel . But I don't know how to do it. I know how to bind Dependency Properties, but I don't know how to put that control on my ViewModel. This is my XAML: <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"