windows-runtime

Windows Phone 8.1 (WinRT): Custom Looping Selector

人盡茶涼 提交于 2019-12-18 19:05:31
问题 I want a custom Looping Selector for my Windows Phone 8.1 (WinRT) and I couldn't find any solution for the moment. I want something like this: The Windows Phone Toolkit is for WP8.0 and WP8.1 Silverlight and it doesn't work for WP8.1 (WinRT) apps (And this question is for WP8.1 Silverlight). There are DatePicker & TimePicker controls for WP8.1. Is there any way to custom their data or something to trick the control to my problem? There is a LoopingSelector class but it seems that it is not

AesManaged Decryption in Metro WinRT application

﹥>﹥吖頭↗ 提交于 2019-12-18 17:35:13
问题 I have some text, encrypted by C#'s AesManaged, which must be decrypted in a WinRT Metro application. I cannot change the Encryption code, as the code has other dependencies which cant be changed. The encryption function looks like this: // Note: Edited out possibly real password and salt: Guid password = Guid.Parse("AAAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA"); Guid salt = Guid.Parse("AAAAAAAAA-BBBB-BBBB-BBBB-AAAAAAAAAAAA"); string EncryptedValue(string data) { byte[] passwordBytes = password

Centering selected item in a scroll viewer

流过昼夜 提交于 2019-12-18 17:29:10
问题 I am trying to center a selected item in a ListView inside a ScrollViewer and struggling to calculate the vertical offset that I should be setting the ScrollViewer relative to the ListView. The following links set me on the right track, but because of the limitation of the WinRT API, was not able to use them: Make ListView.ScrollIntoView Scroll the Item into the Center of the ListView (C#) http://blogs.msdn.com/b/delay/archive/2009/04/19/fewer-gotchas-to-getcha-enhancing-the

How to clone UIElement in WinRT XAML C#?

那年仲夏 提交于 2019-12-18 17:00:06
问题 I have tried this approach first but getting error "Element is already the child of another element" var objClone = new MyImageControl(); objClone = this; ((Canvas)this.Parent).Children.Add(objClone); Then I checked this and this, but XamlWriter and XamlReader is not available in WinRT. I have tried to use MemberwiseClone() but it throws exception, "COM object that has been separated from its underlying RCW cannot be used. System.Runtime.InteropServices.InvalidComObjectException ". So can

How to clone UIElement in WinRT XAML C#?

我的未来我决定 提交于 2019-12-18 16:59:22
问题 I have tried this approach first but getting error "Element is already the child of another element" var objClone = new MyImageControl(); objClone = this; ((Canvas)this.Parent).Children.Add(objClone); Then I checked this and this, but XamlWriter and XamlReader is not available in WinRT. I have tried to use MemberwiseClone() but it throws exception, "COM object that has been separated from its underlying RCW cannot be used. System.Runtime.InteropServices.InvalidComObjectException ". So can

How to maximise a Windows 10 Universal Application's window to full screen when running on a desktop?

若如初见. 提交于 2019-12-18 16:49:56
问题 When building a universal application using Windows 10 (or Windows 8.1 WinRT), is it possible to force the application's main window to maximise on launch? This is obviously natural behaviour for the application when running on a mobile device but not when running on the desktop. This is certainly possible using WinForms: How do I make a WinForms app go Full Screen How to display a Windows Form in full screen on top of the taskbar? But I haven't so far managed to find anything in the

Not able to navigate to pages on Windows Metro App using c#

你。 提交于 2019-12-18 15:04:24
问题 When my UserLogin page loads, i want to check for user database, and if it doesn't exist, or can't be read, i want to direct it to NewUser page. protected override void OnNavigatedTo(NavigationEventArgs e) { CheckForUser(); if (UserExists == false) this.Frame.Navigate(typeof(NewUser)); } The problem is that it never navigates to NewUser , even when i comment out the if condition. 回答1: Navigate can't be called directly form OnNavigatedTo method. You should invoke your code through Dispatcher

Playing a sound from a generated buffer in a Windows 8 app

爷,独闯天下 提交于 2019-12-18 12:35:03
问题 I'm porting some C# Windows Phone 7 apps over to Windows 8. The phone apps used an XNA SoundEffect to play arbitrary sounds from a buffer. In the simplest cases I'd just create a sine wave of the required duration and frequency. Both the duration and frequency can vary greatly, so I'd prefer not to rely on MediaElements (unless there is someway to shift the frequency of a base file, but that will only help me with the single frequency generation). What is the equivalent of an XNA

Why does my application require Visual C++ Redistributable package

可紊 提交于 2019-12-18 10:12:19
问题 I'm writing a simple C++ application in Visual Studio. It also has a setup project. It works well on my development machine, but when I'm installing this application on user's machine it requires Visual C++ Redistributable Package . I'm wondering why does my application require C++ Redistributable ? Standard C++ runtime library is shipped with Windows, isn't it? 回答1: The only version of the C runtime library which is shipped by Microsoft with most of 32 bit Windows versions is msvcrt.dll .

Force WinRT app to snapped view

隐身守侯 提交于 2019-12-18 09:41:15
问题 For one of my apps I'd like to send the app to snapped view after tapping a button. As far as I know there's no public API available to send a running application to snapped view. Did anyone find a workaround to do this? Somehow it should be possible since you're able to do it in Windows 8 itself, and snap one of the running apps. Update: Being able to trigger a Win+. might do the same trick, but the SendKeys API isn't available in WinRT either. 回答1: Windows 10 has a ApplicationView