windows-runtime

Is there any way to write a WinRt (Metro) app that will also work on Windows 7 and Vista?

白昼怎懂夜的黑 提交于 2019-12-20 16:50:45
问题 We can’t just leave our customers that are not able to upgrade to windows 8 for a long time in the larch. However there is demand for a “tablet”/”touch” version of our app. So how can we support both touch with Metro on Windows 8 and our current customers from a single code base? When WPF come out, after a lot of “Pushing” Microsoft saw since and make it work on Windows XP – has anything like this been talked about for WinRT. (I am not expecting any solution to work on XP, as XP support is

Is there any way to write a WinRt (Metro) app that will also work on Windows 7 and Vista?

十年热恋 提交于 2019-12-20 16:50:14
问题 We can’t just leave our customers that are not able to upgrade to windows 8 for a long time in the larch. However there is demand for a “tablet”/”touch” version of our app. So how can we support both touch with Metro on Windows 8 and our current customers from a single code base? When WPF come out, after a lot of “Pushing” Microsoft saw since and make it work on Windows XP – has anything like this been talked about for WinRT. (I am not expecting any solution to work on XP, as XP support is

Windows 8 Modern UI Styles for WPF [closed]

懵懂的女人 提交于 2019-12-20 10:13: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 want my WPF app to look like WinRT apps: Are there any ready-made styles or controls available for WPF that lets us achieve this? 回答1: Take a look at MahApps.Metro Apps like Github for Windows use / are based on it. 回答2: Another nice library for Metroesque-styling of WPF apps is Modern UI for WPF. Can be

How to a synchronize tasks?

徘徊边缘 提交于 2019-12-20 10:11:59
问题 Say I have an async method which saves to file: async Task SaveToFileAsync() { var file = await folder.GetFileAsync ( ...) var stream = file.OpenFileAsync(...) ///etc } Now imagine that SaveToFileAsync is called twice simultaneously. This is a problem because you can't write on the same file simultaneously If this were a regular method, lock() would fix this: void SaveToFile() { lock(something) { /// code here } } However, lock is not allowed in an async method. Of course, one could call

UWP compiled binding x:Bind produces memory leaks

烂漫一生 提交于 2019-12-20 09:55:15
问题 While developing UWP application I recently found quite a few memory leaks preventing my pages from being collected by GC. I have a ContentPresenter on my page like: <ContentControl Grid.Column="0" Grid.Row="1" Content="{x:Bind ViewModel.Schedule, Mode=OneWay}"> </ContentControl> After I remove the Content, or replace it with dynamic {Binding} -- page is collected when I navigate from it. Otherwise it remains in memory. Is it bug or I'm doing something wrong? Is there a way to release and

Can I uniquely identify a device in Windows 10/Windows 8/WinRT

假装没事ソ 提交于 2019-12-20 09:39:11
问题 Is there any mechanism to identify a device uniquely (even if it is anonymous)? To be clear, by "device" I mean the computer/slate/pc. Windows 8.x http://codepaste.net/ybt893 string HardwareId() { var token = Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null); var hardwareId = token.Id; var dataReader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId); var bytes = new byte[hardwareId.Length]; dataReader.ReadBytes(bytes); return BitConverter.ToString(bytes); }

When should you use Task.Run() rather than await?

五迷三道 提交于 2019-12-20 05:15:28
问题 I am storing the state of my data model. I clone the data model and then want to have it written to "disk" asynchronously. Should I be using Task.Run() which runs it on a background thread? Or should I just make it an async function and not await on it? (this will make it run on the UI thread) Similar stuff to this, but my question is a bit different: async Task.Run with MVVM And what is the criteria to decide which to choose? Thanks! 回答1: You should use Task.Run for CPU-based work that you

Get HTTP-only cookie from Windows 8 JS App

好久不见. 提交于 2019-12-20 04:16:42
问题 I am making a Javascript Windows 8 app in which the user connects to my server and logs in. Currently, I am trying to use the XmlHttpRequest Object to do so (specifically, WinJS.xhr) but when I get the output of getAllResponseHeaders(), the Set-Cookie header isn't there (because it is an Http-only cookie). Is there any way to get http-only cookies from a JS Windows 8 app? All help is greatly appreciated and I always accept an answer! 回答1: As it turns out, Windows 8 apps are already able to

XAML ListView - Change Image Source for selected item

﹥>﹥吖頭↗ 提交于 2019-12-20 04:06:39
问题 I'm using a ListView with a Custom Template, something like this: <ListView.ItemTemplate> <DataTemplate> <Grid HorizontalAlignment="Center" Width="220" Height="220"> <Image x:Name="image" Stretch="UniformToFill" Source="{Binding Brand.Image, ConverterParameter=transparent, Converter={StaticResource LogoToUriConverter}}"/> <StackPanel VerticalAlignment="Bottom"> <TextBlock Text="{Binding Name}" Foreground="{StaticResource ApplicationColor}" Style="{StaticResource TitleTextStyle}" Height="30"

Filtering and Sorting of an ObservableCollection in ListView-Binding

故事扮演 提交于 2019-12-20 03:52:06
问题 In earlier Versions of .net you could use something like ICollectionView collectionView = CollectionViewSource.GetDefaultView(AllImages); To build up filter mechanisms for UI-Elements. But this doesn't seem to exist in WinRT anymore. I'm using a ListBox-Element to display an User-List. The User-Class contains the properties username (String), isOnline (Boolean), isFriend (Boolean) and unreadMails (Int). I need some kind of Filtering and sorting. Filter by: no Filter only isOnline == true