uwp

Ignore horizontal mouse scrolling with nested ScrollViewer

烂漫一生 提交于 2019-12-10 23:23:23
问题 I have a ScrollViewer around a Grid to vertically scroll it's content. <ScrollViewer> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> ... </Grid> </ScrollViewer> Inside of this Grid i have another Scrollviewer with horizontal content. <Grid> <ScrollViewer Name="ScrollViewer" VerticalScrollMode="Disabled" VerticalScrollBarVisibility="Disabled" HorizontalScrollMode="Disabled" HorizontalScrollBarVisibility="Hidden"> ... </ScrollViewer> <Button Name="ButtonRight"

Adaptive Triggers in Resource Dictionary

爱⌒轻易说出口 提交于 2019-12-10 23:17:38
问题 I am trying to have a simple header of the page "adaptively" change the padding value based off of the width of the Page. Namely I have a header TextBlock using a style from a Resource Dictionary as shown below: <Style x:Key="PageHeaderStyle" TargetType="TextBlock"> <Setter Property="FontSize" Value="16" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="FontWeight" Value="Bold" /> </Style> In my page now I have a simple TextBlock that uses the Style from the Resource

UWP - InvalidCastException when accessing ProductListing.CurrencyCode

时间秒杀一切 提交于 2019-12-10 23:10:10
问题 I'm facing a really weird issue. I need to store the CurrencyCode property of a ProductListing item in an WSA_10_0 environment. Here is the code foreach (ProductListing product in listings.ProductListings.Values) { Debug.Log("CURRENCY_CODE/"+product.CurrencyCode); } When trying to execute the code I get the following error Additional information: Unable to cast object of type 'Windows.ApplicationModel.Store.ProductListing' to type 'Windows.ApplicationModel.Store.IProductListing2'. Now, this

XAML Custom Textbox Cursor Stays at Start of Entry

与世无争的帅哥 提交于 2019-12-10 23:07:44
问题 I'm working on creating custom controls for a XAML app for Windows 8.1 Universal/UWP and keep finding little nuances. I can't seem to find any great tutorials on creating custom implementations of existing controls (like the TextBox) so I've been looking through the source code of controls like Telerik to try and understand how their custom controls are working. The latest issue I'm encountering is being unable to create even the most simple custom TextBox without the cursor staying at the

SQLite not storing/retrieving database

荒凉一梦 提交于 2019-12-10 22:57:57
问题 I've got a Windows 10 UWP application written in C#. I'm using SQLite to store my data locally. The issue I'm experiencing is that the file is never saved and/or retrieved using this code. It should work, but I can't find out what's wrong. dbExists always evaluates to false, so what am I missing here? private SQLiteConnection localConn; private string dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "myDatabase.db"); public async void DBInit() { bool dbExists =

Failed to assign to property 'Windows.UI.Xaml.Controls.ContentControl.Content'

无人久伴 提交于 2019-12-10 22:38:31
问题 In my windows 10 app I want to set button content from a resource file. In the designer the vector image from the resource file is visible. But in runtime the following exception occurs: An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in Demo.UI.W10.exe but was not handled in user code WinRT information: Failed to assign to property 'Windows.UI.Xaml.Controls.ContentControl.Content'. [Line: 15 Position: 17] Additional information: The text associated with this error

How to use Acrylic Accent (CreateHostBackDropBrush()) in Windows 10 Creators Update correctly?

耗尽温柔 提交于 2019-12-10 22:33:40
问题 I want to do something that could be a little bit tricky, since it's a new feature in Win 10 Creators Update: I would like to use the new Acrylic Accent feature to make transparent Windows in UWP apps. I saw that Microsoft is already introducing it in Groove and Film & TV in Fast Insider Ring. This is the code I developed, using examples in Win Dev Center and some other answers here on Stack Overflow: public sealed partial class MainPage : Page { // Some other things private void

UWP NavigationView navigation via MVVM

十年热恋 提交于 2019-12-10 21:17:21
问题 I am using as main control in my app NavigationView and have Frame where page is loading. <NavigationView x:Name="MyNavView" IsBackButtonVisible="Collapsed" SelectionChanged="{x:Bind ViewModel.OnSelectionChanged}" PaneDisplayMode="Top"> <NavigationView.MenuItems> <NavigationViewItem Icon="Contact" Content="Contact" Tag="MasterDetailPage"/> <NavigationViewItem Icon="Favorite" Content="Favorites" Tag="FavoritesPage"/> </NavigationView.MenuItems> <Frame x:Name="RootFrame"/> </NavigationView>

How to pass string to UWP app and launch it from a Windows Forms app

北战南征 提交于 2019-12-10 20:07:56
问题 This official MSDN document describes how to share data between Universal Windows Platform (UWP) apps. But can we pass a string to an UWP app from a Windows Forms app and launch the UWP app from Windows Forms app? I did not find any document for this scenario. I'm using C# but the language does not matter in this scenario. NOTE : In our case, it's a long string that contains data that Windows Forms app wants to pass to the UWP app that uses that data. 回答1: The easiest way to do this would be

Preventing default behaviour of Return(Enter), Up and Down Arrow keys for a ListView in XAML/C# (Windows 10)

这一生的挚爱 提交于 2019-12-10 19:56:20
问题 When a listview has focus, the default behaviour of an enter key press is to pick the first element of the listview, Up and down arrow keys scrolls the listview. I am trying to prevent this default behaviour and hook up my custom logic. I am able to implement Access keys using KeyDown for a listview as follows: Code behind approach: CoreWindow.GetForCurrentThread().KeyDown += KeyDownHandler; MVVM approach: <ListView SelectedIndex="{Binding IsSelected, Mode=TwoWay}"/> Triggering the Keydown