Yet another blog about WPF, Surface, SL, MVVM, NUI.... - Tag - controls - 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 [ping] Amazing WPF Controls / JetPack Theme updated ! - DotNetKicks.com http://blog.lexique-du-net.com/index.php?post/2011/06/13/Amazing-WPF-Controls-/-JetPack-Theme-updated-%21#c3114 urn:md5:e42eb5b7fea2cd28dd88bbd50db7683f Mon, 13 Jun 2011 14:09:37 +0200 DotNetKicks.com <p><a href="http://www.dotnetkicks.com/wpf/Amazing_WPF_Controls_JetPack_Theme_updated">Amazing WPF Controls / JetPack Theme updated !</a></p> <!-- TB --> <p>You've been kicked (a good thing) - Trackback from DotNetKicks.com...</p> [ping] Amazing WPF Controls / JetPack Theme updated ! - DotNetShoutout http://blog.lexique-du-net.com/index.php?post/2011/06/13/Amazing-WPF-Controls-/-JetPack-Theme-updated-%21#c3113 urn:md5:6d600255d73c933b7eb658883a6805fe Mon, 13 Jun 2011 14:09:22 +0200 DotNetShoutout <p><a href="http://dotnetshoutout.com/Jonathan-ANTOINEs-blog-Amazing-WPF-Controls-JetPack-Theme-updated-Yet-another-blog-about-WPF-Surface-SL-MVVM-NUI">Jonathan ANTOINE's blog - Amazing WPF Controls / JetPack</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from DotNetShoutout...</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] Introducing the amazing WPF controls library on Codeplex ! - DotNetShoutout http://blog.lexique-du-net.com/index.php?post/2010/10/25/Introducing-the-amazing-WPF-controls-library-on-Codeplex-%21#c2488 urn:md5:ad9b502636241ab6b5e7a2c073611540 Wed, 27 Oct 2010 14:08:14 +0200 DotNetShoutout <p><a href="http://dotnetshoutout.com/Introducing-the-amazing-WPF-controls-library-on-Codeplex-">Introducing the amazing WPF controls library on Codeplex !</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from DotNetShoutout...</p> How to create an hand writing to text control (ink recognizer) - Abdo http://blog.lexique-du-net.com/index.php?post/2010/09/19/How-to-create-an-hand-writing-to-text-control-%28ink-recognizer%29#c2487 urn:md5:4335a166eda7d5baca20f21541a7cd7f Mon, 25 Oct 2010 13:30:50 +0200 Abdo <p>Nice One , Thanks man.</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] UserControl/Control : how to get a reference to an element of the template - DotNetKicks.com http://blog.lexique-du-net.com/index.php?post/2010/09/14/UserControl/Control-how-to-get-a-reference-to-an-element-of-the-template#c2257 urn:md5:cdb383bec89abdcc881d1269787091be Wed, 15 Sep 2010 10:47:51 +0200 DotNetKicks.com <p><a href="http://www.dotnetkicks.com/wpf/UserControl_Control_how_to_get_a_reference_to_an_element_of_the_temp">UserControl/Control : how to get a reference to an element</a></p> <!-- TB --> <p>You've been kicked (a good thing) - Trackback from DotNetKicks.com...</p> [ping] UserControl/Control : how to get a reference to an element of the template - DotNetShoutout http://blog.lexique-du-net.com/index.php?post/2010/09/14/UserControl/Control-how-to-get-a-reference-to-an-element-of-the-template#c2256 urn:md5:f92f483a0b88c1982b8ee5211546d59e Wed, 15 Sep 2010 10:46:28 +0200 DotNetShoutout <p><a href="http://dotnetshoutout.com/UserControlControl-how-to-get-a-reference-to-an-element-of-the-template">UserControl/Control : how to get a reference to an element</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from DotNetShoutout...</p>