Click here to Skip to main content
15,895,667 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: User Control Question Pin
Kevin Marois2-Apr-14 18:49
professionalKevin Marois2-Apr-14 18:49 
GeneralRe: User Control Question Pin
_Maxxx_2-Apr-14 19:36
professional_Maxxx_2-Apr-14 19:36 
GeneralRe: User Control Question Pin
Kevin Marois3-Apr-14 5:47
professionalKevin Marois3-Apr-14 5:47 
GeneralRe: User Control Question Pin
BubingaMan23-Apr-14 4:13
BubingaMan23-Apr-14 4:13 
QuestionPrefixing ListBoxItem index in DataTemplate Pin
Dominick Marciano22-Mar-14 21:33
professionalDominick Marciano22-Mar-14 21:33 
AnswerRe: Prefixing ListBoxItem index in DataTemplate Pin
SledgeHammer0123-Mar-14 9:22
SledgeHammer0123-Mar-14 9:22 
GeneralRe: Prefixing ListBoxItem index in DataTemplate Pin
Dominick Marciano25-Mar-14 4:42
professionalDominick Marciano25-Mar-14 4:42 
GeneralRe: Prefixing ListBoxItem index in DataTemplate Pin
SledgeHammer0125-Mar-14 4:55
SledgeHammer0125-Mar-14 4:55 
Well ListViewItem / Potato. I meant that you are inserting stuff into the Items (type ItemCollection) rather then a bound collection. Which it sounds like you are.

ItemCollection doesn't have an IndexOf method while pretty much every other list collection does.
Doesn't have to be an ObservableCollection, but since you have an add / delete / move-up / move-down. I don't know why you wouldn't use ObservableCollection. It does half the work for you.

If you are writing WPF code, it would SERIOUSLY behoove you to get into the habit of NOT operating on the controls themselves and operating on bound objects. That's what WPF was intended for and you can take advantage of a lot of features that you can't take advantage of when operating on the controls themselves.

EDIT: Almost forgot to answer your question lol...

Yes. Your label would use StringFormat on a multi-binding expression (expression 1 would be the return from your MultiValueConverter and expression 2 would be Path=Text). The MultiValueConverter would be Path=ItemsSource and {Binding} (which is the item itself). The MultiValueConverter would return ((ObservableCollection<Whatever>)values[0]).IndexOf(values[1]) + 1;
QuestionCustom Window WPF con Vb.Net Pin
Pablo Roberto Cuellar Ribera21-Mar-14 9:59
Pablo Roberto Cuellar Ribera21-Mar-14 9:59 
AnswerRe: Custom Window WPF con Vb.Net Pin
Kenneth Haugland21-Mar-14 10:11
mvaKenneth Haugland21-Mar-14 10:11 
GeneralRe: Custom Window WPF con Vb.Net Pin
Pablo Roberto Cuellar Ribera21-Mar-14 10:40
Pablo Roberto Cuellar Ribera21-Mar-14 10:40 
QuestionRe: Custom Window WPF con Vb.Net Pin
Kenneth Haugland23-Mar-14 10:49
mvaKenneth Haugland23-Mar-14 10:49 
AnswerRe: Custom Window WPF con Vb.Net Pin
Meshack Musundi24-Mar-14 20:04
professionalMeshack Musundi24-Mar-14 20:04 
GeneralRe: Custom Window WPF con Vb.Net Pin
Pablo Roberto Cuellar Ribera28-Mar-14 5:58
Pablo Roberto Cuellar Ribera28-Mar-14 5:58 
QuestionWPF problem with ScrollViewer Pin
Federico Barbieri20-Mar-14 23:48
Federico Barbieri20-Mar-14 23:48 
AnswerRe: WPF problem with ScrollViewer Pin
Pete O'Hanlon21-Mar-14 0:08
mvePete O'Hanlon21-Mar-14 0:08 
QuestionMoving Items Between StackPanels With Animation Pin
Saeid Mirzaee19-Mar-14 4:01
Saeid Mirzaee19-Mar-14 4:01 
QuestionStyle In Resource Dictionary Not Found Pin
Kevin Marois17-Mar-14 16:49
professionalKevin Marois17-Mar-14 16:49 
AnswerRe: Style In Resource Dictionary Not Found Pin
Pete O'Hanlon18-Mar-14 5:45
mvePete O'Hanlon18-Mar-14 5:45 
GeneralRe: Style In Resource Dictionary Not Found Pin
Kevin Marois18-Mar-14 5:46
professionalKevin Marois18-Mar-14 5:46 
QuestionWPF Data Grid - Bind Checkbox To Command On VM Pin
Kevin Marois17-Mar-14 8:13
professionalKevin Marois17-Mar-14 8:13 
AnswerRe: Treeview Textbox Focus Pin
Wayne Gaylard17-Mar-14 5:56
professionalWayne Gaylard17-Mar-14 5:56 
QuestionAttached behaviour for Datagrid row double click Pin
Ashfaque Hussain11-Mar-14 20:35
Ashfaque Hussain11-Mar-14 20:35 
AnswerRe: Attached behaviour for Datagrid row double click Pin
Richard MacCutchan11-Mar-14 23:02
mveRichard MacCutchan11-Mar-14 23:02 
AnswerRe: Attached behaviour for Datagrid row double click Pin
Pete O'Hanlon11-Mar-14 23:06
mvePete O'Hanlon11-Mar-14 23:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.