Click here to Skip to main content
15,913,685 members
Home / Discussions / WPF
   

WPF

 
Questionhow do I match my string to one of the comboBox items Pin
Ravi Munde9-Mar-11 0:10
Ravi Munde9-Mar-11 0:10 
AnswerRe: how do I match my string to one of the comboBox items Pin
Pete O'Hanlon9-Mar-11 1:37
mvePete O'Hanlon9-Mar-11 1:37 
AnswerRe: how do I match my string to one of the comboBox items Pin
Abhinav S9-Mar-11 18:26
Abhinav S9-Mar-11 18:26 
QuestionCan you bind by property name? Pin
SledgeHammer018-Mar-11 19:55
SledgeHammer018-Mar-11 19:55 
AnswerRe: Can you bind by property name? Pin
Pete O'Hanlon8-Mar-11 21:32
mvePete O'Hanlon8-Mar-11 21:32 
GeneralRe: Can you bind by property name? Pin
SledgeHammer019-Mar-11 6:26
SledgeHammer019-Mar-11 6:26 
GeneralRe: Can you bind by property name? Pin
Pete O'Hanlon9-Mar-11 7:07
mvePete O'Hanlon9-Mar-11 7:07 
GeneralRe: Can you bind by property name? Pin
SledgeHammer019-Mar-11 7:44
SledgeHammer019-Mar-11 7:44 
Well, this is for a custom control (an enhanced ListView control), so there is no View / ViewModel involved. It is still a lookless control of course Smile | :) . I'm just not tying the design of the control to MVVM. Yes, the underlying property in the test app / test object does implement INPC.

Anyways, I dumped the Converter idea and went a different route which is working how I want it.

The "ListViewEx" overrides the item container generation and creates ListViewItemEx objects instead of ListViewItem objects.

Then in ListViewItemEx.OnApplyTemplate() I find the image control in the data template and create a Binding object and call image.SetBinding(Image.Source, binding);

This way I get true data binding to the underlying property and I don't have to do any crazy voodoo magic to get stuff to refresh. Of course, there is one issue and that is if the user suddenly decides to change Path from "ImageSource" to "SomethingElse", its not going to work because OnApplyTemplate() only gets called once.

EDIT: Actually, I guess there is a work-around. ListViewItems are regenerated when they go off screen and come back on, so I guess the user could just refresh the view if they really want to change Path.
GeneralRe: Can you bind by property name? Pin
Pete O'Hanlon9-Mar-11 9:11
mvePete O'Hanlon9-Mar-11 9:11 
GeneralRe: Can you bind by property name? Pin
SledgeHammer019-Mar-11 10:08
SledgeHammer019-Mar-11 10:08 
GeneralRe: Can you bind by property name? Pin
Pete O'Hanlon9-Mar-11 21:54
mvePete O'Hanlon9-Mar-11 21:54 
QuestionHow to update the datagrid in wpf based on text changed property of text box control in MVVM mdel? Pin
SRKSHOME8-Mar-11 6:47
SRKSHOME8-Mar-11 6:47 
AnswerRe: How to update the datagrid in wpf based on text changed property of text box control in MVVM mdel? Pin
Jammer8-Mar-11 7:26
Jammer8-Mar-11 7:26 
AnswerRe: How to update the datagrid in wpf based on text changed property of text box control in MVVM mdel? Pin
Pete O'Hanlon8-Mar-11 9:07
mvePete O'Hanlon8-Mar-11 9:07 
QuestionResize controls in canvas Pin
manoj221847-Mar-11 1:20
manoj221847-Mar-11 1:20 
AnswerRe: Resize controls in canvas Pin
Abhinav S7-Mar-11 2:07
Abhinav S7-Mar-11 2:07 
AnswerRe: Resize controls in canvas Pin
RobCroll7-Mar-11 15:37
RobCroll7-Mar-11 15:37 
QuestionAutoCompleteBox Pin
Moonwalker0315-Mar-11 5:35
Moonwalker0315-Mar-11 5:35 
AnswerRe: AutoCompleteBox Pin
Pete O'Hanlon5-Mar-11 6:54
mvePete O'Hanlon5-Mar-11 6:54 
GeneralRe: AutoCompleteBox Pin
Moonwalker0315-Mar-11 8:35
Moonwalker0315-Mar-11 8:35 
GeneralRe: AutoCompleteBox Pin
Pete O'Hanlon5-Mar-11 9:40
mvePete O'Hanlon5-Mar-11 9:40 
GeneralRe: AutoCompleteBox Pin
Moonwalker0315-Mar-11 10:59
Moonwalker0315-Mar-11 10:59 
GeneralRe: AutoCompleteBox Pin
Pete O'Hanlon5-Mar-11 11:27
mvePete O'Hanlon5-Mar-11 11:27 
GeneralRe: AutoCompleteBox Pin
Moonwalker0315-Mar-11 13:47
Moonwalker0315-Mar-11 13:47 
GeneralRe: AutoCompleteBox Pin
SledgeHammer015-Mar-11 15:42
SledgeHammer015-Mar-11 15:42 

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.