Yet another blog about WPF, Surface, SL, MVVM, NUI.... - Tag - DependencyProperty In 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:00 Jonathan ANTOINE urn:md5:627146f22bec1346990949372a159bfa Dotclear [UPDATED] How to call the method from the base of the base of the current class ? (base.base.MyMethod) urn:md5:d900bf7d396d3bc1a150d6e19676cfd9 2011-05-11T23:56:00+02:00 2011-08-10T14:46:30+02:00 JonathanANTOINE@falsemail.com .NET controlscustomDependencyPropertyhow tohow-totipstrick <p>Today I encountered a tricky need in some custom control. It was inheriting from the TabControl but I didn’t want all its feature. Especially I didn’t want it to update the SelectedContent dependency property because it was keeping a strong reference to a ViewModel and keeping it away from the garbage collector.</p> <p>  The problem is that the TabControl do this in an event handler of the ItemContainerGenerator’s StatusChanged event. This subscription is made in the OnInitialized method. This one is marked as protected and virtual so I could override it to do nothing but if had do so I would have loose all the work done in the base class of the TabControl which... <a href="http://blog.lexique-du-net.com/index.php?post/2011/05/11/How-to-call-the-method-from-the-base-of-the-base-of-the-current-class-%28base.base.MyMethod%29"><em>Read</em> [UPDATED] How to call the method from the base of the base of the current class ? (base.base.MyMethod)</a></p> http://blog.lexique-du-net.com/index.php?post/2011/05/11/How-to-call-the-method-from-the-base-of-the-base-of-the-current-class-%28base.base.MyMethod%29#comment-form http://feeds.feedburner.com/JonathanAntoine/comments/75 How to create your own control library (how-to + tips) urn:md5:9ed22011e4c8dd030431d70034af0342 2010-10-03T23:27:00+02:00 2010-10-04T17:42:57+02:00 JonathanANTOINE@falsemail.com WPF BindingContentControlcontrolscustomdataBindingDataTemplateDependencyPropertyeventsexamplehow tohow-toLibrarysampleTemplatetipstrickWindows Presentation FoundationWPFXAML <p>Reusability and factorizing are maybe the most commons things you want and use when you are developing applications. In WPF it often means creating controls library (i don’t mean UserControl) that will be easy to use in multiple applications. In this post we'll see all the step to create a control library useable in differents projects. The... <a href="http://blog.lexique-du-net.com/index.php?post/2010/10/04/How-to-create-your-own-control-library"><em>Read</em> How to create your own control library (how-to + tips)</a></p> http://blog.lexique-du-net.com/index.php?post/2010/10/04/How-to-create-your-own-control-library#comment-form http://feeds.feedburner.com/JonathanAntoine/comments/59 Execute a command on a specified control when clicking on a button urn:md5:d120a96b6da17f34e9dcdd2044d853d9 2010-06-16T15:07:00+02:00 2010-06-16T15:39:39+02:00 JonathanANTOINE@falsemail.com WPF AttachedPropertyBindingdataBindingDependencyObjectDependencyPropertyeventsexamplehow 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-form http://feeds.feedburner.com/JonathanAntoine/comments/52 Binding to the selected items of a ListBox (or an another items controls) urn:md5:04ab1651e48f6d69d4b3c1afa893f976 2010-06-13T12:03:00+02:00 2010-06-14T15:53:51+02:00 JonathanANTOINE@falsemail.com WPF AttachedPropertyBindingdataBindingDependencyObjectDependencyPropertyDesign 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-form http://feeds.feedburner.com/JonathanAntoine/comments/51 MVVM - How to integrate the Office Ribbon respecting the pattern (especially the commands) urn:md5:b21944e275d0dc07e8f8d58a593fcab3 2010-03-04T20:01:00+01:00 2010-03-04T20:29:25+01:00 JonathanANTOINE@falsemail.com WPF DependencyObjectDependencyPropertyDesign patternhow tohow-toM-V-VMMVVMpatternpatternstipstrickWPF <p>Synopsis The ribbon controls - introduced by office 2007 -are available for free on the Microsoft Office web site (French users should set the language to "english" to access the ressources). They can leverage the user's experience of your application and are pretty simple to use. When I wanted to add them into one of my application I realized... <a href="http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon"><em>Read</em> MVVM - How to integrate the Office Ribbon respecting the pattern (especially the commands)</a></p> http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon#comment-form http://feeds.feedburner.com/JonathanAntoine/comments/38 DependencyProperties or INotifyPropertyChanged ? urn:md5:441834c0aab7c5bc41e56298bff51219 2010-03-01T12:31:00+01:00 2010-03-10T17:05:14+01:00 JonathanANTOINE@falsemail.com WPF AttachedPropertydataBindingDependencyObjectDependencyPropertyeventsexamplehow 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-form http://feeds.feedburner.com/JonathanAntoine/comments/34 Use AttachedProperties to add behaviors to the components (Ramora pattern) urn:md5:8d01b1ed9b0f1ce60ade839ff9d84a1d 2010-02-19T17:47:00+01:00 2010-03-06T16:15:43+01:00 JonathanANTOINE@falsemail.com WPF AttachedPropertydataBindingDependencyPropertyDesign 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-form http://feeds.feedburner.com/JonathanAntoine/comments/31 CREATE, LAUNCH and CONTROL a WPF animation FROM CODE urn:md5:1813871b1ab6d37b27fb1c000f6969c2 2009-07-07T14:30:00+02:00 2010-02-18T20:41:55+01:00 JonathanANTOINE@falsemail.com WPF animationcustomDependencyObjectDependencyPropertyhow-toWPF <p>The problem Sometimes you need to animate your specific object and for this purpose there is the WPF animation. Here are the prerequireds : The property you want to animate must be a DependencyProperty, The property must so be a part of a DependencyObject, Your object must implement IAnimatable to be able to launch the animation. The... <a href="http://blog.lexique-du-net.com/index.php?post/2009/07/07/CREATE%2C-LAUNCH-and-CONTROL-a-WPF-animation-FROM-CODE"><em>Read</em> CREATE, LAUNCH and CONTROL a WPF animation FROM CODE</a></p> http://blog.lexique-du-net.com/index.php?post/2009/07/07/CREATE%2C-LAUNCH-and-CONTROL-a-WPF-animation-FROM-CODE#comment-form http://feeds.feedburner.com/JonathanAntoine/comments/24 Use dataBinding and DependencyProperty with a non-WPF or extern object urn:md5:4bb9a70cce949cd330b75047bcc048de 2009-04-10T10:52:00+02:00 2010-02-18T20:42:47+01:00 JonathanANTOINE@falsemail.com WPF animationdataBindingDependencyObjectDependencyPropertyhow-toMogreOnPropertyChangedWPF <p>Today we are going to learn how we can uses the powerful data binding of WPF even on non-WPF objects. The problem: when to use this solution ? Sometimes you need to use the databinding with an object that you have not created and you can't use inheritance. For example I wanted to use a Mogre Camera and build some WPF animation with it and I... <a href="http://blog.lexique-du-net.com/index.php?post/2009/04/10/Use-dataBinding-and-DependencyProperty-with-a-non-WPF-or-extern-object"><em>Read</em> Use dataBinding and DependencyProperty with a non-WPF or extern object</a></p> http://blog.lexique-du-net.com/index.php?post/2009/04/10/Use-dataBinding-and-DependencyProperty-with-a-non-WPF-or-extern-object#comment-form http://feeds.feedburner.com/JonathanAntoine/comments/20