winrt-xaml

Simple hover effect in XAML?

此生再无相见时 提交于 2019-12-10 23:33:33
问题 So, I was recently frustrated with a challenge to copy this effect: <style> a:hover {background-color:yellow; } </style> Using the XAML implementation in WinRT. What is the most condense solution? 回答1: Okay, so here's my attempt: <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="VisualStateGroup"> <VisualState x:Name="Normal"/> <VisualState x:Name="Hover"> <Storyboard> <ColorAnimation To="Yellow" Duration="0" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)

Databind a nullable type in XAML\Windows 8 store app

依然范特西╮ 提交于 2019-12-10 22:51:47
问题 I have a TextBox in XAML which I'm trying to databind to a nullable int. This is the code for my textbox and linked converter: <TextBox x:Name="textArea" InputScope="Number" Text="{Binding Area, Mode=TwoWay, Converter={StaticResource NullableValueConverter}}" /> public class NullableValueConverter:IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { return value; } public object ConvertBack(object value, Type targetType, object parameter,

Windows 8 XAML: Displaying a list of images in a GridView through data binding

拈花ヽ惹草 提交于 2019-12-10 18:54:37
问题 I am trying to write a Windows 8 app in C# in which I want to display a list of images that the user selects through FileOpenPicker. I wish to display these images in a GridView using XAML Data-binding. I have tried a few things but the data-binding doesn't seem to work. I am not sure at what location exactly do I need to set the itemssource of the GridView. If I do it in the MainPage constructor then the GridView doesn't get refreshed as the data-bound list gets populated later as the user

How to implement Error Logging in Windows 8 METRO application?

此生再无相见时 提交于 2019-12-10 18:53:15
问题 Hi i am developing an windows 8 c#/xaml Metro application. i want to implement error logging in my app. I want to handle error logs in better way. 1) How can log the error information(so that it will be helpful for the developer to rectify the error) 2)Are there any 3rd party tools / free library's for error logging in metro apps. 3)What are the various alternatives available for error logging ?? 4)What is the best followed practice for error logging ?? Please help me out. Your answer will be

how to disable caching HTTP GET in metro app, I am using IXMLHTTPRequest2

六眼飞鱼酱① 提交于 2019-12-10 18:10:18
问题 I am doing an http GET to fetch data, I am using IXMLHTTPRequest2. If I GET url "http://foo.com" (curl "http://foo.com"), the second time I get this url again, the content on server is actually changed, but what I am getting is the cached result. Caching seems only honor URL, so if different header with same URL, still same cached result. I have tried "Cache-Control: no-cache", "Cache Control: no-store", and "Pragma: no-cache". None of them are honored by the API. Is there a way to turn cache

Programmatically dismiss a MessageDialog

橙三吉。 提交于 2019-12-10 18:08:20
问题 On Windows Phone 8.1, how to programmatically dismiss a MessageDialog after the ShowAsync call? I’ve tried calling IAsyncInfo.Close(), it just throws an InvalidOperationException "An illegal state change was requested". I’ve tried calling IAsyncInfo.Cancel(). The dialog stays visible, the only result - after I tap the “Close” button, TaskCancelledException is marshaled to the awaiting routine. Update: exact behavior depends on the sequence of the calls. If IAsyncOperation.Cancel() is invoked

Binding Command of Button in AppBar does not work

只谈情不闲聊 提交于 2019-12-10 17:15:01
问题 Why does the Command in the following example not execute? I have a named Page with an AppBar and a Button in it: <Page x:Class="App13.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Name="myPage" > <Page.BottomAppBar> <AppBar> <Button Content="OK" Command="

How to set vertical offset for popup having variable height

天涯浪子 提交于 2019-12-10 17:10:02
问题 I am developing Windows 8 (I know Windows 8.1 has Flyout control) app using C#/XAML. I want to show a flyout menu like given below. Now originally it has total 10 options but based on context I am showing certain amount of options, so the usercontrols doesn't have fixed height, it's Auto. I followed this article to correctly appear flyout on appbar button click. But it's not useful for me because it's using usercontrol's height and for my case it's NaN . So any one has any better solution to

Virtualisation not changing properties of new visible items

限于喜欢 提交于 2019-12-10 16:03:38
问题 I am currently using a custom Image object(a wrapper around <Image> object) in a listView. The properties of my custom Image object don't change when a new listview item is visible(realised). For instance if my listview (containing 30 items with different image urls and different text) has 3 items on the first scroll then the 10th item has the same image as the 1st item. The images repeat in the order [1-9][1-9][1-9].... But to my surprise the text is different in all 30 listViewItems. On

MediaElement Source cannot be set after SaveState/LoadState

时间秒杀一切 提交于 2019-12-10 15:58:29
问题 ( Note: All code has been severely simplified. ) Problem MediaElement source not being set after Suspend/Resume. The CurrentState quickly changes to "Closed" after the source is set. I am handling the MediaFailed event — it doesn't fire. I am also handling the MediaOpened event, which doesn't fire either. Details I have the following method which updates the MediaElement's Source. It works really well as long as the app is not trying to resume after having been Suspended. private async void