uwp

Styling for ListBox, ListView and GridView Items

こ雲淡風輕ζ 提交于 2019-12-25 12:45:17
问题 The default colors for these controls seems to be similar to the Windows theme colors. How do you change the hover, selected, selected hover and pressed colors (code or XAML)? The following isn't working for the ListView: <ListView> <ListViewItemPresenter PointerOverBackground="#99CEEA" SelectedPressedBackground="#72BFE9" SelectedBackground="#72BFE9" SelectedPointerOverBackground="#99CEEA" /> 回答1: In your VS/Blend Designer, right click on your ListView and select Edit Additional Templates >

UWP TextBox control giving unexpected results

不羁的心 提交于 2019-12-25 11:51:54
问题 Simple Text Editor With TextBox AcceptsReturn property checked saving multiline contents of a text box to a text file results all text written in single line only when opened in notepad. It opens fine when file is loaded in UWP TextBox control. I don't have this problem with old WPF TextBox control. My program has two buttons, open and save. In between there is text box. using System; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Popups; using Windows.Storage.Pickers

DependencyProperty to change value in the ViewModelClass (UWP)

谁说我不能喝 提交于 2019-12-25 10:19:23
问题 I have a UserControl which draws some lines where the coordinates (X1,X2,Y1,Y2) are bound to properties in the ViewModelClass, the ViewModelClass itself which handles the maths to draw the lines and the CodeBehind for the UserControl where you can set the value of a property which is needed in the ViewModelClass to draw the lines. The following code explains my Control and how it works: UserControl.xaml <Line x:Name="StartAngleLine" X1="{Binding Path=StartAngleX1}" X2="{Binding Path

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

UWP TCP receive data continuously

南楼画角 提交于 2019-12-25 09:27:23
问题 I've programmed a TCP server application where I can listen to incoming connections on a dedicated port. With this I'm able to get an "connected" event and then receive data (only once). How can I receive data continuously from the port (and maybe also detect if the client is still connected)? I've connected a NodeMCU (Arduino based) system which sends some temperature data every second using the TCP connection. Starting and stopping the server through a toggle switch in the UI: public async

UWP application not reading line feed

杀马特。学长 韩版系。学妹 提交于 2019-12-25 09:20:11
问题 I am creating a C# UWP application and I have noticed that the line feed (\n) character is missing from the output text when I enter it into a Textbox. When I press enter into my Textbox it produces CR+LF character (\r\n). what can I do to bring the textbox behavior to notice both CR+LF & LF. I have set AcceptReturn = "true" and I have even tried replacing \n with \r\n but that doesn't work either. 回答1: As @lindexi said the new TextBox used \r as line feed character in Windows 10 build 15063.

Windows 10 Mobile: how can I see inside on my app folder?

我们两清 提交于 2019-12-25 09:19:43
问题 I'm deploying my Windows 10 Mobile application on my device. I want to inspect the folder to be sure the application created folders and files. How can I do that? I tried with the webapp in the phone but I access only on the Documents folder. I asked this here because in my Windows Phone with latest update (I active Windows Insider Programme then I think I have for sure the latest version of the OS) I can't explore app folders as you see on the following picture. If I click on the link User

How SQLite.Net-PCL handle UTC time

て烟熏妆下的殇ゞ 提交于 2019-12-25 09:15:48
问题 I am using below code: using new SQLite.Net.SQLiteConnection(new SQLitePlatformWinRT(), DBPath) to get SQLiteConnection and create table. Class contain DateTime DataType class Transaction { [SQLite.Net.Attributes.PrimaryKey, SQLite.Net.Attributes.AutoIncrement] public int QId { get; set; } public DateTime PurchaseDate { get; set; } public int Amount {get;set;} Public string ItemCode {get;set;} } Insert Data As follows: var db = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT

Get Items in ListView Windows Phone

亡梦爱人 提交于 2019-12-25 09:15:34
问题 I wanted to get items selected in my listview. Every time I select item in my list view it always gets the last item. Here's my code: XAML Code Behind Appreciate your help, thank you. Updated: Person Class private string name; private string imagePath; private string contact; private string gender; public Person() { } public String Name { get { return name; } set { name = value; } } public String Gender { get { return gender; } set { gender = value; } } public String ImagePath { get { return