Yet another blog about WPF, Surface, SL, MVVM, NUI.... - Tag - AttachedPropertyIn this blog we talk about WPF, Natural User Interface(NUI), Microsoft Surface, WIndows 7, Multitouch, Touchless, JavaFX, MVVM, patterns, tips, tricks .... and a lot of other things !2024-02-26T15:40:43+01:00Jonathan ANTOINEurn:md5:627146f22bec1346990949372a159bfaDotclearExecute a command on a specified control when clicking on a buttonurn:md5:d120a96b6da17f34e9dcdd2044d853d92010-06-16T15:07:00+02:002010-06-16T15:39:39+02:00JonathanANTOINE@falsemail.comWPFAttachedPropertyBindingdataBindingDependencyObjectDependencyPropertyeventsexamplehow tohow-toM-V-VMMouseEventMVVMOnPropertyChangedpatternpatternssampletipstrickWindows Presentation FoundationWPFXAML <p>Today another example of the powerful ramora pattern : execute a RoutedCommand on an Control when you click on a button outside of the aimed control scope.
When is it useful ? : for example when you use the infragistics grid (xamdatagrid) and you want to execute the command which remove the selected row from a button outside of the grid. You... <a href="http://blog.lexique-du-net.com/index.php?post/2010/06/16/Execute-a-command-on-a-specified-control-when-clicking-on-a-button"><em>Read</em> Execute a command on a specified control when clicking on a button</a></p>http://blog.lexique-du-net.com/index.php?post/2010/06/16/Execute-a-command-on-a-specified-control-when-clicking-on-a-button#comment-formhttp://feeds.feedburner.com/JonathanAntoine/comments/52Binding to the selected items of a ListBox (or an another items controls)urn:md5:04ab1651e48f6d69d4b3c1afa893f9762010-06-13T12:03:00+02:002010-06-14T15:53:51+02:00JonathanANTOINE@falsemail.comWPFAttachedPropertyBindingdataBindingDependencyObjectDependencyPropertyDesign patterneventshow tohow-toListBoxM-V-VMMVVMpatternpatternssampleSelectedItemstipstrickWindows Presentation FoundationWPFXAML <p>A problem you often meet when using MVVM is to get the selected items of an items control, especially Listbox.
You can easily bind the selected item or the current items but when multi selection comes in the way, it becomes harder because the SelectedItems (with an 's' property is not available to binding).
In this article we will discover an... <a href="http://blog.lexique-du-net.com/index.php?post/2010/06/13/Binding-to-the-selected-items-of-a-ListBox"><em>Read</em> Binding to the selected items of a ListBox (or an another items controls)</a></p>http://blog.lexique-du-net.com/index.php?post/2010/06/13/Binding-to-the-selected-items-of-a-ListBox#comment-formhttp://feeds.feedburner.com/JonathanAntoine/comments/51Binding on a Property which is not a DependencyPropertyurn:md5:d2eadacd7db37af377f1b69c8b528bb12010-04-05T09:03:00+02:002010-04-07T20:51:22+02:00JonathanANTOINE@falsemail.comWPFAttachedPropertycustomdataBindingdemoexamplehow tohow-toOnPropertyChangedpatternpatternstipstrickWPF <p>A lot of controls expose properties which are not DependencyProperties and then you can’t put a binding on it. On some other cases, you only have a getter as accessor and you can’t put a binding on it too…
This is for example the case for the ribbon’s group of the office ribbon or the converter’s parameter.
If you ever tried to do so, you... <a href="http://blog.lexique-du-net.com/index.php?post/2010/03/31/Binding-on-a-Property-which-is-not-a-DependencyProperty"><em>Read</em> Binding on a Property which is not a DependencyProperty</a></p>http://blog.lexique-du-net.com/index.php?post/2010/03/31/Binding-on-a-Property-which-is-not-a-DependencyProperty#comment-formhttp://feeds.feedburner.com/JonathanAntoine/comments/47DependencyProperties or INotifyPropertyChanged ?urn:md5:441834c0aab7c5bc41e56298bff512192010-03-01T12:31:00+01:002010-03-10T17:05:14+01:00JonathanANTOINE@falsemail.comWPFAttachedPropertydataBindingDependencyObjectDependencyPropertyeventsexamplehow toOnPropertyChangedtipstrickWPFXAML <p>When you want to make an object binding-aware you have two choices : implement INotifyPropertyChanged or create DependencyProperties. Which one is the best ? Let's try to answer this question !
How to implement INotifyPropertyChanged
Declaring that your class is implementing INotifyPropertyChanged adds an PropertyChangedEventHandler that you... <a href="http://blog.lexique-du-net.com/index.php?post/2010/02/24/DependencyProperties-or-INotifyPropertyChanged"><em>Read</em> DependencyProperties or INotifyPropertyChanged ?</a></p>http://blog.lexique-du-net.com/index.php?post/2010/02/24/DependencyProperties-or-INotifyPropertyChanged#comment-formhttp://feeds.feedburner.com/JonathanAntoine/comments/34Use AttachedProperties to add behaviors to the components (Ramora pattern)urn:md5:8d01b1ed9b0f1ce60ade839ff9d84a1d2010-02-19T17:47:00+01:002010-03-06T16:15:43+01:00JonathanANTOINE@falsemail.comWPFAttachedPropertydataBindingDependencyPropertyDesign patternhow tohow-toM-V-VMpatternsWPFXAML <p>The problem
In WPF you expect your components/controls to behave exactly as you want to.... but this not always the case.
For example : why does this combobox not execute a command when I change the selection or more often why this textbox does not execute a command when I press the Enter (return) key ?
This problem often occurs when you use... <a href="http://blog.lexique-du-net.com/index.php?post/2010/02/17/Use-AttachedProperties-to-add-behaviors-to-the-components"><em>Read</em> Use AttachedProperties to add behaviors to the components (Ramora pattern)</a></p>http://blog.lexique-du-net.com/index.php?post/2010/02/17/Use-AttachedProperties-to-add-behaviors-to-the-components#comment-formhttp://feeds.feedburner.com/JonathanAntoine/comments/31