windows-runtime

Binding to the IsSelected property of the parent ListViewItem

≯℡__Kan透↙ 提交于 2020-01-01 08:23:04
问题 I'm attempting to bind the Visibility property of a TextBlock that's held within the ItemTemplate for a ListView to the IsSelected property of the TextBlock's parent ListViewItem. With this markup, the TextBlock is always visible. <ListView x:Name="ItemListView" ItemsSource="{Binding Path=Accounts}" Margin="60,0,0,10" Grid.Row="1" Grid.Column="0"> <ListView.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="100"> </ColumnDefinition> <ColumnDefinition Width="

Metro App CollectionViewSource ObservableCollection Filter

吃可爱长大的小学妹 提交于 2020-01-01 06:41:47
问题 It appears that filtering an ObservableCollection with CollectionViewSource is not possible in WinRT : See here! I can filter using LINQ , but how do I get the UI to update if changes that affect the filtered data are made? 回答1: I ended up writing my own class to achieve the desired effect: public class ObservableCollectionView<T> : ObservableCollection<T> { private ObservableCollection<T> _view; private Predicate<T> _filter; public ObservableCollectionView(IComparer<T> comparer) : base

Saved files sometime only contains NUL-characters

北城以北 提交于 2020-01-01 05:22:07
问题 We have a problem in our Windows 8.1 application (WinRT) that sometimes our saved file gets corrupt. The files have a correct file size, but the file only contains NUL-characters. The file should contain a serialized object as XML. In an attempt to find the issue we do not overwrite the file, we do the following: Serialize the current object to a temp file. Check the content of the temp file Copy the current file (to .timestamp.xml.bak) Move/replace the temp file to the current file Most of

Referencing C Dlls from Windows 10 Universal App Across CPU Architectures

半腔热情 提交于 2020-01-01 04:52:06
问题 Basic question/summary: I need to reference a binary (dll) created by someone else in C from a Win 10 universal app project. However, there is a separate dll for x86 and arm. I believe I need to reference the dll (or at least winmd file) from the project for it to be deployed, but I can only reference one file not both. That means the app fails on one platform or another (desktop or phone) because it has the wrong binary included. Looking for a solution. More detailed explanation; I am trying

How do we verify Windows 8 in-app billing receipt on the server side?

五迷三道 提交于 2020-01-01 03:39:10
问题 I am currently implementing in-app purchases in an app that I am working for Windows 8. After reading the documentation: Request the license Information for the app: msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.store.licenseinformation.aspx This tells you if the app is trial or not, and the list of products bought using in-app. To perform a purchase you need to use the objects: CurrentApp: In live environment. This will only work when the app is APPROVED in the store

How to use legacy COM component from metro app

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-01 03:33:06
问题 I'm getting hard time to use COM objects in a metro app. As stated in MSDN the rules are: Only registration free COM objects can be used The COM can use only those APIs which are allowed for metro apps. But my CoCreateInstanceFromApp always returns REGDB_E_CLASSNOTREG. In desktop applications an error is written into the event log that SideBySide execution fails. But in metro application no such error is written into the event log. I can use the same COM object from a desktop application as

Simulating a Windows 8 Store apps purchase

雨燕双飞 提交于 2020-01-01 03:04:05
问题 I am trying to put together code that simulates purchases for a Windows 8 (Store) app. The code is pretty simple and uses the Windows API: var result = await CurrentAppSimulator.RequestProductPurchaseAsync("product", true); // this is still false... var active = CurrentAppSimulator.LicenseInformation.ProductLicenses["product"].IsActive; The first call opens up the dialog that allows me to simulate the return code from the purchase. Even when i select S_OK, the next line still checks to see if

Where's the HttpUtility.ParseQueryString Method in WinRT?

老子叫甜甜 提交于 2020-01-01 02:45:18
问题 Since HttpUtility is not available in WinRT, I was wondering if there's a straightforward way to parse HTTP query strings? Is there actually some equivalent to HttpUtility.ParseQueryString in WinRT? 回答1: Instead of HttpUtility.ParseQueryString you can use WwwFormUrlDecoder. Here's an example I grabbed here using System; using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; using Windows.Foundation; [TestClass] public class Tests { [TestMethod] public void TestWwwFormUrlDecoder() { Uri

Can't load WinRT Component unless I reference the project

*爱你&永不变心* 提交于 2019-12-31 22:42:10
问题 I'm running into an odd problem. I created a Windows Runtime Component (for Windows Store) that makes some legacy C/C++ code available to .NET via some C# wrapper classes. I wrote a test harness Store App (hereafter referred to as "test1") that references the WRC project (both projects in the same solution). It calls into the component and everything works fine. Next I take the following output files from the WRC project: MyWrtComponent.dll MyWrtComponent.exp MyWrtComponent.pdb MyWrtComponent

What replaces CommandManager in WinRT?

北城以北 提交于 2019-12-31 20:39:11
问题 I'm getting started with Metro style applications (I know we're not supposed to call it Metro, but I can never remember what it's supposed to be called...), and I'm implementing a DelegateCommand class for use in MVVM. In WPF, the ICommand.CanExecuteChanged event is typically implemented like this: public event EventHandler CanExecuteChanged { add { CommandManager.RequerySuggested += value; } remove { CommandManager.RequerySuggested -= value; } } But the CommandManager class does not exist in