winrt-xaml

How to TILE a background image in WinRT?

可紊 提交于 2019-11-30 14:46:32
问题 With the absence of VisualBrush in WinRT, I am not sure the approach. Anyone? 回答1: At the moment I don't believe there is a way, while ImageBrush inherits from TileBrush it's missing the important property TileMode. It's unclear whether this will be included in later versions. 回答2: Indeed there hasn't been much information given in regards to XAML styling WinRT besides changing Dark and Light themes... so I guess we have to fiddle and experiment... While doing some googling on the web I came

Why can't I use {x:Bind {RelativeSource Self}} in a data template?

房东的猫 提交于 2019-11-30 14:42:26
If I use {x:Bind {RelativeSource Self}} in a data template, I get the following error while compiling: Object reference not set to an instance of an object. The idea is to pass the templated object to a property like a command parameter. Here is an example MainPage.xaml : <Page x:Class="XBindTest5.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:XBindTest5" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc

How to animate a Popup when it hides?

无人久伴 提交于 2019-11-30 14:35:23
i created a Popup Style for using in my windows 8.1 application. And i applied PopupThemeTransition to it's ChildTransitions Property. <Style x:Key="AnimatedPopupStyle" TargetType="Popup"> <Setter Property="IsLightDismissEnabled" Value="False"/> <Setter Property="ChildTransitions"> <Setter.Value> <TransitionCollection> <PopupThemeTransition/> </TransitionCollection> </Setter.Value> </Setter> </Style> My problem is that it animates when it Opens & not animating when closing. What to do with that for animating the content on hiding ? Do i want to create a Custom Popup control? NB: I know that

In WinRT C# how do I save an offscreen XAML tree using RenderTargetBitmap?

て烟熏妆下的殇ゞ 提交于 2019-11-30 14:20:12
The following code throws a cryptic System.ArgumentException from the RenderAsync method "Value does not fall within the expected range." If on the other hand my Canvas is part of a visible XAML tree it works. Is it impossible to render some XAML that isn't displayed on screen? Canvas c = new Canvas(); c.Width = 40; c.Height = 40; c.Background = new SolidColorBrush(Color.FromArgb(0xff, 0x80, 0xff, 0x80)); RenderTargetBitmap x = new RenderTargetBitmap(); await x.RenderAsync(c); I almost thought this answer would work, but no luck, I guess it only applies to WPF: Create WPF element offscreen and

Any WinRT iCommand/CommandBinding implementaiton samples out there?

戏子无情 提交于 2019-11-30 11:49:33
问题 Abstracting commands into the View Model is a valuable practice with XAML/MVVM projects. I get that. And, I see ICommand in in WinRT; but, how do we implement it? I haven't found a sample that actually works. Anyone know? 回答1: My all time favorite has to be the DelegateCommand provided by the Microsoft Patterns and Practices team. It allows you to create a typed command: MyCommand = new DelegateCommand<MyEntity>(OnExecute); ... private void OnExecute(MyEntity entity) {...} It also provides a

How to TILE a background image in WinRT?

假如想象 提交于 2019-11-30 11:43:00
With the absence of VisualBrush in WinRT, I am not sure the approach. Anyone? At the moment I don't believe there is a way, while ImageBrush inherits from TileBrush it's missing the important property TileMode. It's unclear whether this will be included in later versions. dchamberland Indeed there hasn't been much information given in regards to XAML styling WinRT besides changing Dark and Light themes... so I guess we have to fiddle and experiment... While doing some googling on the web I came with the following link... might as well give it a shot... Creating tiled backgrounds in Metro style

Auto-complete box under a text box in Windows 8 / Metro UI

ⅰ亾dé卋堺 提交于 2019-11-30 10:36:20
I want to implement auto-complete on a textbox in a Windows 8 UI / Metro UI app using C#/XAML. At the moment, when the soft / touch keyboard shows, it obscures the auto-complete box. However, on the text box focus, Windows 8 automatically scrolls the entire view up and ensures the text box is in focus. In reality, all I want is the view to scroll up a little more (in fact, by the height of the auto-complete box). I realise I can intercept the Showing event of InputPane.GetForCurrentView() I can set InputPaneVisibilityEventArgs.EnsuredFocusedElementInView to true inside the Showing event fine

Windows 8 GridView - disabling item tap visualization

依然范特西╮ 提交于 2019-11-30 09:28:46
Is it possible to remove the tap effect on an item inside a gridview? Yes, you need to modify the GridViewItem style in the ItemContainerStyle property. <GridView> <GridView.ItemContainerStyle> <Style TargetType="GridViewItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="GridViewItem"> <Border x:Name="OuterContainer"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="PointerOver"> <Storyboard> <DoubleAnimation Storyboard.TargetName="PointerOverBorder" Storyboard.TargetProperty=

BitmapImage to byte[] Windows 8 metro (WinRT)

假如想象 提交于 2019-11-30 09:10:07
问题 I want to convert BitmapImage to byte[] in windows 8 application. I know how to do it using windows sdk but can't seem to get it working for WinRT sdk. One or two posts are suggesting that I should use WritableBitmap to achieve that but there are no clear examples. Conversion of BitmapImage to Byte array (Windows) following is the best I found but still too vague for me WinRT Loading an Image into a Byte array I'll appreciate any help. 回答1: You should look at the WriteableBitmapEx project

ListView swipe/slide animation

て烟熏妆下的殇ゞ 提交于 2019-11-30 09:07:08
问题 I have a ListView control to display items and I want provide a swipe/slide gesture to select an item. I use the GestureRecognizer class to recognize the cross slide gesture but I also want to animate this gesture by moving the seelcted item horizontally. For example, this should look like on this image from an iOS app: I searched the web but I cannot find any useful link how to animate this gesture within a ListView control. 回答1: You could create a behavior that listens to the