winrt-xaml

Value Type Duration is not allowed on property Duration in XAML

耗尽温柔 提交于 2019-12-24 02:14:18
问题 I am trying to do the following with an ordinary Windows Metro style application: public class MyButton : Button { public Duration Duration { get; set; } } <Grid> <local:MyButton Duration="0:0:0.2" /> </Grid> But I receive the error: Value Type Duration is not allowed on property Duration in XAML Any idea what I might be doing wrong? Any help would be greatly appreciated. 回答1: This is a bug in the Visual Studio 11 Beta XAML compiler. You cannot set user-defined value type properties via XAML.

Windows Store App: Eliminates GridView styles and use only for hub page layout

ⅰ亾dé卋堺 提交于 2019-12-24 01:51:26
问题 I try to make a Windows Store App (Metro) hub page which has four different templates with GridView. I referenced link in Creating hub page with different controls in Windows 8 page and it works fine. But GridView has a default style which interacts with touch(and mouse) activity. It grayed when hover, and shows click interaction. My question is, how to disable those behaviors? I tried to dig with Blend but hard to find the place to be customized. 回答1: Sorry I don't know MS Blend But in

GridView LostFocus and GotFocus events

自古美人都是妖i 提交于 2019-12-24 01:49:20
问题 The GridView GotFocus and LostFocus seem to fire each time focus is shifted from one GridViewItem to another. Is there any way to know when a GridView as a whole received and lost focus? MyGridView.GotFocus += MyGridView_GotFocus; MyGridView.LostFocus += MyGridView_LostFocus; The above events MyGridView_GotFocus & MyGridView_LostFocus fires each time focus is moved from one GridViewItem to another in MyGridView 回答1: Is there any way to know when a GridView as a whole received and lost focus?

How to animate at periodic intervals?

蹲街弑〆低调 提交于 2019-12-24 00:09:40
问题 I have a storyboard which animates a minute hand to slide 6 degrees. Now i want the minute hand to slide at every 59th second forever. Are there any properties of storyboard or any other way that i can do it? My storyboard <Storyboard x:Name="myStoryboard2"> <DoubleAnimation x:Name="minuteAnimation" Storyboard.TargetName="minHandTransform" Storyboard.TargetProperty="Angle" Duration="0:0:1" From="{Binding Time, Converter={StaticResource minuteHandTransform}}" To="{Binding Time, Converter=

UWP Template 10 create a dynamic hamburgermenu

老子叫甜甜 提交于 2019-12-23 20:06:17
问题 I'm pretty noob with UWP stuff. I'm trying to create dynamic hamburger menu. I was able to create PrimaryButtons element, and binding it in XAML worked as espected: var loginButton = new HamburgerButtonInfo(); loginButton.ClearHistory = true; loginButton.PageParameter = ""; loginButton.PageType = typeof(Views.Login); var stackPanel = new StackPanel { Orientation = Orientation.Horizontal }; stackPanel.Children.Add(new SymbolIcon { Symbol = Symbol.Contact, Width = 48, Height = 48 }); stackPanel

Adding TextBox in winRT MessageDialog

[亡魂溺海] 提交于 2019-12-23 19:32:14
问题 I'm working in windows 8 store application and I'm trying to popup a dialog to let the user enter information in a textbox for example. How to do that ? 回答1: The InputDialog control in WinRT XAML Toolkit does just that. It is basically a Popup control with a TextBox and some buttons. There is a sample for it too. The most basic one does this: var dialog = new InputDialog(); var result = await dialog.ShowAsync( "This is the title", "This is the content/message", "Option 1", "Option 2", "Option

Windows 8 button disappearing when mouse over

我是研究僧i 提交于 2019-12-23 16:33:22
问题 I have a settings control as follows (I promise I didn't really call my buttons button_1 and button_2): <UserControl x:Class="App1.SettingsPage" 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" d:DesignHeight="300" d:DesignWidth="646"> <Border BorderBrush="#FF590151"

Setting Image source programatically in Metro app, Image doesn't appear

☆樱花仙子☆ 提交于 2019-12-23 15:42:13
问题 I have a main page and a camera page in my application. The main page has an image that does not have its source set and a button. If you click the button, it will take you to the camera page. On the camera page, I capture an image and save it in the pictures library on the tablet and then navigate back to the main page where I would like to set the source of the image to the image I just captured and saved in my pictures library. Here is my relevant code. MainPage.xaml <Image x:Name=

Retrieving thumbnail of a StorageFile (Video) which is located in the localfolder of the app in WP8.1

混江龙づ霸主 提交于 2019-12-23 15:07:23
问题 I'm trying to get the thumbnail of the StorageFile located inside the application package (LocalFolder) of the app. The storage file is a media file which can be image(jpg or png) or a video (mp4 or wmv). Now when i try to get the thumbnail using GetThumbnailAsync(ThumbnailMode) method of the StorageFile class i get a System.Exception : The component cannot be found. error, while the same thing works fine if the file is image or a video which is not inside the app package. Here is the

How can I disable the arrows on a FlipView?

大城市里の小女人 提交于 2019-12-23 13:32:20
问题 I have a FlipView, which is working great, but I'd like to disable the < and > arrows that fade in while scrolling. 回答1: I think that would break the scenario for keyboard/mouse users, no? You could remove the buttons from the control template if you really need to. 回答2: Here are 2 options. Option 1. In FlipView.Loaded event dynamically remove the arrow buttons. private void flipView_Loaded(object sender, RoutedEventArgs e) { Grid grid = (Grid)VisualTreeHelper.GetChild(flipView, 0); for (int