Yet another blog about WPF, Surface, SL, MVVM, NUI.... - Tag - DependencyProperty - Comments http://blog.lexique-du-net.com/index.php? 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 ! en Mon, 26 Feb 2024 15:40:43 +0100 Jonathan ANTOINE, All rights reserved http://blogs.law.harvard.edu/tech/rss Dotclear Execute a command on a specified control when clicking on a button - JonathanANTOINE@falsemail.com http://blog.lexique-du-net.com/index.php?post/2010/06/16/Execute-a-command-on-a-specified-control-when-clicking-on-a-button#c3141 urn:md5:737067a8e99048e225e592dc519e84bc Fri, 06 Apr 2012 09:01:17 +0200 JonathanANTOINE@falsemail.com <p>You have to use the code in the&nbsp;<span style="background-color: rgb(238, 238, 238); font-family: monospace; line-height: 15px; text-align: left; ">ReceiveWeakEvent to do this <img src="themes/default/smilies/smile.png" alt=":)" class="smiley" /></span></p> Execute a command on a specified control when clicking on a button - Jeremy McLain http://blog.lexique-du-net.com/index.php?post/2010/06/16/Execute-a-command-on-a-specified-control-when-clicking-on-a-button#c3140 urn:md5:cf06e8b5892980812265fe5761445744 Thu, 05 Apr 2012 23:12:27 +0200 Jeremy McLain <p>How would you do this portion from code behind?</p> <pre> &lt;Button Content="Delete selected" tools:ExecuteCommandOnControl.RoutedCommand="{x:Static igDP:DataPresenterCommands.DeleteSelectedDataRecords}" tools:ExecuteCommandOnControl.Target="{Binding ElementName=dataGrid}" /&gt;</pre> MVVM - How to integrate the Office Ribbon respecting the pattern (especially the commands) - online writing http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon#c3133 urn:md5:3d81c5145cf4ce910b906d5b44273b08 Fri, 16 Dec 2011 16:52:49 +0100 online writing <p>I am very interested in this sphere and reading this post I have known many new things, which I have not known before. Thanks for publishing this great article here.</p> [UPDATED] How to call the method from the base of the base of the current class ? (base.base.MyMethod) - Jonathan ANTOINE 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#c3030 urn:md5:453c0832f348b8ff12dc912038e3a432 Fri, 13 May 2011 10:25:44 +0200 Jonathan ANTOINE <p>@<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#c3025" rel="nofollow">Thomas Levesque</a>&nbsp;:Hello Thomas,</p> <p>Thank you for your comment and it works like a charm <img src="themes/default/smilies/wink.png" alt=";-)" class="smiley" /> !</p> <p>Btw, there is still reflection in your solution, the only difference is that we use 'this' as the current instance without recreating one.</p> <p>I will update my post to add your solution <img src="themes/default/smilies/smile.png" alt=":-)" class="smiley" /></p> <p>Thx a lot !</p> [UPDATED] How to call the method from the base of the base of the current class ? (base.base.MyMethod) - Thomas Levesque 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#c3025 urn:md5:305c99d1c08a3d64b04642e5989c0527 Fri, 13 May 2011 00:31:53 +0200 Thomas Levesque <p>Interesting...<br /> .<br /> Normally, you should never need to call base.base.SomeMethod, it's usually a sign of a bad design because you're not supposed to be aware of implementation details of the base class. But of course in the case of the TabControl you're not in control of the base classes, so it's different...<br /> .<br /> Anyway, I don't really like this solution... Two main reasons :<br /> - you have to create a dummy instance of the class, which is pretty bad for performance and could have unexpected side effects<br /> - it uses reflection (also bad for performance) on a non documented private field of the Delegate class. The implementation of this class could change in future versions, and this solution wouldn't work any more.<br /> .<br /> What you need to achieve this is a non-virtual call to GrandFather.MyMethod. This can be done by generating code at runtime with DynamicMethod:</p> <pre> class Child : Father { private delegate void MyMethodOpenDelegate(GrandFather instance, object param); private static readonly MyMethodOpenDelegate _grandFather_MyMethod; static Child() { DynamicMethod dm = new DynamicMethod( "grandFather_MyMethod", typeof(void), new Type[] {typeof(GrandFather), typeof(object)}, typeof(Child)); var il = dm.GetILGenerator(); il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Ldarg_1); il.EmitCall(OpCodes.Call, typeof(GrandFather).GetMethod("MyMethod"), null); il.Emit(OpCodes.Ret); _grandFather_MyMethod = (MyMethodOpenDelegate)dm.CreateDelegate( typeof(MyMethodOpenDelegate)); } public override void MyMethod(object param) { _grandFather_MyMethod(this, param); } }</pre> <p>(note the use of OpCodes.Call instead of OpCodes.Callvirt)</p> [ping] [UPDATED] How to call the method from the base of the base of the current class ? (base.base.MyMethod) - DotNetKicks.com 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#c3018 urn:md5:761147145e4258d01f6fd2d6605c32e1 Thu, 12 May 2011 00:00:34 +0200 DotNetKicks.com <p><a href="http://www.dotnetkicks.com/csharp/How_to_call_the_method_from_the_base_of_the_base_of_the_current_class">How to call the method from the base of the base of the</a></p> <!-- TB --> <p>You've been kicked (a good thing) - Trackback from DotNetKicks.com...</p> [ping] [UPDATED] How to call the method from the base of the base of the current class ? (base.base.MyMethod) - DotNetShoutout 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#c3017 urn:md5:2f9a841379c0f7838a8e765a2175e57e Thu, 12 May 2011 00:00:22 +0200 DotNetShoutout <p><a href="http://dotnetshoutout.com/How-to-call-the-method-from-the-base-of-the-base-of-the-current-class-basebaseMyMethod">How to call the method from the base of the base of the</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from DotNetShoutout...</p> [ping] How to create your own control library (how-to + tips) - DotNetShoutout http://blog.lexique-du-net.com/index.php?post/2010/10/04/How-to-create-your-own-control-library#c2353 urn:md5:cc1f59485da438e8713847e7a5fb013e Mon, 04 Oct 2010 17:41:37 +0200 DotNetShoutout <p><a href="http://dotnetshoutout.com/How-to-create-your-own-control-library-how-to-tips">How to create your own control library (how-to + tips)</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from DotNetShoutout...</p> [ping] How to create your own control library (how-to + tips) - DotNetKicks.com http://blog.lexique-du-net.com/index.php?post/2010/10/04/How-to-create-your-own-control-library#c2352 urn:md5:b9f9dbed4eee3d7a5bcdb851292ec938 Mon, 04 Oct 2010 17:40:17 +0200 DotNetKicks.com <p><a href="http://www.dotnetkicks.com/wpf/How_to_create_your_own_control_library_how_to_tips">How to create your own control library (how-to tips)</a></p> <!-- TB --> <p>You've been kicked (a good thing) - Trackback from DotNetKicks.com...</p> [ping] Binding to the selected items of a ListBox (or an another items controls) - iAwaaz-News-by-People http://blog.lexique-du-net.com/index.php?post/2010/06/13/Binding-to-the-selected-items-of-a-ListBox#c2240 urn:md5:634d927107e4bc0eea0c744c37abe63a Fri, 18 Jun 2010 06:00:21 +0200 iAwaaz-News-by-People <p><a href="http://www.iawaaz.com/Binding-to-the-selected-items-of-a-ListBox-or-an-another-items-controls">Binding to the selected items of a ListBox (or an another</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from iAwaaz-News-by-People...</p> [ping] Execute a command on a specified control when clicking on a button - iAwaaz-News-by-People http://blog.lexique-du-net.com/index.php?post/2010/06/16/Execute-a-command-on-a-specified-control-when-clicking-on-a-button#c2211 urn:md5:53a534f71e0da8737f4549154b97afb4 Wed, 16 Jun 2010 15:39:19 +0200 iAwaaz-News-by-People <p><a href="http://www.iawaaz.com/Execute-a-command-on-a-specified-control-when-clicking-on-a-button">Execute a command on a specified control when clicking on a</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from iAwaaz-News-by-People...</p> [ping] Execute a command on a specified control when clicking on a button - DotNetKicks.com http://blog.lexique-du-net.com/index.php?post/2010/06/16/Execute-a-command-on-a-specified-control-when-clicking-on-a-button#c2210 urn:md5:25d35bd4a8033e3623cf757d68b9cc76 Wed, 16 Jun 2010 15:36:31 +0200 DotNetKicks.com <p><a href="http://www.dotnetkicks.com/wpf/Execute_a_command_on_a_specified_control_when_clicking_on_a_button">Execute a command on a specified control when clicking on a</a></p> <!-- TB --> <p>You've been kicked (a good thing) - Trackback from DotNetKicks.com...</p> [ping] Execute a command on a specified control when clicking on a button - DotNetShoutout http://blog.lexique-du-net.com/index.php?post/2010/06/16/Execute-a-command-on-a-specified-control-when-clicking-on-a-button#c2209 urn:md5:ee77c82e5ecdffbbff9a3392bcf840c7 Wed, 16 Jun 2010 15:34:51 +0200 DotNetShoutout <p><a href="http://dotnetshoutout.com/Execute-a-command-on-a-specified-control-when-clicking-on-a-button">Execute a command on a specified control when clicking on a</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from DotNetShoutout...</p> [ping] Binding to the selected items of a ListBox (or an another items controls) - DotNetKicks.com http://blog.lexique-du-net.com/index.php?post/2010/06/13/Binding-to-the-selected-items-of-a-ListBox#c2180 urn:md5:65038388b1c746bc43ef42ae4fb76d00 Mon, 14 Jun 2010 15:53:27 +0200 DotNetKicks.com <p><a href="http://www.dotnetkicks.com/wpf/Binding_to_the_selected_items_of_a_ListBox_or_an_another_items_contro">Binding to the selected items of a ListBox (or an another</a></p> <!-- TB --> <p>You've been kicked (a good thing) - Trackback from DotNetKicks.com...</p> [ping] Binding to the selected items of a ListBox (or an another items controls) - DotNetShoutout http://blog.lexique-du-net.com/index.php?post/2010/06/13/Binding-to-the-selected-items-of-a-ListBox#c2179 urn:md5:79d304f169a68d87ae3cafced5aabd2d Mon, 14 Jun 2010 15:52:02 +0200 DotNetShoutout <p><a href="http://dotnetshoutout.com/Binding-to-the-selected-items-of-a-ListBox-or-an-another-items-controls">Binding to the selected items of a ListBox (or an another</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from DotNetShoutout...</p> MVVM - How to integrate the Office Ribbon respecting the pattern (especially the commands) - Daniel http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon#c1795 urn:md5:a6c0d103226f1dad2336b3f1f1e9f2b6 Sat, 22 May 2010 06:25:31 +0200 Daniel <p>Try Fluent Ribbon Control Suite (<a href="http://fluent.codeplex.com" title="http://fluent.codeplex.com" rel="nofollow">http://fluent.codeplex.com</a>). Fluent Ribbon is more MVVM-friendly, you can find MVVM sample there.</p> MVVM - How to integrate the Office Ribbon respecting the pattern (especially the commands) - aani http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon#c1544 urn:md5:141e681e962246ef7ddf118db9eb838e Mon, 19 Apr 2010 08:01:01 +0200 aani <p>Could you please upload the demo project?</p> MVVM - How to integrate the Office Ribbon respecting the pattern (especially the commands) - hedi http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon#c1399 urn:md5:761f97c914d46c9b01020f57b9102596 Sun, 28 Mar 2010 13:41:52 +0200 hedi <p>I'm developping an application which bases on PrismV2 and the designPattern MVVM.<br /> Thus I develop every module separately and I use a main interface to call them (Shell)<br /> My Shell contains OfficeRibbon<br /> I still have some problems to understand<br /> can you explain me how I have to use RibbonCommand?</p> MVVM - How to integrate the Office Ribbon respecting the pattern (especially the commands) - Jonathan ANTOINE http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon#c1362 urn:md5:b3fcbf1a11239935aec58019794149c0 Thu, 25 Mar 2010 13:55:37 +0100 Jonathan ANTOINE <p>@<a href="http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon#c1361" rel="nofollow">Emperor</a> :Thx, it works fine !</p> MVVM - How to integrate the Office Ribbon respecting the pattern (especially the commands) - Emperor http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon#c1361 urn:md5:bbb4a6d16880451123ecbc3148c8da7e Thu, 25 Mar 2010 13:26:08 +0100 Emperor <p>@<a href="http://blog.lexique-du-net.com/index.php?post/2010/02/28/MVVM-How-to-integrate-the-Office-Ribbon#c1360" rel="nofollow">Jonathan ANTOINE</a> : after you are finished with adding/removing/clearing Controls property call OnApplyTemplate() on RibbonGroup to update the visuals.</p>