windows-runtime

How to modify a XAML element's color while the view is onscreen?

我是研究僧i 提交于 2019-12-13 01:28:04
问题 Im' a huge XAML noob, and I'm building an WinRT application with MVVM. Basically, I have a function getBackgroundColor() that returns a SolidColorBrush, and I want to make it so that at any given time, I can change the background color, and have the XAML element notice and change to match the new output of getBackgroundColor. I'm aware that this should be done with bindings but don't really understand any of the documentation online. Can someone explain this to me like I'm 5? 回答1: Flip's

Removing the BackStack Entry in MetroStyle Application

三世轮回 提交于 2019-12-13 00:29:16
问题 How can I implement removing the backStack Entry in Metro style applications? 回答1: frame.SetNavigationState("1,0"); will clear the navigation history for you. 回答2: I found this answer useful: How to clear Backstack of the frame and start afresh Write your own NavigationService and store the navigationstate in the constructor. string state; public NavigationService(Frame mainFrame) { state = mainFrame.GetNavigationState(); _mainFrame = mainFrame; _mainFrame.Navigating += _mainFrame_Navigating;

Can't read the text file in metro apps?

跟風遠走 提交于 2019-12-13 00:27:24
问题 I can read the text file for first time. when i try to read the same text file next time, it quit the function and return null value. static string configData = ""; async public void readtextFile(string folder, string file) { StorageFolder storageFolder = await Package.Current.InstalledLocation.GetFolderAsync(folder); StorageFile storageFile = await storageFolder.GetFileAsync(file); configData = await FileIO.ReadTextAsync(storageFile); } Please suggest me, how to resolve this issue.. Thanks

TwoWay Binding Not Updating Target - Metro App

坚强是说给别人听的谎言 提交于 2019-12-13 00:23:51
问题 I'm building a Metro App using VS 2012 and the Windows 8 SDK. In the app, I have this class (with a corresponding struct) // Parameter data structure for tools public struct ToolParameter { public string Title { get; set; } public Object Value { get; set; } public string Description { get; set; } } // Tool that will be used to execute something on phone public class Tool { public string Title{ get; set; } public ObservableCollection<ToolParameter> Parameters { get; set; } public string

RadialGradientBrush in Windows Phone 8.1?

孤者浪人 提交于 2019-12-12 21:15:24
问题 Please tell me how can I create a RadialGradientBrush in Windows Phone 8.1 app? I've tried to find it here but there is no such brush Windows.UI.Xaml.Media Any ideas? Thank you! 回答1: If you don't mind installing the new Microsoft's Win2D library from NuGet or their Win2D GitHub, you can use the Microsoft.Graphics.Canvas.CanvasRadialGradientBrush . For further reference: Microsoft.Graphics.Canvas.CanvasRadialGradientBrush 来源: https://stackoverflow.com/questions/27943177/radialgradientbrush-in

CreatePushNotificationChannelForApplicationAsync in native C++

老子叫甜甜 提交于 2019-12-12 20:27:34
问题 I'm trying to use windows push notifications in native C++ code. But I struggle with implementation. I'm calling CreatePushNotificationChannelForApplicationAsync but it returns HRESULT_FROM_WIN32(ERROR_NOT_FOUND) : Element not found. My OS is Win10 and I use Visual Studio 2015. Here is my code: #include <wrl.h> #include <windows.networking.pushnotifications.h> #include <ppltasks.h> #pragma comment(lib, "runtimeobject.lib") using namespace ABI::Windows::Foundation; using namespace Microsoft:

C# XAML Metro Image dynamic Source

半城伤御伤魂 提交于 2019-12-12 20:20:35
问题 I like to do simple animation using one Image control in XAML and swaping Source of Image to other in interval 1 second. But when I do that, the image is flickering. I using this code (at Tick event handler of Timer ): Uri uri = new Uri("ms-appx:/Sprites/Running/" + y++ + ".png", UriKind.RelativeOrAbsolute); BitmapImage textureBitmap = new BitmapImage(uri); this.ImageHolder.Source = textureBitmap; Where can the problem be ? Should I cache BitmapImages? Thank you for your help. 回答1: Try to

How to send data between .NET 4.5 and .NET 4.0 with Sockets?

南笙酒味 提交于 2019-12-12 19:44:24
问题 The problem is that my server is written in the old Framework, so I can not use SocketStream there, I use System.Net.Sockets.TcpClient instead. The Client is written in the new framework, where TcpClient and the whole System.Net.Sockets are not supported. In the new framework we have Windows.Networking.Sockets. The exact question is: How to send data from the Client to the Server? Here is what happens when the user clicks on Send button: var writer = new DataWriter(socket.OutputStream);

DriveInfo equivalent in WinRT/Metro App

徘徊边缘 提交于 2019-12-12 19:12:35
问题 I need to scan all the local drives (and the directories) in a Metro App that I'm working on. I've searched everywhere I could, but without any success. Basically, I need something similar to what is shown as an example here: http://msdn.microsoft.com/en-us/library/system.io.driveinfo.aspx 回答1: Remember that metro style applications are severely restricted in the parts of the operating system they can access. I don't believe that it is possible for a metro style app to scan arbitrary

How to execute c++ function in a parallel thread under WinRT?

こ雲淡風輕ζ 提交于 2019-12-12 18:32:59
问题 I have a C++ code which uses _beginthreadex() Windows method to execute a function in a thread. Now I want to port it to WinRT component to include it in windows phone app. But windows phone does't support _beginthreadex(). How do I do it? my function is: bool doesWordAppearInDictionarry(char* word); I have 4 cores on my computer so I want to execute 4 copies of this function in parallel (searching for 4 different words in the dictionary simultaneously). I read (here) and (here) about Windows