windows-runtime

How does x:Bind compare with the classical Binding, put as concisely as possible?

假如想象 提交于 2019-12-21 20:47:09
问题 How is the compiled binding, x:Bind, different from the classical Binding, put as concisely as possible? 回答1: Compared with the classical binding you cannot use the following binding attributes with x:Bind : ElementName , RelativeSource , Source and UpdateSourceTrigger . Well, that almost sums up the limitations of x:Bind but x:Bind is powerful in its own right -- the notable one being compiled binding and hence the performance gain as a result. See last bullet point for another powerful

How to Implement a timer in Metro Style App

拈花ヽ惹草 提交于 2019-12-21 17:37:07
问题 I am developing a game in which I have to implement timer for showing the time that has elapsed. How can I do that? 回答1: The async/await way: private bool isTimerRunning; private async void StartTimer() { this.isTimerRunning = true; while (this.isTimerRunning) { OnOneSecondPassed(); await Task.Delay(1000); } } private void StopTimer() { this.isTimerRunning = false; } protected virtual void OnOneSecondPassed() { } 回答2: Did you try to use DispatcherTimer in namespace Windows.UI.Xaml ? If this

Styling SelectedItem in ListView in Metro App XAML

☆樱花仙子☆ 提交于 2019-12-21 16:57:52
问题 I am having troubles setting up the style of selected item in metro app list box. I have created the DataTemplate for the item in which there is a TextBlock which colour I would like to change. I tried many things from WPF but they are not available for metro like DataTemplate.Triggers, Style.Triggers and so on. I also tried to make a copy of the ItemContainerStyle template but since it uses ContentPresenter to display my DataTemplate I didn't know what to change to achieve what I want. The

Windows Store Apps and F#

◇◆丶佛笑我妖孽 提交于 2019-12-21 14:11:10
问题 I am trying to create a portable library using F# to use with Windows Store apps. I created one fs file with one class: module FunctionalRT open System.Net open System.IO type WebHelper = static member DownloadStringAsync (url:string) = async { let req = HttpWebRequest.Create(url) use! resp = req.AsyncGetResponse() use stream = resp.GetResponseStream() let reader = new StreamReader(stream) let s = reader.ReadToEnd() return s } I referenced this library in my Windows Store app with no problems

WinRT XAML Toolkit Visualization error

梦想与她 提交于 2019-12-21 14:07:14
问题 I have a page where I want to put a chart using WinRT Xaml Toolkit Data Visualization Controls. I have the following code: <Charting:Chart x:Name="PieChart" Width="400" Height="400"> <Charting:Chart.Series> <Charting:PieSeries IndependentValuePath="X" DependentValuePath="Y"/> </Charting:Chart.Series> </Charting:Chart> VS tells me, PieSeries is wrong: "A value of type 'PieSeries' cannot be added to a collection or dictionary of type 'Collection`1'". Why is this an error? 回答1: It's not fully

Assembly.GetCallingAssembly isn't supported on WinRT, but is for portable class libraries?

[亡魂溺海] 提交于 2019-12-21 10:17:24
问题 I'm needing to get some meta-data about the assembly which calls my component. As such, using Assembly.GetCallingAssembly() seems to be a natural fit. However, I've found it works everywhere except for in Windows Store. Where it's supported: Phone 7.0+ .Net 1.0+ Portable Class Libraries However, where it's not supported is directly within a Windows Store application. I can make a portable class library and then call it from there inside of a Windows Store application, but I can't just put it

Assembly.GetCallingAssembly isn't supported on WinRT, but is for portable class libraries?

不打扰是莪最后的温柔 提交于 2019-12-21 10:16:48
问题 I'm needing to get some meta-data about the assembly which calls my component. As such, using Assembly.GetCallingAssembly() seems to be a natural fit. However, I've found it works everywhere except for in Windows Store. Where it's supported: Phone 7.0+ .Net 1.0+ Portable Class Libraries However, where it's not supported is directly within a Windows Store application. I can make a portable class library and then call it from there inside of a Windows Store application, but I can't just put it

How to open a packaged file with WinRT

二次信任 提交于 2019-12-21 07:39:28
问题 I am trying to figure out how to port some .Net code that parsed an xml file to WinRT. So far, with the help of The given System.Uri cannot be converted into a Windows.Foundation.Uri, I have the below code. Still, I get stuck immediately after I create the Uri: static readonly Uri ResourcesBase = new Uri(@"ms-resource://MyAssembly/"); public override async void Load() { Uri uri = new Uri(ResourcesBase, filePath); // filePath = "Data//world.xml"; XmlLoadSettings settings = new XmlLoadSettings(

How to open a packaged file with WinRT

。_饼干妹妹 提交于 2019-12-21 07:39:18
问题 I am trying to figure out how to port some .Net code that parsed an xml file to WinRT. So far, with the help of The given System.Uri cannot be converted into a Windows.Foundation.Uri, I have the below code. Still, I get stuck immediately after I create the Uri: static readonly Uri ResourcesBase = new Uri(@"ms-resource://MyAssembly/"); public override async void Load() { Uri uri = new Uri(ResourcesBase, filePath); // filePath = "Data//world.xml"; XmlLoadSettings settings = new XmlLoadSettings(

Is Universal Windows Platform the replacement of WinRT of Windows 8 and Windows Phone apps?

老子叫甜甜 提交于 2019-12-21 07:24:13
问题 Is Universal Windows Platform the replacement of WinRT of Windows 8 and Windows Phone apps? I mean, there was a WinRT platform to develop metro apps exclusively for Windows 8. Now, that is replaced by UWP, isn't it? 回答1: That is correct, UWP is the new platform for ALL Windows devices going forward (Win 10+). However WinRT is not replaced by UWP but is instead an extension on top of it, making UWP a much broader set of APIs that can be used across even more devices. As Microsoft themselves