Click here to Skip to main content
15,881,204 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Marc Jeeves2-Sep-22 4:11
Marc Jeeves2-Sep-22 4:11 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Richard MacCutchan3-Sep-22 21:01
mveRichard MacCutchan3-Sep-22 21:01 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
mjeeves3-Sep-22 8:58
mjeeves3-Sep-22 8:58 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Gerry Schmitz4-Sep-22 8:57
mveGerry Schmitz4-Sep-22 8:57 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Richard Deeming5-Sep-22 21:11
mveRichard Deeming5-Sep-22 21:11 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Gerry Schmitz6-Sep-22 5:34
mveGerry Schmitz6-Sep-22 5:34 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Marc Jeeves6-Sep-22 10:05
Marc Jeeves6-Sep-22 10:05 
GeneralRe: Using Dependency Property's to Affect Non WPF Property's Pin
Gerry Schmitz6-Sep-22 13:19
mveGerry Schmitz6-Sep-22 13:19 
You're actually creating a user control; and not a "custom control".

The "simplest" way to create a user control is to add properties {get;set;} to the UC in the .cs; bind the controls in the .xaml to the properties in the .cs; and implement INotifyPropertyChanged (which for a "few" controls, can be issued with "no contol name" without any hit on performance). The DataContext of the UC is the UC; i.e. "this".

Any time there is new data, you load the properties and call "property changed" which updates the UI. If it's a two-way UI, data moves to the properties and events on the controls get invoked (e.g. text changed).

That's the pattern, and most everything else has a "smell". Dead | X| Shucks | :-\

Anything else that happens is a function of what events the user control wants to "surface" (e.g. a request queued to an observable collection or file watcher).


"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

QuestionCan Not Bin to Dependency Property in Custom Control Pin
Marc Jeeves1-Sep-22 6:26
Marc Jeeves1-Sep-22 6:26 
AnswerRe: Can Not Bin to Dependency Property in Custom Control Pin
Richard Deeming1-Sep-22 6:35
mveRichard Deeming1-Sep-22 6:35 
GeneralRe: Can Not Bin to Dependency Property in Custom Control Pin
Marc Jeeves1-Sep-22 6:47
Marc Jeeves1-Sep-22 6:47 
QuestionWhat is the most common MVVM framework used today? Pin
Code4Ever21-Jul-22 7:26
Code4Ever21-Jul-22 7:26 
AnswerRe: What is the most common MVVM framework used today? Pin
Pete O'Hanlon21-Jul-22 21:21
mvePete O'Hanlon21-Jul-22 21:21 
AnswerRe: What is the most common MVVM framework used today? Pin
Richard Deeming21-Jul-22 21:22
mveRichard Deeming21-Jul-22 21:22 
AnswerRe: What is the most common MVVM framework used today? Pin
Gerry Schmitz22-Jul-22 5:10
mveGerry Schmitz22-Jul-22 5:10 
GeneralRe: What is the most common MVVM framework used today? Pin
Pete O'Hanlon24-Jul-22 11:32
mvePete O'Hanlon24-Jul-22 11:32 
GeneralRe: What is the most common MVVM framework used today? Pin
Gerry Schmitz25-Jul-22 20:43
mveGerry Schmitz25-Jul-22 20:43 
GeneralRe: What is the most common MVVM framework used today? Pin
Pete O'Hanlon25-Jul-22 21:30
mvePete O'Hanlon25-Jul-22 21:30 
QuestionIs it possible to do event handling in the ViewModel? Pin
Code4Ever16-Jul-22 6:39
Code4Ever16-Jul-22 6:39 
AnswerRe: Is it possible to do event handling in the ViewModel? Pin
Gerry Schmitz17-Jul-22 6:06
mveGerry Schmitz17-Jul-22 6:06 
QuestionDICOM TAGS Pin
harol espinosa26-Jun-22 5:20
harol espinosa26-Jun-22 5:20 
AnswerRe: DICOM TAGS Pin
Dave Kreskowiak26-Jun-22 6:13
mveDave Kreskowiak26-Jun-22 6:13 
QuestionDevelopment Pin
User 156237373-Jun-22 10:46
User 156237373-Jun-22 10:46 
AnswerRe: Development Pin
Gerry Schmitz4-Jun-22 10:35
mveGerry Schmitz4-Jun-22 10:35 
GeneralRe: Development Pin
User 156237376-Jun-22 4:22
User 156237376-Jun-22 4:22 

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.