winrt-xaml

C#/XAML Compile Error - Various Errors (The name “LayoutAwarePage” does not exist\")

主宰稳场 提交于 2019-12-04 03:34:10
EDIT : Here are the pastebins for the code: BasicPage1.xaml.cs BasicPage1.xaml LayoutAwarePage.cs EDIT 2 I have added a MS Connect ticket here: https://connect.microsoft.com/VisualStudio/feedback/details/771648/c-xaml-compile-error-various-errors-the-name-layoutawarepage-does-not-exist#tabs Right a head scratcher which I'm hoping others have experienced and know how to resolved as I'm a little disheartened by the whole affair. The Problem I have been working on a Windows Store App using C#/XAML to learn the ropes. After hours spent learning I decided to start my own App, which is fine. The

How to databind control height to another control's height?

99封情书 提交于 2019-12-04 03:21:33
问题 I'm trying to have 2 controls have the same height. Can I do it with XAML only? If I did something like <Canvas Height="{Binding Height, ElementName=AnotherControl}" /> it doesn't actually do anything and the height goes to zero. The Output panel doesn't complain about any binding errors so AnotherControl.Height really exists. I tried binding to ActualHeight but it doesn't do anything either. Anything else I missed? 回答1: My guess is that you AnotherControl is not explicitly given a Height .

Using ScrollViewer for image pinch-zoom, keeps snapping left on pan

感情迁移 提交于 2019-12-04 02:50:38
I am trying to use a XAML ScrollViewer to 'cheaply' add pinch-zooming to an image. The issue however is that when panning around the image, it keeps snapping to the very left. If I slide it right, it looks fine, but the second I release the image, it snaps back to the left. This problem only persists horizontally - for vertical panning, it works fine. I abstracted this to the most simple test case, and it persists. My XAML code is as follows: <ScrollViewer> <Image Source="http://i.imgur.com/1WlGT.jpg" /> </ScrollViewer> Any help is appreciated. I've resolved this. The issue is you have to

ListView isSelected

*爱你&永不变心* 提交于 2019-12-04 02:35:41
I have an listview in my xaml that i populate with items like this: List<DataLayer.Models.Dictionary> dicts = DataLayer.Manager.getDictionaries(); if (dicts != null) { foreach (DataLayer.Models.Dictionary dict in dicts) { this.itemListView.Items.Add(dict); } } My DataLayer.Models.Dictionary object have an isSelected property along with a Name and a SubName . Name and SubName works fine in the template but how can i go about getting the item to be selected and also updated when user clicks an item? Thanks! Edit: My xaml now looks like this, but the item is still not selected <ListView x:Name=

Binding to the IsSelected property of the parent ListViewItem

大城市里の小女人 提交于 2019-12-04 02:16:07
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="*"></ColumnDefinition> <ColumnDefinition Width="200"></ColumnDefinition> </Grid.ColumnDefinitions>

Saving images locally in windows phone 8.1 universal app

余生长醉 提交于 2019-12-03 22:45:11
I want to download and save(cache) images locally in windows phone 8.1 universal app. so that if Phone is offline I can show users images(avatars) in ListView. What is the best way of saving images to local storage(should I use local storage or I use sqlite as i am using sqlite to store user's other information)? How can I save (download) images to local store? Thanks! There's a great extension by Q42 in their Q42.WinRT framework called ImageExtensions.cs You use it on normal Image objects in XAML, but instead of setting the Source of the Image, you set the ImageExtensions.CacheUri. <Image

Popup windows doesn't move up when Surface keyboard is shown in Windows 8 store app

只愿长相守 提交于 2019-12-03 21:43:33
问题 I have a windows store application that requires the users to enter data via numerous textboxes. When a textbox near the bottom of the screen has focus the on screen keyboard appears and moves the content of the page up. This is great and what I want. My problem occurs when I have a popup window. When my popup window appears it is practically full screen. The popup window's child is a user control which again has lots of textboxes on it. When one of the textboxes near the bottom of the page

Metro App Change ListView Selected Item Content Foreground

删除回忆录丶 提交于 2019-12-03 21:42:27
I have a ListView and modified it's DataTemplate with 2 TextBlocks . The first TextBlock contains a Heading , the second a Sub-Heading . I style the 2 TextBlocks with different colours. Here's an example of the ListViewItem in Normal view. Here's an example of the ListViewItem in Selected view. So my question is how do I change the Foreground colours of the TextBlocks in Selected views? Hoping to do this in the xaml. I've tried setting different brushes, which work for items that haven't explicitly been styled. Not sure how to handle this scenario. You can use visual states. <ListView>

Metro App CollectionViewSource ObservableCollection Filter

谁说胖子不能爱 提交于 2019-12-03 20:43:39
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? 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(comparer) { } public ObservableCollectionView(IComparer<T> comparer, IEnumerable<T> collection) : base(comparer,

In WinRT api, how to accept user input in a dialog just like in Weather and Finance apps

ぃ、小莉子 提交于 2019-12-03 18:01:56
问题 I am trying to display a dialog that allows the user to type a location, just like in the "add places" function of the Weather App on Windows 8. Windows.UI.Popups namespace does not have an appropriate control. It has the MessageDialog, but I don't think it can be customised to include a textbox in it. Would I need to use Windows.UI.XAML.Controls.Primitives.Popup control by any chance? 回答1: There is no out of box control beyond Popup to handle this style of UI, the Callisto library uses this