windows-runtime

Why can I not blocking main thread in WinRT(Windows Store App)?

老子叫甜甜 提交于 2019-12-06 09:53:25
问题 This question is not about "should I block my main thread" as it is generally a bad idea to block a main/STA/UI thread-for messaging and UI operations, but why WinRT C++/cx doesn't allow any blocking of the main thread compared to iOS, Android, and even C#(await doesn't actually block though). Is there a fundamental difference in the way Android or iOS block the main thread? Why is WinRT the only platform that doesn't allow any form of blocking synchronization? EDIT: I'm aware of co-await in

How to change SelectedBackground in ListViewItemPresenter inside a GridView

左心房为你撑大大i 提交于 2019-12-06 09:40:30
问题 I have a Clickable-Gridview insde a HubSection: <HubSection > <DataTemplate> <GridView IsItemClickEnabled="True" ItemClick="Hub_OnClick"> <RelativePanel > <TextBlock Text="NiceText" /> </RelativePanel> </GridView> </DataTemplate> </HubSection> Now everytime I've clicked on that hub, a blue-border will appear around the GridView (SelectedBackground). In LiveVisualTree it shows me, that the border is from a "ListViewItemPresenter" control inside the GridViewItem. Therefore I modified the style

How to download a webpage in MetroStyle app (WinRT) and C#

可紊 提交于 2019-12-06 09:28:40
I'm creating a MetroStyle app and I want to use a website API that is based on the HTTP Get methods. For instance to login I should download the XML returned by this URL: websitehost.com/api/login.php?u=username&p=password The problem is that the new MetroStyle apps won't let me to use many of the methods I've been using for years in .Net so how can I download the returned XML document and parse it? Akku You might be searching for this: public async Task<string> DownloadPageStringAsync(string url) { HttpClientHandler handler = new HttpClientHandler() { UseDefaultCredentials = true,

Metro style : Scrolling with mouse wheel

試著忘記壹切 提交于 2019-12-06 09:19:48
I have gridview in the gridview and want to implement the mouse wheel scrolling functionality. So I added this block into the internal gridview <GridView.Template> <ControlTemplate > <ItemsPresenter /> </ControlTemplate> </GridView.Template> But in this case swiping doesn't work How manage I to solve this problem? part 2. I'll try to describe this situation more deeply. I have main screen that should realize functionality like on the main screen in Windows 8. It should be zoomed in/out. That's why i use SenaticZoom. In to ZoomIn I put GridView, that contains controls. The control contain own

Background Task doesn't start

左心房为你撑大大i 提交于 2019-12-06 09:02:11
问题 I trying to figure out why the backgroundtask won't start, but I have no idea, what I'm doing wrong. What am I trying to do: I want to have an automated background task which will download the 5 latest items through a WebApi (data is a couple kB). After downloading it will check the local file, to see if there are any new items available. If so, I want to create a Badge on the LiveTile with the number of new items. I have the following code: private BackgroundTaskRegistration

How to switch between webcams when using CaptureElement/MediaCapture? [closed]

拥有回忆 提交于 2019-12-06 08:56:08
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am trying to provide an option to switch between webcams used to display preview using CaptureElement/MediaCapture. Unfortunately I tried multiple combinations of call sequences and the preview only shows up for the first device I use. This is what I have been trying to do: XAML: <CaptureElement x:Name="captureElement" Stretch="UniformToFill" /> C#: MediaCapture mediaCapture; DeviceInformationCollection

RightTapped not fired on Metro ListViewItem if ListView in other than “None” selection mode

柔情痞子 提交于 2019-12-06 08:48:00
问题 The issue is practically the same as described here: http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/542b827a-7c8e-4984-9158-9d8479b2d5b1 but I am not satisfied with the answer accepted there and feel that there must be a better solution... I am trying to implement a 'clasic' context menu on my list view (not via the AppBar but via PopupMenu) and that works fine, however only if I set the list view into the "None" SelectionMode. The link above correctly explains that

Why is PayPal not working inside a WinRT WebView control

断了今生、忘了曾经 提交于 2019-12-06 08:19:23
I am writing a Windows 8 app where the user is able to do in-app purchases. Our Client provides us with a REST API. Basically I get product information from this REST API and if the user chooses to buy a product I tell the REST API to start a transaction. As a result I am receiving a PayPal URL for the payment transaction. I am navigating to that URL using the WebView control that is built into the WinRT. Unfortunately the PayPal website does not behave properly in the WebView control. When I am signing into PayPal, the purchase overview page where I am able to pay for the product is loaded,

Sdk for Dropbox, EverNote and Google Doc (WinRT)

筅森魡賤 提交于 2019-12-06 08:07:30
问题 Is there any official Winrt SDK's are available for Dorpbox, EverNote and GoogleDoc. I searched for this in the internet but didn't find any working solutions. If anyone know more about this(Either official or 3rd party sdk's) Please share your thoughts with me. Thanks in advance, Stephan 回答1: Dropbox don't have WinRT api and probably it' wont change in near future, but you can also use REST Api: https://www.dropbox.com/developers/core/api So you can simply use this REST api because Windows 8

Doing localization in visualstatemanager by changing x:uid?

折月煮酒 提交于 2019-12-06 08:01:41
I am adding localization to my UWP app by adding x:uid tags to all of my elements and using the multilingual toolkit. However I've run into an issue where in one case I change the text itself in the narrow view using the visualstatemanager. How can I do this in a localized app? My first thought would be to change the uid of the element to the new match the new text, I'm not sure it's possible. Here is an example of what I'd like to do, but doesn't work: <textblock x:Name="DescriptionTextBox" x:uid="DescriptionTextBox"/> // Normal long description .... <VisualState x:Name="NarrowState">