winrt-xaml

How to animate TextBlock when its value changes in WinRT XAML?

自作多情 提交于 2019-12-05 21:43:20
I have the following Storyboard <Storyboard x:Name="DeleteStoryboard"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="StatusTextBlock"> <EasingDoubleKeyFrame KeyTime="0" Value="1"/> <EasingDoubleKeyFrame KeyTime="0:0:4" Value="1"/> <EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/> </DoubleAnimationUsingKeyFrames> </Storyboard> and the following TextBlock <TextBlock x:Name="StatusTextBlock" Text="{Binding Status}"> Both are in SettingsFlyout not a Page . I want the Storyboard to start when the TextBlock value changes. I'm using MVVM, so

CanExecute() returns true and button is still disabled

最后都变了- 提交于 2019-12-05 21:38:38
I have a BottomAppBar.AppBarButton in a Windows Phone specific page, that is bound to a relay command. The code, binding and viewmodel implementation have all been used in basically the same way on other pages in the project and works exactly as expected there. The issue in this particular scenario is that the button remains disabled even after raising the .RaiseCanExecuteChanged() method, and the CanExecute() returns true . I originally thought that it might be due to excess calls to manually raising the notification with property changes, so have tightened that part of my code so that the

Filtering a GridView in Windows 8

南楼画角 提交于 2019-12-05 20:43:08
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. CollectionViewSource looked promising but the Windows Store App implementation seems to lack the

SearchBoxControl has focus on app launching on Win8.1

*爱你&永不变心* 提交于 2019-12-05 19:44:59
I'm using the new SearchBox Control in my Windows 8.1 app, but everytime I launch the app the SearchBox has the focus and displays the search history. I've tried to set the focus on another control on my page, but it doesn't work. So how can I start my app without showing the search history? Thanks. Here's my guess. You are attempting to set focus to something else on the page, but there's actually nothing else on your page that can accept a programmatic focus. To test this, simply add a <Button /> to your page and set the focus to that. Buttons are perfect for this test, as would be a

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

落花浮王杯 提交于 2019-12-05 19:24:23
问题 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

ListView isSelected

南笙酒味 提交于 2019-12-05 19:02:40
问题 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

How to read Windows.UI.XAML.Style properties in C#

帅比萌擦擦* 提交于 2019-12-05 18:51:42
I am writing a class that will convert a HTML document to a list of Paragrpahs that can be used with RichTextBlock in Windows 8 apps. I want to be able to give the class a list of Styles defined in XAML and the class will read useful properties from the style and apply them. If I have a Windows.UI.XAML.Style style how do I read a property from it? I tried var fontWeight = style.GetValue(TextElement.FontWeightProperty) for a style defined in XAML with TargetProperty="TextBlock" but this fails with and exception You could try this: var fontWeightSetter = style.Setters.Cast<Setter>()

is there an equivalent of wp7's marketplacereviewtask for windows 8 / winrt / metro style?

早过忘川 提交于 2019-12-05 16:30:01
I've looked through MSDN on both the Store API and the Launchers collection, and can't seem to find a task or launcher that would open up an application in the Marketplace application ready for a user to rate, as we could really easily do in Windows Phone 7 . Is there an alternative way that I can easily point a user towards leaving a review/rating, or are we going to have to wait until MS provides this, or does it already exist? I believe, or should I say "I hope", that the "rate and review" command appears automatically under the settings charm for all applications downloaded from the store.

ScrollViewer in Windows 8: always show vertical scrollbar

北慕城南 提交于 2019-12-05 12:33:16
How always show vertical scrollbar in the scrollviewer? It disappear in few seconds, but I want to make scroll visible all the time when scrolling is available Thanks for any help I think there might be a bug in the control in Windows 8 Consumer Preview, since the following should normally work: <ScrollViewer Style="{StaticResource VerticalScrollViewerStyle}" VerticalScrollBarVisibility="Visible" Template="{StaticResource ScrollViewerControlTemplate1}"> As a workaround you can modify the template of the ScrollViewer: <ScrollViewer Style="{StaticResource VerticalScrollViewerStyle}" Template="

Equivalent of editable ComboBox in WinRT?

痴心易碎 提交于 2019-12-05 12:08:07
The standard (desktop) windows combobox has three styles; Simple, Dropdown, and Drop List. Dropdown works like an edit control and a combobox, whereas Drop List doesn't allow editing. Am I missing something, or does the XAML ComboBox control in a Windows 8 store app only support the Drop List style? I was halfway through implementing something when I ran into this, and the more I look, the more it seems that it just isn't supported. Do I really need to replace the ComboBoxes in my screens with an edit control followed by a listbox? Yuck. thanks to edward.ho.tpe's answer I wrote myself a little