listbox

How can I get multibinding to work in XAML ListBox?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 19:07:07
问题 The following shows me 3x "MultiTest.Model.Customers" in the ListBox (one for each record it should display). What do I need to change in order for it to output the contents of the fields instead? <Window.Resources> <Style TargetType="{x:Type ListBoxItem}"> <Setter Property="ContentTemplate" > <Setter.Value> <MultiBinding StringFormat="{}{1}, {0} "> <Binding Path="FirstName" /> <Binding Path="LastName"/> </MultiBinding> </Setter.Value> </Setter> </Style> </Window.Resources> <Grid> <ListBox x

send selected item as parameter to method in view-model [WPF,Caliburn]

不问归期 提交于 2019-12-12 18:22:41
问题 I have this problem. I use caliburn micro in WPF. In view I have listbox, and I bind on event MouseDoubleClick method in view-model. I would like send as parameter selected listbox item. But I don’t know how do it. in view I have this: <ListBox Name="Friends" SelectedItem="Key" Style="{DynamicResource friendsListStyle}" Grid.Row="2" Margin="4,4,4,4" Micro:Message.Attach="[MouseDoubleClick]=[Action SendRp(Key)]" PreviewMouseRightButtonUp="ListBox_PreviewMouseRightButtonUp"

Find and replace using Listbox Vb.net

℡╲_俬逩灬. 提交于 2019-12-12 18:11:53
问题 ok have a list of 84000 words , and have some articles in these articles i want to replace first occurrence of each word i have in listbox e.g For Each item In ListBox1.Items Dim mytext As String = "My some text this text is very long text and i want to replace this" If ListBox1.Items.Contains(mytext) Then mytext = Replace(mytext, mytext, "String to replace",Count:=1) End If Next but it used to replace the whole mytext i want to replace words in mytext and also it hang the system and very

c# winforms binding the properties of a ListBox SelectedItem

爷,独闯天下 提交于 2019-12-12 18:04:40
问题 So I have a listbox and a class. This class is called 'Mission' and has three properties: Name, IsStarted and IsCompleted. I have used a BindingList and set the datasource of the Listbox to that BindingList. This works fine, no problems so far. What I don't know how to do (and I hope it's possible) is to bind the properties IsStarted and IsCompleted to two CheckBoxes, so that if I change which Mission is selected, those CheckBoxes will change to reflect the properties of the SelectedItem. I

How to refresh ListBox.ItemsSource in a SilverLight 3 project?

霸气de小男生 提交于 2019-12-12 16:09:15
问题 I my XAML, I have a ListBox defined <ListBox x:Name="lstStatus" Height="500" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Top" Margin="2, 2, 2, 2"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Image /> <TextBlock Width="70" Text="{Binding FriendlyID}" /> <TextBlock Width="150" Text="{Binding StatusName}" /> <TextBlock Width="70" Text="{Binding ANI}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> <ListBox.Effect>

ListBox: Item selected is not highlighted

淺唱寂寞╮ 提交于 2019-12-12 15:59:22
问题 In my WPF application, I have a simple listbox: <ListBox x:Name="lbUtilities"> <ListBoxItem Tag="2" Content="One" IsSelected="True" /> <ListBoxItem Tag="5" Content="Two" /> </ListBox> The problem is that when the ListBox appears first time, the selected item ("One") is not highlighted. If I click on any item, it gets highlighted. How could I have the selected by default item to be highlighted to the system color? Thanks. 回答1: It is selected but you need a hightlight for not focused <ListBox

Add Items to ListBox when scroll reaches the end in Windows phone?

拥有回忆 提交于 2019-12-12 15:29:49
问题 I need the requirement that.. Initially i have set of datas that are bound to ListBox... If we scroll to the end i will add some more datas to the collection and will update the ListBox... Is there any way to achieve this in Windows phone ? 回答1: I suppose that by "achieve this" you mean the possibility to detect if the ListBox is at the end. In that case, this should help. You'll first need to gain access to the ScrollViewer control in order to see if a user scrolled, and what the current

ListBox.SelectedIndexChanged - can you determine if it was user initiated?

匆匆过客 提交于 2019-12-12 14:45:57
问题 My question is similar to this: How to prevent ListBox.SelectedIndexChanged event?, but I want to ask it a different way. Is there a simple way to determine if the 'SelectedIndexChanged' is coming from the user as opposed to initiated through code (e.g. ListBox.SelectedIndex = x)? 回答1: As far as I know, no, there's no simple way built-in. The best I've been able to do is set a flag just before changing it in code and then letting the event handler reset the flag and return. I suppose you

Improve draw speeds for WPF Listbox

帅比萌擦擦* 提交于 2019-12-12 14:28:49
问题 I have created a Listbox in WPF, where I plot 2D points randomly when the user clicks Generate. In my case I'm going to be plotting several thousand points when the user clicks Generate. I noticed when I generate around 10,000 or even 5,000 points, it takes forever. Does anyone have advice on ways to speed this up? Is it possible to only trigger the update to take place once all points have been generated, assuming that due to the ObservableCollection it's attempting to update the listbox

Wpf disable repeatbuttons when scrolled to top/bottom

混江龙づ霸主 提交于 2019-12-12 14:22:34
问题 I'm making a touchscreen interface that uses a listbox. I have a button above and below the listbox for page up/down. I'm trying to get it to where when scrolled all the way up the pageup button gets disabled. and when scrolled all the way down the pagedown button gets disabled too. Here's the code in my Styles.xaml for the Listbox <Style x:Key="{x:Type ListBox}" TargetType="{x:Type ListBox}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate x:Key="{x:Type ListBox}" TargetType="{x