uwp

How to find a control with a specific name in an XAML UI with C# code?

喜夏-厌秋 提交于 2020-01-01 11:47:48
问题 I have dynamic added controls in my XAML UI. How I can find a specific control with a name. 回答1: There is a way to do that. You can use the VisualTreeHelper to walk through all the objects on the screen. A convenient method I use (obtained it somewhere from the web) is the FindControl method: public static T FindControl<T>(UIElement parent, Type targetType, string ControlName) where T : FrameworkElement { if (parent == null) return null; if (parent.GetType() == targetType && ((T)parent).Name

How to find a control with a specific name in an XAML UI with C# code?

偶尔善良 提交于 2020-01-01 11:47:26
问题 I have dynamic added controls in my XAML UI. How I can find a specific control with a name. 回答1: There is a way to do that. You can use the VisualTreeHelper to walk through all the objects on the screen. A convenient method I use (obtained it somewhere from the web) is the FindControl method: public static T FindControl<T>(UIElement parent, Type targetType, string ControlName) where T : FrameworkElement { if (parent == null) return null; if (parent.GetType() == targetType && ((T)parent).Name

UWP Composition - Apply opacity mask to top 30px of a ListView

爷,独闯天下 提交于 2020-01-01 09:26:07
问题 How can I apply an effect to a ListView where the top 30px graduate from fully transparent to fully opaque? The idea is that as you scroll down, the top items gradually fade away. I am building a UWP application where the design calls for the top 30px of a ListView to start at opacity 0 and transition to opacity 1. Conceptually I am imagining an Opacity Mask that would be applied to the top part of a SpriteVisual but I cannot work out how to achieve this. I am attempting this using the the

Set ItemsSource of Control to another control's ItemsSource that is Static and set in Xaml

你。 提交于 2020-01-01 06:15:48
问题 I am building a UWP Windows 10 App. In a Page I have a FlipView that has static items. Instead of binding them to an ItemsSource, it was easier to set them in Xaml as: <FlipView x:Name="myFlipView"> <FlipViewItem>...</FlipViewItem> <FlipViewItem>...</FlipViewItem> </FlipView> I want to add an Indicators Control to this FlipView as in this tutorial: http://blog.jerrynixon.com/2014/04/lets-code-build-your-own-flipview-page.html When I want to set the ItemsSource of my <ItemsControl x:Name=

Set ItemsSource of Control to another control's ItemsSource that is Static and set in Xaml

喜你入骨 提交于 2020-01-01 06:15:40
问题 I am building a UWP Windows 10 App. In a Page I have a FlipView that has static items. Instead of binding them to an ItemsSource, it was easier to set them in Xaml as: <FlipView x:Name="myFlipView"> <FlipViewItem>...</FlipViewItem> <FlipViewItem>...</FlipViewItem> </FlipView> I want to add an Indicators Control to this FlipView as in this tutorial: http://blog.jerrynixon.com/2014/04/lets-code-build-your-own-flipview-page.html When I want to set the ItemsSource of my <ItemsControl x:Name=

Visual State Manager in Windows 10 UWP not applying initial state on page load

不问归期 提交于 2020-01-01 05:27:11
问题 I have a page with a relative panel to re-organize based on width. However, it doesn't seem to apply any state at load unless the width is > 720px. If I resize the page after it's loaded both states work. A workaround would be to check the window size on page loaded and manually choose the state, but I believe this should be handled automatically? I have other pages that work, I'm not sure what I'm doing different. Here is a simplified version of my code, I have it set red/blue backgrounds so

UWP Background Task HttpClient fails when device screen is off

十年热恋 提交于 2020-01-01 05:19:05
问题 I'm working on a UWP app designed for phones. It's designed to sync data with a server running on your local home network. This syncing might take quite some time so a background task isn't the best place to sync the data; it'll probably take more than the 30 seconds I'm allotted. The idea, however, is to use a background task with a timer trigger; it'll call the server to check if there are any updates to consume and then pop up a toast notification asking if it can run in the foreground to

make .exe file out of Visual Studio uwp .appx file

时光总嘲笑我的痴心妄想 提交于 2020-01-01 03:29:10
问题 I have an uwp-app, designed with Visual Studio 2015 for windows 10 (multi-touch, etc.), but it must NOT be released via Windows Store (and yes, that includes also the kind'a "private / hidden" version via Windows store) and an installation via Powershell is a little complicated for an average customer, so I would prefer some good old .exe file. Is there any possibility to export / release the programm instead of .appx as .exe? Thx for any support :) 回答1: Short answer is you can't . As

How to handle ItemClick For Nested ListView In MVVM Pattern?

倖福魔咒の 提交于 2019-12-31 07:18:11
问题 Xaml code: <Page x:Class="DemoTestApp.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:DemoTestApp" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" xmlns:vm="using:ViewModels" > <Page.DataContext> <vm:TestViewModel/> </Page

Desktop App Converter -PackageName E_MANIFEST_USE_DEFAULT_VALUE_FAILED

混江龙づ霸主 提交于 2019-12-31 06:51:15
问题 I am trying to convert my app to an appx using Desktop App Converter. I am trying to use my Package/Identity/Name from the Microsoft store dashboard in the form of -PackageName "1234Myapp.Andthistoo". Desktop App Converter will not take it.It keeps coming back with a write error. From my searches I have been under the impression that the -PackageName category can not start with a number and it can not contain a period which my Package/Identity/Name contains both. It fails with this message: