winrt-xaml

Filtering a GridView in Windows 8

孤街醉人 提交于 2020-01-02 08:11:52
问题 I currently have a GridView where the ItemsSource is set to an ObservableCollection. Updates to the underlying data are reflected in the UI without any effort on my part. Things are working well. What is the cleanest way to apply a filter to the ObservableCollection so that only certain items are displayed? Ideally I don't want to actually remove items from the ObservableCollection, nor do I want to maintain two distinct collections because it will make keeping things in sync more challenging

How can I remove pages from a Frame's history?

僤鯓⒐⒋嵵緔 提交于 2020-01-02 07:43:12
问题 How can I manipulate a Frame's history in a WinRT XAML app? The user will start on my hub page, where they can select an existing project to go to its edit screen, or they can select "new project". "New project" will take them through a short wizard, then take them to the "edit project" screen. It makes sense for the wizard pages to just be pages that I navigate to in the frame; that way the user can back out of the wizard if they change their mind. (It'll only be two pages, so "back" can

How to create a Tokenizing Control for UWP as known from Outlook when using To, Cc and Bcc

此生再无相见时 提交于 2020-01-01 17:01:07
问题 There is a great article about how to write a Tokenizing Control for WPF here: Tokenizing control – convert text to tokens But how is this accomplished in an UWP App? The Windows 10 UWP Mail client does this just fine, so I know that it is possible. But how? Tokenizing is super useful for To/CC/BCC input areas, as we know it from Outlook and lately from the Windows 10 UWP Mail client. I suspect that RichTextBlock or maybe RichEditBox combined with AutoSuggestBox could be part of the answer,

How do you capture current frame from a MediaElement in WinRT (8.1)?

纵饮孤独 提交于 2020-01-01 14:55:09
问题 I am trying to implement a screenshot functionality in a WinRT app that shows Video via a MediaElement. I have the following code, it saves a screenshot that's the size of the MediaElement but the image is empty (completely black). Tried with various types of Media files. If I do a Win Key + Vol Down on Surface RT, the screen shot includes the Media frame content, but if I use the following code, it's blackness all around :( private async Task SaveCurrentFrame() { RenderTargetBitmap

Binding to the IsSelected property of the parent ListViewItem

巧了我就是萌 提交于 2020-01-01 08:24:36
问题 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="

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

XAML error: “The property 'VisualTree' is set more than once”

让人想犯罪 __ 提交于 2020-01-01 04:11:06
问题 I'm trying to put two Grids in a DataTemplate. I'm getting the following error with my code shown below. Error: "The property 'VisualTree' is set more than once" <DataTemplate x:Key="PareoItemTemplate"> <Grid x:Name="gridColorEjercicio" Height="100" Width="350" Background="#FFF0F0F0" Margin="-11,0,0,0"> <StackPanel Margin="0" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel Margin="0,10,15,0" Orientation="Horizontal" HorizontalAlignment="Center"

How do I grab frames from a video stream on Windows 8 modern apps?

自作多情 提交于 2019-12-31 12:08:28
问题 I am trying to extract images out of a mp4 video stream. After looking stuff up, it seems like the proper way of doing that is using Media Foundations in C++ and open the frame/read stuff out of it. There's very little by way of documentation and samples, but after some digging, it seems like some people have had success in doing this by reading frames into a texture and copying the content of that texture to a memory-readable texture (I am not even sure if I am using the correct terms here).

Serializing a BitmapImage in WinRT

淺唱寂寞╮ 提交于 2019-12-31 05:30:05
问题 public static async Task SaveFileAsync(string FileName, T data) { MemoryStream memStream = new MemoryStream(); DataContractSerializer serializer = new DataContractSerializer(typeof(T)); serializer.WriteObject(memStream, data); StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync(FileName, CreationCollisionOption.ReplaceExisting); using (Stream stream = await file.OpenStreamForWriteAsync()) { memStream.Seek(0, SeekOrigin.Begin); await memStream.CopyToAsync(stream);