winrt-xaml

MessageDialog ShowAsync throws accessdenied exception on second dialog

☆樱花仙子☆ 提交于 2019-11-26 17:49:39
I am trying to implement try again/cancel dialog box in windows 8. The dialog box shows fine the first time, but on clicking try again and failing again, I get a access denied exception on calling ShowAsync. I don't know why, but its strange sometimes the code works fine and I don't get the exception when I put breakpoints. really clueless here here is the code. async void DismissedEventHandler(SplashScreen sender, object e) { dismissed = true; loadFeeds(); } private async void loadFeeds() { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { try { RSSDataSource

Windows 8 Winrt Application goes to background or close

谁说胖子不能爱 提交于 2019-11-26 17:17:06
问题 How can you tell when a windows 8 Metro app gets put in the background? The suspended state doesn't activate. I have a break point on. It only hits if I close the app. I am using a webcam and since no apps can run in the background I need to save my work when it's put in the background. The windows phone it was application deactivated. any help would be nice. 回答1: Apps do not normally get suspended when in the debugger. However, you can force a suspend when debugging by: Enabling the Debug

MediaElement in WinRT / Win8 does not work at all

删除回忆录丶 提交于 2019-11-26 17:08:21
问题 I'm getting really frustrated with WinRT (Windows 8 apps). I've been running into a lot of problems with the most basic functionality and no documentation to support it. So, here's my next question of the series I've already posted regarding WinRT: <MediaElement Width="500" Height="500" Source="ms-appx:///Assets/SampleVideo.wmv" /> Why doesn't this work?!!! No video displays. No audio played. No error messages. No exceptions thrown. None of these events are raised: MediaOpened MediaFailed

Windows 8 ListView with horizontal item flow

左心房为你撑大大i 提交于 2019-11-26 17:00:34
问题 How can i make the ListItems inside windows 8 ListView to flow horizontally. Default behavior is vertical, but i want to show the list in horizontal flow so it can render as panorama. I tried GridView which does support horizontal layout but there is a limitation on item height which does not show the complete item content for items with large text. 回答1: You can use a ListView this way: <ListView Height="500" VerticalAlignment="Center" ScrollViewer.HorizontalScrollBarVisibility="Auto"

How do I access a control inside a XAML DataTemplate?

余生长醉 提交于 2019-11-26 10:29:18
I have this flipview: <FlipView x:Name="models_list" SelectionChanged="selectionChanged"> <FlipView.ItemTemplate> <DataTemplate> <Grid x:Name="cv"> <Image x:Name="img1" Source = "{Binding ModelImage}" Stretch="Fill" Tag="{Binding ModelTag}"/> </Grid> </DataTemplate> </FlipView.ItemTemplate> I want to find img1 of currently selected index. While searching for it I found this method on some post here: private DependencyObject FindChildControl<T>(DependencyObject control, string ctrlName) { int childNumber = VisualTreeHelper.GetChildrenCount(control); for (int i = 0; i < childNumber; i++) {

Are Click, Tapped, and PointerPressed synonymous in WinRT-XAML?

有些话、适合烂在心里 提交于 2019-11-26 09:49:39
问题 Does it matter whether I create event handlers for PointerPressed, Click, or Tapped?IOW, is there any functional difference between the following: <Button x:Name=\"BackButton\" PointerPressed=\"BackButton_Click\"/> <Button x:Name=\"BackButton\" Click=\"BackButton_Click\"/> <Button x:Name=\"BackButton\" Tapped=\"BackButton_Click\"/> ? 回答1: Click is there for backwards compatibility, and is essentially the same as Tapped. Tapped is a "high level gesture" that will translate automatically to a

How do I print WebView content in a Windows Store App?

北城余情 提交于 2019-11-26 09:08:29
问题 I have a Metro App and I am attempting to Print the Content of a WebView control. Using the MSDN Print Sample as my source reference. I simply change the XAML in the printableArea as follows: <RichTextBlock> <Paragraph> <InlineUIContainer> <WebView Width=\"800\" Height=\"2000\" Source=\"http://www.stackoverflow.com\"/> </InlineUIContainer> </Paragraph> </RichTextBlock> This works partially. The problem is that the Visible area in the specified dimensions is Printed, i.e. The area that can be

ListViewItem won&#39;t stretch to the width of a ListView

╄→尐↘猪︶ㄣ 提交于 2019-11-26 08:01:36
问题 I\'m currently designing a windows 8 store app using XAML but I have a minor sizing issue. I have a ListView with a DataTemple. The code for my ListView & DataTemplate are below: <ListView x:Name=\"listPageItems\" Grid.Row=\"1\" SelectionMode=\"Extended\" IsSwipeEnabled=\"False\" ItemsSource=\"{Binding Mode=OneWay, Source={StaticResource items}}\" ItemTemplate=\"{StaticResource NavigationItemTemplate}\" ScrollViewer.VerticalScrollBarVisibility=\"Visible\"> </ListView> <DataTemplate x:Key=\

MessageDialog ShowAsync throws accessdenied exception on second dialog

别说谁变了你拦得住时间么 提交于 2019-11-26 05:36:34
问题 I am trying to implement try again/cancel dialog box in windows 8. The dialog box shows fine the first time, but on clicking try again and failing again, I get a access denied exception on calling ShowAsync. I don\'t know why, but its strange sometimes the code works fine and I don\'t get the exception when I put breakpoints. really clueless here here is the code. async void DismissedEventHandler(SplashScreen sender, object e) { dismissed = true; loadFeeds(); } private async void loadFeeds()

How do I do bindings in ItemContainerStyle in WinRT?

≯℡__Kan透↙ 提交于 2019-11-26 05:33:48
问题 I\'m trying to bind a collection to an ItemsControl, with a Canvas as the items panel, and with each item\'s Canvas.Left and Top bound to properties on the item objects. Basically I\'m trying to re-create the 2-D databinding I described in this post on my blog, but this time in WinRT instead of WPF. Since ItemsControl wraps your ItemTemplate content in another UI element (a ContentPresenter, in the case of WinRT), and it\'s those wrapper/container elements that are placed directly inside the