uwp-xaml

set focus to a textBox in uwp [duplicate]

[亡魂溺海] 提交于 2020-01-13 16:39:08
问题 This question already has answers here : Uwp navigation example and focusing on control (2 answers) Closed 2 years ago . I have a Universal Windows Platform project that has a textBox element. I'd like to set the focus to it when a Radio Button is clicked. In the Radio Button click event, I can say: txtBoxID.IsEnabled = true; txtBoxID.Text = ""; But how do I set the focus? I saw some answers saying to use: FocusManager.SetFocusedElement( but my FocusManager class doesn't have that method.

Changing the Overlay background color for ContentDialog

爱⌒轻易说出口 提交于 2020-01-07 02:56:47
问题 For my UWP app, I want to override the default theme of the background color of the screen around the content dialog when it opens. I tried doing what's mentioned in this answer but it didn't work for me: https://stackoverflow.com/a/32159659/2858235 My OS build # is 10586. I read somewhere that this solution is no more working for builds equal and above 10586. Is there any solution? 回答1: For me, my SDK version is 14393 (Anniversary) and the SolidColorBrush resource to override is

How to disable auto-scaling on UWP mobile

别来无恙 提交于 2020-01-07 02:48:09
问题 I´m doing a Windows Universal app that will run only on Lumia 640XL devices. That device has a native resolution of 1280 x 720 and a pixel density of 259 ppi. There will be no desktop version so I just care about the mobile layout. The design guide lines for my app are huge and full of pixel measures (sizes, margins, paddings, font sizes) everywhere, so what I´d like is to make the mobile app respect the physical pixels (rather than "effective pixels"), as the desktop version does. How can I

How to not focus element on application startup?

感情迁移 提交于 2020-01-05 05:41:07
问题 Simplest application possible: <Page x:Class="TestApp.MainPage" ...> <Grid> <TextBox /> </Grid> </Page> Question: is there any elegant way to prevent the cursor (focus) from being set in the TextBox on application start up? To expand: My real issue is that I have a PopUp that is opened when the TextBox receives focus. If I click on an element in my PopUp it should close, but since the TextBox is the first focusable element in my page it automatically receives focus and thus the PopUp

AdControl not showing ads, even after uploading the app to the store

眉间皱痕 提交于 2020-01-05 05:29:07
问题 I Uploaded app an UWP app to the windows 10 store whil using AdControl to show ads in my app. My Add Control doesn't show me ads, it just stay blank and throwing the next error: "No ad available. No additional information"" In the dashbored - monetize I created ad unit name and got ad unit ID app ID and ad unit name as shown in here: in the xaml file: <UI:AdControl ApplicationId="78eefbba-92ef-466f-bec3-81e17f9c36d4" AdUnitId="332861" Name="adControl" Height="60" Width="480" Grid.Row="5"

XAML ScrollViewer's child bring into view event

隐身守侯 提交于 2020-01-05 04:57:24
问题 I have a ScrollViewer , at the top area, there is a video player, and a ListView below the media player. While scrolling up and down, when the media player bring into view, it starts to play. When scroll down till the media player disappears, the media player pauses. So, how to do it? Thx. 回答1: We can use ScrollViewer.ViewChanged event to know the user scrolling and zooming the ScrollViewer. But the ScrollViewer.ViewChanged do not raise when the layout changing. So we can use LayoutUpdated

ContentDialog max width

孤街浪徒 提交于 2020-01-05 04:04:10
问题 I'm trying to create a settings menu in my app like this I know how to do it but I have a problem with the width on content dialog, apparently there is a limit on width. Here's code for my content dialog: Title="" Margin="12,0,-12,0" HorizontalAlignment="Stretch" Width="800" Height="600" VerticalAlignment="Stretch" Background="{x:Null}"> <Grid x:Name="Main" ScrollViewer.VerticalScrollBarVisibility="Auto" Width="800"> <Grid.RowDefinitions> <RowDefinition Height="58"/> <RowDefinition Height="58

UWP Application Crash in Windows.UI.Xaml.dll

心已入冬 提交于 2020-01-04 09:08:52
问题 I'm porting a WP app to UWP having one page showing mainly multiple images (showing a map) within the Canvas of an ItemsControl. I'm using the manipulation and pointer wheel events on the canvas and data binding with data templates/template selector - and everything works fine. Unless sooner or later the app crashes in Windows.UI.Xaml.dll while I'm moving or scaling using Manipulation events: The crash always happens in CInteractionManager::ProcessManipulationInertiaInteraction (). The

DropShadowPanel and border corner radius

淺唱寂寞╮ 提交于 2020-01-04 09:05:33
问题 I want to make drop shadow effect with border control. I am using UWP toolkit. <controls:DropShadowPanel x:Name="dspShadow" BlurRadius="10" ShadowOpacity="0.8" OffsetX="0" OffsetY="0" Color="Black"> <Border x:Name="borderMain" Background="Red" CornerRadius="10"/> </controls:DropShadowPanel> But it doesn't recognize corner radius, the result is like this: And I need it to look like this: Any ideas how to achieve this? 回答1: You need to mask it. Currently you can only get the mask from TextBlock

Copy to clip board from WebView

懵懂的女人 提交于 2020-01-04 06:30:30
问题 In an UWP App with a WebView control the user can: Select some text from the loaded html Right-click Choose "Copy" However, choosing "Copy" does not copy the text? What is missing? Some code to handle the "copy event", or...? 回答1: This is a known issue we have logged, I'm not sure the specific build version, but the fix should be available in future release. 来源: https://stackoverflow.com/questions/36479593/copy-to-clip-board-from-webview