winrt-xaml

Binding a UserControl DP from DataTemplate UWP

本秂侑毒 提交于 2019-12-07 08:34:14
问题 I've got a FlipView that shows Figurines . Figurines contain a Path to their image. Binding this property to a regular DataTemplate is ok. (the code below works fine) </DataTemplate> <Canvas x:Name="DefaultImageCanvas" Width="660" Height="372"> <Image Name="imageFlip" Width="660" Height="372" Source="{Binding Path}" Stretch="Uniform" /> </Canvas> </DataTemplate> But when using my UserControl instead, it doesnt work anymore: <DataTemplate> <local:FigurineStickerUserControl Width="660" Height=

Where Is DrawingBrush In Windows Metro for XAML

坚强是说给别人听的谎言 提交于 2019-12-07 07:43:25
问题 Im writing a Windows Metro XAML based app in C#, and I want to draw grid lines with a brush on my custom grid control. In WPF I would create a DrawingBrush to do the job, but there seems to be no equivalent in Metro ??? Does anyone know if this feature exists under another name, or that you achieve the same result differently ? As an additional note, I do not want to draw lines etc directly on my grid (adding lines to my panel's children collection), It really needs to be done via the

Force pivot item to preload before it's shown

我与影子孤独终老i 提交于 2019-12-07 04:20:29
问题 I have a Pivot with several PivotItems, one of which contains a canvas that places its items in dynamic locations (depending on the data). I get the data, and I can place the items in their place before the user can choose this item (this isn't the first pivot). However, only when I select the PivotItem, the canvas renders itself, so you can see it flicker before it's shown as it should. Is there a way to force the canvas to render before it's shown, so everything's prepared by the time the

windows phone 8.1 swype keyboard event capture

不打扰是莪最后的温柔 提交于 2019-12-07 02:50:44
问题 Update [16-Jul-2014]: The question is technically incorrect. Read the answer to get more details. I was trying to capture text before reaching to my text box. and I discovered the following facts: KeyDown , KeyUp event will tell you what virtualKey was pressed not the character !! CoreWindow.CharacterReceived will capture the character but this event is not specific to TextBox and it will tell you the character after it reached to the textBox. Now my question is: Can any one tell me how can I

Locked screen in windows 8 WinRT

你说的曾经没有我的故事 提交于 2019-12-07 02:21:48
问题 When my app is running in Windows 8 WINRT can I prevent the OS to go to locked screen/sleep mode? 回答1: You can use the DisplayRequest class to indicate that you are busy playing back something that requires the display to stay active and un-dimmed. A good how-to article with sample code is available here. Don't use it frivolously, it is quite detrimental to power consumption. Good odds that the Store will reject your app if you use it for no obvious benefit to the user. 回答2: You cannot

Why exposed types must be sealed for WinMD/WinRT components?

≡放荡痞女 提交于 2019-12-07 00:23:06
问题 VS compiler does not allow to create sealed exposed types for WINMD type library. Why is this restriction placed ? (I know about sealed types advantages, my question is with respect to Win RT components). 回答1: This is an architectural limitation, imposed by COM. Which sits at the core of any WinRT type, they are derived from IUnknown and IInspectable. The problem with COM is that it only supports interface inheritance but not implementation inheritance. Which was a strong COM design goal,

Clipping a low resolution image using Transforms and assigning it to my user control

痞子三分冷 提交于 2019-12-06 23:23:42
问题 I have been working on a Windows 8.1 RT app where the user loads an image with Stretch=Uniform . The image can be as small as possible and as big as possible. The clipping happens in my user control and my user control appears when I tap/press and hold on the screen/image. Clipping happens when when I tap and hold and move my finger/mouse around the image that is in the background. The Problems I am facing are Whenever the app is loaded for the first time on Emulator , and for the very first

Disable left/right/up/down hotkeys in flipview

耗尽温柔 提交于 2019-12-06 20:25:21
How to disable right/left/up/down arrows hotkeys in flipview? I have a textbox on a flipview and when I move cursor using keyboard arrows and reach the end of textbox, it doesn't stop but flips the page which is annoying and is not applicable for my case. The same is true for cursor reaching the beginning of the textbox. I've tried different solutions, but none of them work. <FlipView x:Name="flipView" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsTabStop="False"> <FlipView.Items> <StackPanel> <TextBox Text="AAAAA1"></TextBox> <TextBox Text="AAAAA2"></TextBox> </StackPanel>

Open links in external browser in WebView (WinRT)

孤街醉人 提交于 2019-12-06 19:50:17
问题 I have a WebView component that I use to display HTML Ads in my app. When user clicks an Ad in the WebView I want to open the Ad link in an external browser. How do I do that? I need something like OnNavigating from the WP7 browser. I tried the Tapped event of the WebView but it never gets called even when I set IsTapEnabled=true. I need something like 回答1: You will need to use the ScriptNotify event for this. Here's how I handled the scenario (using NavigateToString). If you're retrieving

SemanticZoom ZoomedOutView SelectedItems Returns DependencyObject

两盒软妹~` 提交于 2019-12-06 16:03:06
In the SemanticZoom control I use the same CollectionViewSource for both the zoomed in and zoomed out view. To do this I bind the zoomed out GridView in the code behind like this: (FavoriteGroupsSemanticZoom.ZoomedOutView as ListViewBase).ItemsSource = this.FavoriteGroupsViewSource.View.CollectionGroups; Everything works as expected. However, now the zoomed out GridView is bound to a list of DependencyObjects instead of my original groups. And thus when I access the SelectedItems I get a WinRT object that contains a list of DependencyObjects instead of my groups. How can I access the selected