Yet another blog about WPF, Surface, SL, MVVM, NUI.... - Tag - how to - 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 MVVM : How to keep collections of ViewModel and Model in sync - Zar http://blog.lexique-du-net.com/index.php?post/2010/03/02/M-V-VM-How-to-keep-collections-of-ViewModel-and-Model-in-sync#c3476 urn:md5:58d665934014e91f44e18b766dfbb8a7 Mon, 11 Feb 2013 05:19:41 +0100 Zar <p>Nice Post, Thanks.</p> How to scale around a specific point and not the center of the Element - Martin Berger http://blog.lexique-du-net.com/index.php?post/2009/10/11/How-to-scale-around-a-specific-point-and-not-the-center-of-the-Element#c3475 urn:md5:04a3699214e5c1fb97a23dd70599030a Fri, 07 Dec 2012 10:20:03 +0100 Martin Berger <p>Hello,</p> <p>what is this last line supposed to perform?</p> <pre> if (scaleDelta &gt; 1.0) _myObjectToScale.Center += new Vector(newCenterXD, newCenterYD); else _myObjectToScale.Center += new Vector(newCenterXD, newCenterYD);</pre> <p>scaleDelta can be less or greater that 1.0, same code will execute.</p> MVVM : How to keep collections of ViewModel and Model in sync - sanjuro http://blog.lexique-du-net.com/index.php?post/2010/03/02/M-V-VM-How-to-keep-collections-of-ViewModel-and-Model-in-sync#c3474 urn:md5:4d5dd04e6f35b8a705e726c267051e90 Mon, 29 Oct 2012 15:50:38 +0100 sanjuro <p>I agree with Nathan, Syncer should be implemented in .NET by default, but i would name it ProxyObservableCollection <img src="themes/default/smilies/smile.png" alt=":)" class="smiley" /></p> 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> MVVM : How to keep collections of ViewModel and Model in sync - David http://blog.lexique-du-net.com/index.php?post/2010/03/02/M-V-VM-How-to-keep-collections-of-ViewModel-and-Model-in-sync#c3127 urn:md5:04fb361ee7f4e82ae23c1ad4b5fc8348 Sat, 17 Sep 2011 18:37:08 +0200 David <p>Great post. Thanks!</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> [Performance tips] Use the system shadows instead of your own - Jonathan ANTOINE http://blog.lexique-du-net.com/index.php?post/2010/04/27/Performance-tips-Use-the-system-shadows-instead-of-your-own#c2660 urn:md5:29b985fcf9dc7f164a6033261ae123ab Mon, 28 Mar 2011 21:09:11 +0200 Jonathan ANTOINE <p>@<a href="http://blog.lexique-du-net.com/index.php?post/2010/04/27/Performance-tips-Use-the-system-shadows-instead-of-your-own#c2646" rel="nofollow">Nirvi</a>&nbsp;: I think it will still work because we use a specific control (the shadow) in a specific assembly and not the theme system as a whole.</p> [Performance tips] Use the system shadows instead of your own - Nirvi http://blog.lexique-du-net.com/index.php?post/2010/04/27/Performance-tips-Use-the-system-shadows-instead-of-your-own#c2646 urn:md5:a959b69f409d69562826c6c23794f17c Sun, 27 Mar 2011 13:41:24 +0200 Nirvi <p>What if the user runs on XP SP3 with some of the freaky themes, will the Shadow Chrome appear?</p> [RIA Services] Why the client extended entities won't use the default backing store value ? EDITED - Jonathan ANTOINE http://blog.lexique-du-net.com/index.php?post/2010/11/19/%5BRIA-Services%5D-Why-the-client-extended-entities-won-t-use-the-default-backing-store-value#c2514 urn:md5:af4dceff71c2ccd5cde4ff190fb0ff37 Mon, 22 Nov 2010 01:33:22 +0100 Jonathan ANTOINE <p>@<a href="http://blog.lexique-du-net.com/index.php?post/2010/11/19/%5BRIA-Services%5D-Why-the-client-extended-entities-won-t-use-the-default-backing-store-value#c2512" rel="nofollow">Jeff Handley</a>&nbsp;: thx for the info !</p> [RIA Services] Why the client extended entities won't use the default backing store value ? EDITED - Jeff Handley http://blog.lexique-du-net.com/index.php?post/2010/11/19/%5BRIA-Services%5D-Why-the-client-extended-entities-won-t-use-the-default-backing-store-value#c2512 urn:md5:432c026d52da2e872878164e2070036b Fri, 19 Nov 2010 18:38:58 +0100 Jeff Handley <p>Thanks for posting this. A note about the issue where re-loaded or submitted entities have their client-only properties overwritten with the default values: it will NOT be fixed in SP1. We are still evaluating designs for how we could address that in the best way possible.</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] WPF tip : How can I use static/dynamic resources in my tests - DotNetShoutout http://blog.lexique-du-net.com/index.php?post/2010/09/24/WPF-tip-How-can-I-use-static/dynamic-resources-in-my-tests#c2342 urn:md5:0d79109230c4abacaf42fe958487e6d7 Fri, 24 Sep 2010 12:55:20 +0200 DotNetShoutout <p><a href="http://dotnetshoutout.com/How-can-I-use-staticdynamic-resources-in-my-tests">How can I use static/dynamic resources in my tests</a></p> <!-- TB --> <p>Thank you for submitting this cool story - Trackback from DotNetShoutout...</p> [ping] WPF tip : How can I use static/dynamic resources in my tests - DotNetKicks.com http://blog.lexique-du-net.com/index.php?post/2010/09/24/WPF-tip-How-can-I-use-static/dynamic-resources-in-my-tests#c2341 urn:md5:1ac8cd53b7b9254405b668b032ce01fe Fri, 24 Sep 2010 12:53:49 +0200 DotNetKicks.com <p><a href="http://www.dotnetkicks.com/wpf/How_can_I_use_static_dynamic_resources_in_my_tests">How can I use static/dynamic resources in my tests</a></p> <!-- TB --> <p>You've been kicked (a good thing) - Trackback from DotNetKicks.com...</p>