windows-runtime

Show flyout using BottomAppBar

a 夏天 提交于 2019-12-22 03:59:29
问题 I'm trying to show a simple Flyout (with informational content) when a AppBarToggleButton within BottomAppBar is pressed, but my solution doesn't work. :( This is my code: <Page.BottomAppBar> <CommandBar> <AppBarToggleButton x:Uid="MapPageAppBarLegend" Label="" Icon="List"> <FlyoutBase.AttachedFlyout> <Flyout> <TextBlock Text="Informations here..."/> </Flyout> </FlyoutBase.AttachedFlyout> </AppBarToggleButton> </CommandBar> </Page.BottomAppBar> Nothing appears.. Can anyone help me to showing

Why do WinRT types have to be sealed?

自古美人都是妖i 提交于 2019-12-22 03:43:58
问题 In several places (e.g. "Creating Windows Runtime Components for JavaScript, in C# and Visual Basic" on MSDN), I've seen it specified that, if you write a class in .NET that you want to use from JavaScript, then you must make it a sealed class. This seems like an arbitrary restriction. Why can JavaScript only work with sealed classes? 回答1: Windows runtime objects exposed to JavaScript applications are sealed from a JavaScript perspective - you can't add expando properties to WinRT objects.

Loading Loose Xaml with custom controls on WinRT fails unless dummy DataTemplate exists

北慕城南 提交于 2019-12-22 01:32:02
问题 In ReactiveUI, I run this code at a certain point: const string template = "<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:routing='using:ReactiveUI.Routing'>" + "<routing:ViewModelViewHost ViewModel=\"{Binding}\" VerticalContentAlignment=\"Stretch\" HorizontalContentAlignment=\"Stretch\" IsTabStop=\"False\" />" + "</DataTemplate>"; var theTemplate = XamlReader.Load(template); On other platforms, this works great (the xmlns declaration is different of

sqlite in windows runtime component

匆匆过客 提交于 2019-12-22 01:03:20
问题 am trying to use sqlite in a windows runtime component. But I get some 219 errors when i add the nuget sqlite-net package. couldnt figure it out anywhere. Any similar issues ? I finally used a store app class library to use sqlite and called those methods in it from my windows runtime component. method in store app public async Task<IEnumerable<TaskGroup> > GetTaskGroup() { return await conn.QueryAsync<TaskGroup>("select * from TaskGroup"); } calling method in win runtime component public

winRT drag and drop, swap two items instead of inserting

十年热恋 提交于 2019-12-21 23:22:42
问题 I'm a long time WPF user but new to WinRT. I'm wondering if there's a built in way or easy way to integrate swapping functionality in containers so that a swap exchanges two items in the container. The behavior desired is drag an item and drop it on another item and have both the dragged item and the item it's dragged onto get their positions in the container swapped). Example I have a list with 1 2 3 4 5 6 7 8, if I drag 7 "on" 4 I want the two items swapped so that the resulting list

Where do I find conceptual documentation for Windows Runtime? [closed]

为君一笑 提交于 2019-12-21 23:00:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm trying to learn enough about Windows Runtime to make a recommendation about what it would entail for my employer to port our

PostAsync throwing IRandomAccessStream error when targeting windows 10 UWP

本小妞迷上赌 提交于 2019-12-21 21:50:49
问题 I'm in the process of porting my windows 8.1 app to windows 10 UWP, but calling PostAsync now throws an exception. This exact code works perfectly when targeting 8.1, but when I target Windows 10 UWP, it throws the following exception: This IRandomAccessStream does not support the GetInputStreamAt method because it requires cloning and this stream does not support cloning. Code public async void TestPost() { var parameters = GetParameters(); var formattedData = new FormUrlEncodedContent

How to detect when Windows 8 goes to sleep or resumes

空扰寡人 提交于 2019-12-21 21:40:28
问题 I have an app that keeps a connection alive to a server, however if the user walks away and the tablet goes to sleep, I would like to handle the disconnect gracefully, and I would also like to log back in when the user wakes the tablet. I've tried in my putting the following code in my connection class, but they never get fired. Application.Current.Suspending += this.OnAppSuspending; Application.Current.Resuming += this.OnAppResuming;; 回答1: For desktop apps, you can use SystemEvents

Launching WinRT app from PowerShell

淺唱寂寞╮ 提交于 2019-12-21 20:54:59
问题 I have a Windows RT app that I need to launch with a script. I've already installed the app on the device with PowerShell, but I need to launch the app with PowerShell or the command prompt. Is there a way to do this? Thanks. P.S. It looks like there's a way to launch Metro apps on Windows 8 with the Start-MetroApp command, but this doesn't work on Windows RT. Is there some sort of equivalent for Windows RT? 回答1: You can use protocol activation, if you want to make your app such that any one

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

寵の児 提交于 2019-12-21 20:48:10
问题 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