uwp-xaml

Behaviors in UWP (Event trigger command error

蓝咒 提交于 2019-12-25 09:54:36
问题 SCENERIO: I have a custom control where the control template has a grid. I want to add a behavior to the grid tapped event. WHAT I HAVE DONE: I have installed the Nuget package for managed UWP behaviors Install-Package Microsoft.Xaml.Behaviors.Uwp.Managed In the custom control's resource dictionary, I have the following xml namespaces referenced along with other necessary namespaces xmlns:i="using:Microsoft.Xaml.Interactivity" xmlns:core="using:Microsoft.Xaml.Interactions.Core" Then in the

Behaviors in UWP (Event trigger command error

社会主义新天地 提交于 2019-12-25 09:51:06
问题 SCENERIO: I have a custom control where the control template has a grid. I want to add a behavior to the grid tapped event. WHAT I HAVE DONE: I have installed the Nuget package for managed UWP behaviors Install-Package Microsoft.Xaml.Behaviors.Uwp.Managed In the custom control's resource dictionary, I have the following xml namespaces referenced along with other necessary namespaces xmlns:i="using:Microsoft.Xaml.Interactivity" xmlns:core="using:Microsoft.Xaml.Interactions.Core" Then in the

How Can I Call GetAsyncKeyState() in UWP DirectX/XAML App?

蓝咒 提交于 2019-12-25 08:59:35
问题 I have some code I'm porting from a working WinJS/UWP app to a DirectX/XAML variant, but I can't get my hands on the keyboard state. Controller is not a problem, that works just fine via XInputGetState(). My problem is just the keyboard. Existing code is: Windows::UI::Core::CoreWindow^ win = Windows::UI::Core::CoreWindow::GetForCurrentThread(); if (win) { // misc. calls to win->GetAsyncKeyState() } XInputGetState(activeController, &inputState); But that fails because Windows::UI::Core:

How to know CalendarViewDayItem is out of CalendarView month scope?

时光毁灭记忆、已成空白 提交于 2019-12-25 00:53:29
问题 To do some styling in CalendarView day elements, I need to know if CalendarViewDayItem (date) is in current CalendarView month's scope or not. Is there any way to get the current month/year? This is what I got so far: An styled CalendarView and CalendarViewDayItem to show in the calendar some visual info despite of only day number. All the CalendarViewDayItems out of October (sept 30 and the dates of novemeber) should be shaded/lowered contrast. Date's day number is shaded (CalendarView

Static resource defined in ThemeDictionaries not fetched while edit a copy of the template for custom control

爱⌒轻易说出口 提交于 2019-12-25 00:23:00
问题 Static resource defined in ThemeDictionaries not fetched while edit a copy of the template for custom control. Is this is behavior or issue? In my scenario i want to fetch StaticResource from ThemeDictionaries. Any workaround is there to achive my requirement? Note: I have used ThemeDictionaries to change the color of my control based on Highcontrast, light and default themes sample Regards, Priyanga B 回答1: One way to solve this issue is to put the 'ThemeDictionaries' in your main project's

Pure XAML approach to evenly distributing an unknown number of children in a container

家住魔仙堡 提交于 2019-12-24 17:13:06
问题 Let's say I have a StackPanel (Orientation="Horizontal") with a fixed width and a variable/unknown amount of children, how do I tell all the children in XAML (not in code) to set their widths' to all be equal and fill up the entire StackPanel's width? It's easy enough to do with Grid when you know the number of children (just use ColumnDefinitions with Width="*"), but I'm not sure how to do it with panels (StackPanel, PivotHeaderPanel, etc) or lists (GridView, ListView, etc). 回答1: According

Retrieve the request data from URI in Webview Windows 8.1

可紊 提交于 2019-12-24 15:41:49
问题 I'm developing a Windows phone 8.1 app and there's this scenario where I should open the webview for the user to enter the card details. Once the card details are entered and processed, the payment API will send the transaction details back as a POST request to the webview. I'm not able to get the POST data, tried so many methods. How do I get the post data returned back from the server? Thanks in Advance 回答1: If you have access to webpage code then you can use WebBrowser.ScriptNotify for

Remove space that the primary and secondary buttons are holding on a ContentDialog

六眼飞鱼酱① 提交于 2019-12-24 10:48:03
问题 I am writing a ContentDialog which is a part of a UWP app, I don't need the default PrimaryButton and SecondaryButton. There will be a thick padding on the bottom of the dialog if I don't define the buttons. Please see the screen shot attached. Is there a way to remove the space? Thank you. 回答1: You can create a new Style for this dialog removing the Grid which contains the button space. Open the file file , search for ContentDialog, copy the default style in your app, give it an x:Key and

Windows UWP - How to programmatically scroll ListView in ContentTemplate

烈酒焚心 提交于 2019-12-24 06:18:21
问题 I have a list of chats on the left and messages for a given chat on the right. I want to have the MessageList to scroll to the bottom whenever it appears or gets its data updated. How can I do this? My code is based off of Microsoft's Master/Detail view example: https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/XamlMasterDetail/cs/MasterDetailPage.xaml The xaml page: <Page x:Class="MyApp.Pages.ChatsPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation

Narrator does not read the text in a TextBlock as expected. Only in the selected TextBox

痴心易碎 提交于 2019-12-24 05:16:14
问题 I have a Visual Studio 2019 solution that contains two projects: a Class Library (Universal Windows) that contains a login Page and a Blank App (Universal Windows) that simply navigates to said login Page. One of my requirements is that the overall solution must pass an accessibility test. The test involves having Narrator (it must be Narrator) read all of the text on the screen. My problem is that Narrator only reads the text of the TextBox that has focus when the Page loads. I expected