windows-runtime

How to set axis margin in WinRT XAML Toolkit line chart?

与世无争的帅哥 提交于 2020-01-11 14:26:08
问题 Answer Finally I solved my answer with this. ((LineSeries)MyChart.Series[0]).IndependentAxis = new LinearAxis { Minimum = 1, Maximum = 5, Orientation = AxisOrientation.X, Interval = 1, Margin = new Thickness(10, 0, 10, 0) }; ((LineSeries)MyChart.Series[0]).Clip = null; ((LineSeries)MyChart.Series[0]).Margin = new Thickness(10, 0, 10, 0); I am drawing line chart with help of WinRT XAML Toolkit. I am setting X axis manually, but when I set I am getting wierd start & end point. I tried to set

Background timer to update UI?

喜你入骨 提交于 2020-01-11 08:29:09
问题 I got a little problem with my application. I would like to update something on my UI every 10 seconds. I first used a DispatcherTimer for this but it will block my UI for a short time because the update method needs to load something from the web and this operation needs some time. Now I thought about some kind of background worker and I found BackgroundTasks. The problem with Background tasks is, as far as I understood it correctly, that they are supposed to serve as updaters even if the

ToggleButton Has No Unchecked State in UWP

孤者浪人 提交于 2020-01-11 07:51:17
问题 I am working with Visual States in a ToggleButton template within a Windows 10 UWP app. I have added an animation for the 'Checked' state so when checked, an icon within the template rotates 90 degrees over 250 milliseconds. Now I want to animate the icon rotating back to normal over the same 250 millisecond timespan when the ToggleButton is no longer checked. Problem is, there is no 'Unchecked' state to animate anymore for ToggleButton - so it seems like this is impossible. Surely I have

Can I change the background color of the primary tile in WinRT?

本秂侑毒 提交于 2020-01-11 07:15:08
问题 Is it possible to change the background color of the primary tile of my WinRT app? I'd like to change it according to app status. I use this code for changing the text of the tile: XmlDocument contentSmall = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Text02); contentSmall.GetElementsByTagName(textElementName)[1].InnerText = "---"; TileNotification notifSmall = new TileNotification(contentSmall); TileUpdateManager.CreateTileUpdaterForApplication().Update(notifSmall)

Creating Windows Store App Pages Without XAML

戏子无情 提交于 2020-01-11 05:09:04
问题 I am writing a C#/XAML Windows Store app and would like to create and navigate to and display a Page entirely from C#. Is this possible? Obviously I can inherit from Page, but, when attempting to Navigate to a derived Page that has no XAML, I get a System.TypeLoadException... "Could not find Windows Runtime type 'Windows.Foundation'". My thought was this should be possible since XAML translates into a CLR partial class definition, so there's no reason one couldn't do everything in C#. But

Creating Windows Store App Pages Without XAML

a 夏天 提交于 2020-01-11 05:09:03
问题 I am writing a C#/XAML Windows Store app and would like to create and navigate to and display a Page entirely from C#. Is this possible? Obviously I can inherit from Page, but, when attempting to Navigate to a derived Page that has no XAML, I get a System.TypeLoadException... "Could not find Windows Runtime type 'Windows.Foundation'". My thought was this should be possible since XAML translates into a CLR partial class definition, so there's no reason one couldn't do everything in C#. But

How to get the mac address in WinRT (Windows 8) programmatically?

时光怂恿深爱的人放手 提交于 2020-01-10 04:15:26
问题 I am looking for an API in WinRT to access the mac address. 回答1: You can't retrieve the MAC Address per say, but you do can retrieve hardware specific information to identify a machine if that's what you're trying to do. Here's a complete msdn article discussing the subject: Guidance on using the App Specific Hardware ID (ASHWID) to implement per-device app logic (Windows) Be careful to use just the information you need and not the complete id, as it might change based on information that are

Handling WinRT StreamSocket disconnects (both server and client side)

最后都变了- 提交于 2020-01-10 03:04:19
问题 I have an application I'm writing for Windows 8/WinRT that uses the StreamSocket API to do a streaming connection to a server. That is to say, the server streams data to the client, sometimes with meta tags, and can disconnect at any time. The problem I'm having is that I have no idea how to detect when the server has disconnected. There don't appear to be any events or properties on the StreamSocket class, either its input or output streams, or on the DataReader/DataWriter classes that have

How to convert Platform::String to char*?

允我心安 提交于 2020-01-09 03:49:27
问题 How do I convert the contents of a Platform::String to be used by functions that expect a char* based string? I'm assuming WinRT provides helper functions for this but I just can't find them. Thanks! 回答1: Platform::String::Data() will return a wchar_t const* pointing to the contents of the string (similar to std::wstring::c_str() ). Platform::String represents an immutable string, so there's no accessor to get a wchar_t* . You'll need to copy its contents, e.g. into a std::wstring , to make

Error when Play file .mp3 (StorageFile ) with BackgroundMediaPlayer in isolated storage windows phone 8.1 rt

人走茶凉 提交于 2020-01-07 07:49:07
问题 I use Windows Phone 8.1 Runtime I get my song in isolated storage My code : storageFile is song in isolated storage IRandomAccessStream stream = await storagefile.OpenAsync(FileAccessMode.Read); BackgroundMediaPlayer.Current.SetStreamSource(stream); BackgroundMediaPlayer.Current.Play(); When I play it,but it not work , like photo (try emulator and device lumina 520) http://photoshare7.com/image/f5a _message: Unable to cast object of type 'Windows.Media.Playback.MediaPlayer ' to type 'Windows