winrt-xaml

Why do my images sometimes reload (and WriteableBitmaps disappear) on resume?

拜拜、爱过 提交于 2019-12-03 16:30:57
When I resume my app, sometimes it loses its images. I can reproduce this even in trivial apps. This manifests in two different ways, depending on where the image came from: If I did something like <Image Source="/Assets/Logo.png"/> (i.e., loading an image from my app package by URI), the image will disappear briefly, and then reload. This is easier to see when the screen contains many images; they reload in sequence, so I can watch the image loading ripple across the screen. If I created a WriteableBitmap and bound it to Image.Source, then the bitmap disappears entirely, never to return. I

How to Display Gridview items with variable width in Windows 8?

隐身守侯 提交于 2019-12-03 14:42:18
My GridView items having the size of it's first item size . How do i can change this behaviour ? How to display GridView items with variable Width as per the content ? I want to show the first one but i am getting second one. Any suggestion to do that? Check Windows 8 GridView and Variable-Sized Items and Different Sized Tile Items in WinRT GridView and also check Variable Sized Grid Template Hope this help You can create such view of GridView by setting ItemsPanel to WrapPanel , you can get WrapPanel on Jerry Nixon's blog . Here's the code. XAML <GridView x:Name="gv"> <GridView.ItemsPanel>

Page constructor gets called again when navigating back in Windows 8 C# App

喜夏-厌秋 提交于 2019-12-03 14:35:28
I have found that in Windows 8 apps, a Page's constructor always gets called again when navigating back to this page, however this is not the case in Windows Phone 7 apps. Because of this behavior all the properties of that page get lost and you need to somehow store them and reassign them after the page is reactivated. At the moment I am using the SaveState method to save the data and reassign the data in LoadState method. Both of the methods are built-in in the sample Grid/Split App. I wonder why it's designed this way and if there's any better way to maintain the instance of the page? You

How to Know When a FrameworkElement Has Been Totally Rendered?

旧城冷巷雨未停 提交于 2019-12-03 14:08:57
For WPF there is the ContentRendered event in the Window class which let us know when the visual elements have been rendered. Is there anything that would help me achieve the same result for UWP apps? I'd like know when a FrameworkElement has been completely rendered so I can trigger some actions after that. I don't think the Loaded event helps on that since it's triggered way before there's anything on screen. I would start with Loaded. It might be better than you think. https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.frameworkelement.loaded The Loaded event can be used

Inspecting XAML in Windows 8 Store Apps / VS2012

☆樱花仙子☆ 提交于 2019-12-03 12:59:32
问题 I'm looking for a way to inspect running XAML in a Windows 8 store app. Essentially, I want firebug / chrome inspector style functionality where I can look at the XAML source generated at runtime, to debug simple layout and style issues. I've tried Snoop, Pistachio and WPF Inspector but none work for Windows Store apps. The only one I can find which seems to work for Store apps is XAML Spy, which is €90. I can't justify that cost. Is there any other way to inspect running XAML? 回答1: The

Hiding the ellipsis within an AppBar

…衆ロ難τιáo~ 提交于 2019-12-03 12:36:28
问题 When you create an AppBar or a CommandBar in a UWP app, there's always an ellipsis hiding near the side of the control, like so: I don't want it in my app but I haven't found any methods/properties within AppBar that would help me get rid of it. It should be possible, because many of the default Windows 10 apps don't have it. For example, there's no ellipsis on the main menu bar below: Is it possible to hide the ellipsis using AppBar , or do I have to use a SplitView or some other control to

How to horizontally align AppBarButton in command bar

三世轮回 提交于 2019-12-03 12:23:45
问题 I want to align my single AppBarButton to the right on a CommandBar in a Page.BottomBar ? In design it shows the app bar button at the right side but in the emulator, the button is always at the center? Is there a way to align AppBarButton in a page bottom bar ? Edit: <Page.BottomAppBar> <CommandBar HorizontalAlignment="Right" HorizontalContentAlignment="Right"> <CommandBar.PrimaryCommands> <AppBarButton Margin="100,0,0,0" HorizontalAlignment="Right" HorizontalContentAlignment="Right"

Resource localization: use of x:Uid referring to another assembly's resource

[亡魂溺海] 提交于 2019-12-03 12:23:29
问题 I am writing a win8 application and will be using the built-in resource management system: resw file and x:Uid tags in my XAML code. So I create let's say a TextBox like that: <TextBlock Style="{StaticResource HeaderTextStyle}" x:Uid="ResourceTest"/> I create the corresponding resource file in my assembly with a ResourceTest.Text entry and it works fine: proper text is displayed at runtime. Now, I would like to move all my resx files to another C# Library for maintainability. So I put the

Enabling ScrollViewer HorizontalSnapPoints with bindable collection

走远了吗. 提交于 2019-12-03 11:55:25
问题 I'm trying to create a similar experience as in the ScrollViewerSample from the Windows 8 SDK samples to be able to snap to the items inside a ScrollViewer when scrolling left and right. The implementation from the sample (which works) is like this: <ScrollViewer x:Name="scrollViewer" Width="480" Height="270" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" ZoomMode="Disabled" HorizontalSnapPointsType="Mandatory">

XAML error: “The property 'VisualTree' is set more than once”

烈酒焚心 提交于 2019-12-03 10:36:56
I'm trying to put two Grids in a DataTemplate. I'm getting the following error with my code shown below. Error: "The property 'VisualTree' is set more than once" <DataTemplate x:Key="PareoItemTemplate"> <Grid x:Name="gridColorEjercicio" Height="100" Width="350" Background="#FFF0F0F0" Margin="-11,0,0,0"> <StackPanel Margin="0" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel Margin="0,10,15,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding