listbox

Listboxitem stop showing highlited on select in Windows phone 8

允我心安 提交于 2019-12-12 01:44:25
问题 I am using listbox to show my data in windows phone 8. I have added some logic for enable/disable click of listboxitem. Its working correct now but how I don't know on tap color change for listbox is now stop working can anyone please help me to get out from this. here is my code <ListBox Name="lstCourses" ItemsSource="{StaticResource ListOfCourse}" toolkit:TiltEffect.IsTiltEnabled="True" SelectionChanged="lstCourses_SelectionChanged"> <ListBox.ItemContainerStyle> <Style TargetType=

How Can I Create a Bound List of RadioButtions with ToolTips in Xaml?

痴心易碎 提交于 2019-12-12 01:35:39
问题 I want to create a list of logically related RadioButtons. The RadioButtons are bound for MVVM use. There's ToolTips on each RadioButtons. 回答1: Here is a Style that creates a group of logically related RadioButtons by using a ListBox. MyClass contains two String properties: MyName and MyToolTip. The style will display the list of RadioButtons including properly functioning individual ToolTips. This is an all bound, all Xaml solution for MVVM use. Example usage: ListBox Style="{StaticResource

Why does “size” property doesn't shows up multiple options like a list box on a mobile device?

╄→гoц情女王★ 提交于 2019-12-12 01:32:45
问题 I am building a Mobile application using Phone-gap.I am stuck at one place. If i set size="5" it shows up list box with 5 elements in safari and Firefox browser(I tested on those two) but it shows up like a dropdown only when testing on device(iPhone and Android). Any idea how to fix the issue? <div> <select name="mySelect" id="mySelect" size="5"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <

How to drag Multi items between 2 listbox in C#?

為{幸葍}努か 提交于 2019-12-12 01:27:47
问题 I can drag one item from listbox1 and drop it to listbox2 but how can i do it when i select multi items from listbox1? private void FrmCh3_Load(object sender, EventArgs e) { listBox2.AllowDrop = true; } private void listBox1_MouseDown(object sender, MouseEventArgs e) { listBox1.DoDragDrop(listBox1.SelectedItem, DragDropEffects.Copy); } private void listBox2_DragEnter(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Copy; } private void listBox2_DragDrop(object sender,

Sync 2 list boxes to 1 scrollbar

谁都会走 提交于 2019-12-12 01:22:36
问题 I have 2 listboxes next to each other. One holds the order the other holds the total cost of the order. For obvious reasons i need both listboxes to scroll simultaneously. Here is what i have tried Private Sub lstOrders_Scroll() lstTotalsEachOrder.TopIndex = lstOrders.TopIndex End Sub Private Sub lstTotalsEachOrder_Scroll() lstOrders.TopIndex = lstTotalsEachOrder.TopIndex End Sub Any help would be appreciated. I am using Visual Studio 2012 and I'm coding in vb. From what I read _Scroll has

Get Password from PasswordBox in ListBox of ListBoxItems defined in XAML

让人想犯罪 __ 提交于 2019-12-12 00:27:19
问题 I have a WPF ListBox , each ListBoxItem has many UIElements . One of those UIElements is PasswordBox . These UIElements are defined in Xaml ControlTemplate . What I need to do is get a Password string from PasswordBox in code behind. But I can not bind Password Property of PasswordBox , which is not a dynamic property and it make sense as Password should not be stored in a memory for long. Now the Solution that comes to my mind is to get UIElements of ListBoxItem in code behind and get

Button Command in WPF MVVM Model

旧街凉风 提交于 2019-12-11 21:22:33
问题 I have two UserControls in my MainWindow and UserControl2 has 2 Listboxes,Texboxes and Buttons.When i write some text in TextBox and press Button it should add into the ListBox.Can somebody help me with the code,i'm new to WPF and MVVM This is my XAML code <Window x:Class="Wpf_MVVM.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Wpf_MVVM" Title="Voxer" Background="SlateGray" Height=

ScrollIntoView doesn't work with Touch

狂风中的少年 提交于 2019-12-11 20:31:28
问题 So I have a map with a number of PushPins on it and a list down the right hand side listing all the PushPins (using the same view models) When I click a pin on the map I want to scroll the item into view on the list. I currently use this code on Click and OnTouch: private void ScrollPushPin(Pushpin pushpin) { ScrollViewer scrollViewer = GetScrollViewer(MyList) as ScrollViewer; scrollViewer.ScrollToBottom(); var index = this.MyList.Items.IndexOf(pushpin); //index is never -1 so I would expect

C#: How to bind to ListBox DisplayMember and ValueMember result from class method?

风流意气都作罢 提交于 2019-12-11 20:14:23
问题 I'm trying to create ListBox where I will have key-value pair. Those data I got from class which provides them from getters. Class: public class myClass { private int key; private string value; public myClass() { } public int GetKey() { return this.key; } public int GetValue() { return this.value; } } Program: private List<myClass> myList; public void Something() { myList = new myList<myClass>(); // code for fill myList this.myListBox.DataSource = myList; this.myListBox.DisplayMember = ??; //

How to time ListBox load time WPF

◇◆丶佛笑我妖孽 提交于 2019-12-11 20:09:23
问题 I'm playing around with DataVirtualization and Async. What are some options I have for quantifying load times of a ListBox that I'm binding my virtualized data collections to? I need a way to compare the virtualized vs non-virtualized data loading. Have been unsuccessful in locating any resources for this topic. Should I just put a stopwatch on the ListBox_Loaded event in the code behind? Thanks in advance! 回答1: You can use a System.Diagnostics.Stopwatch for this. Make sure that you start it