<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>David Hardy's MSDN contribution</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/davihard/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/davihard/feed.xml</link>
    <description>using the internet to remember stuff i care about, rather than my flawed internal memory</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:20:29 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>code</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/code</link>
      <pubDate>Wed, 12 May 2010 09:24:00 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/05/12/code/</guid>
      <description><![CDATA[a&nbsp;page for&nbsp;attachments ]]></description>
      <content:encoded><![CDATA[<P>a&nbsp;page for&nbsp;attachments </P>]]></content:encoded>
    </item>
    <item>
      <title>repost: MVVM, providing the Association of View to ViewModel</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/repost-mvvm-providing-the-association-of-view-to-viewmodel</link>
      <pubDate>Mon, 10 May 2010 14:04:40 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/05/10/repost-mvvm-providing-the-association-of-view-to-viewmodel/</guid>
      <description><![CDATA[Jason Rainwater&nbsp;posted a nice summary of the ways in which you can hook up the View and the...]]></description>
      <content:encoded><![CDATA[<blockquote> <p></p></blockquote> <p><a href="https://cid-dd5a60a80e18ee33.profile.live.com/">Jason Rainwater</a>&nbsp;<a href="https://torinth.spaces.live.com/blog/cns!DD5A60A80E18EE33!185.entry">posted a nice summary of the ways in which you can hook up the View and the ViewModel</a>:  <blockquote> <p>May 26  <h6>MVVM, providing the Association of View to ViewModel</h6> <p>Hello everyone!  <p>As stated in my previous post, today I will be talking about the different ways we can associate a ViewModel (or any other type of middle object in the MV? design patterns) to the View.  <p>When we look at the UI design patterns we almost always have a View and a middle object, whether it be a ViewModel, Presenter, Controller, Presentation Model, or other newly thought up facilitators, their has to be some sort of association between them.&nbsp; Today I will show two different ways that we can associate a View to a ViewModel.  <p>The first is my personal favorite and that is using a DataTemplate.&nbsp; A DataTemplate is a way we can provide a visual representation of any object.&nbsp; The object in our case is the ViewModel.<pre>   1: &lt;DataTemplate DataType="{x:Type vms:PersonViewModel}"&gt;</pre><pre>   2:     &lt;vws:PersonView /&gt;</pre><pre>   3: &lt;/DataTemplate&gt;</pre>
<p>What this does is allows us to use a ViewModel as content and have it resolve the PersonView as the visual to be used.&nbsp; The cool thing about this is that because the View is the representation of the DataTemplate the View will automatically have a DataContext set to the ViewModel that was set as Content.&nbsp; So inside the View we can &lt;TextBlock Text="{Binding PersonModel.FirstName}"/&gt; and the binding will work.&nbsp; This to me is the way to keep the most separation of visuals and behavior.&nbsp; The View knows nothing directly about the ViewModel and the ViewModel knows nothing directly about the View.&nbsp; If you create a new View you can just inject a new DataTemplate targeted to the same type and you will have a new Visual for your ViewModel. 
<p>The drawback to this is that you do have a full separation so if you need a few coupled items you may have to utilize some other concepts or break the separation by having references back and forth between the View and ViewModel. 
<p>The second way to provide the association is using Constructor Injection to the ViewModel and instance of the View.&nbsp; The code may look something like this.<pre>   1: public class PersonViewModel</pre><pre>   2: {</pre><pre>   3:     private IPersonView _view;</pre><pre>   4:&nbsp; </pre><pre>   5:     public IPersonView View</pre><pre>   6:     {</pre><pre>   7:         get</pre><pre>   8:         {</pre><pre>   9:             return _view;</pre><pre>  10:         }</pre><pre>  11:     }</pre><pre>  12:&nbsp; </pre><pre>  13:     public PersonViewModel(IPersonView view)</pre><pre>  14:     {</pre><pre>  15:         _view = view;</pre><pre>  16:&nbsp; </pre><pre>  17:         _view.DataContext = this;</pre><pre>  18:     }</pre><pre>  19: }</pre>
<p>What this does is allows the ViewModel to contain an instance of the View so that it can do things like utilizing events to it, making method calls and such.&nbsp; The way we would utilize this is by using either concrete instantiation or Dependency Injection resolution.<pre>   1: PersonViewModel viewModel = UnityContainer.Resolve&lt;PersonViewModel&gt;();</pre><pre>   2:&nbsp; </pre><pre>   3: NavigationManager.NavigateTo(viewModel.View);</pre>
<p>Whichever view is registered with the container is the View that will get used so we can still provide different Views for the same ViewModel in this case.&nbsp; This gives us more access to things on the View but also tightly couples us a little more.&nbsp; This is not a bad thing but it may be too much for your needs depending on the project.&nbsp; This also "looks" more like a Presenter than a ViewModel at this point. 
<p>The key to the semantics of these different interactions is the difference between a ViewModel and a Presenter.&nbsp; Generally the second way looks more like a Presenter, but we call is a ViewModel.&nbsp; I do not think it really matters what we call it as long as certain guidelines are followed.&nbsp; Things like using Binding.&nbsp; We can call it a Controller with Binding if we want as along as we adhere to utilizing Binding. 
<p>I hope this information is useful and have a good day!</p></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>me: the unintended use-case for Accessibility</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/me-the-unintended-use-case-for-accessibility</link>
      <pubDate>Tue, 04 May 2010 15:49:47 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/05/04/me-the-unintended-use-case-for-accessibility/</guid>
      <description><![CDATA[&nbsp; For me, the keyboard is paramount and the mouse should only used as a last resort.&nbsp; It...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p> <p>For me, the keyboard is paramount and the mouse should only used as a last resort.&nbsp; It is in direct alignment with my contention that the command line is paramount and a GUI should be used only as a last resort.&nbsp; Perhaps juxtapose to those postulates is the fact that i *<strong>love</strong>* the <a href="https://en.wikipedia.org/wiki/Natural_User_Interface">NUI</a>.&nbsp; At any rate, i became interested in Accessibility primarily because keyboard shortcuts/hotkeys/accelerators allow me to keep my distance from the mouse.&nbsp; In HTML5 investigations i ran across John Foliot who runs the <a href="https://soap.stanford.edu">Stanford Online Accessibility Program</a>.&nbsp; On the SOAP home page i found an analogy that became a metaphor for my own experience with Accessibility.&nbsp; </p> <blockquote> <p><a href="https://soap.stanford.edu/">"A simple analogy is sidewalk cut-curbs. Initially provided to assist users in wheel-chairs, cut curbs today also benefit people on roller-blades and skate boards, cyclists and mothers with baby strollers; user-groups never originally envisioned when cut-curbs were first mandated. And while retro-fitting older sidewalk intersections was a time consuming and expensive undertaking, today the inclusion of cut-curbs in new sidewalk construction is a matter of course, and adds little to nothing to the overall cost of sidewalk construction or repair."</a></p></blockquote> <p>i'm a user that can, but doesn't want to use the mouse; i'm in a user-group probably never originally envisioned by the good folks that championed and those that continue to fight for Universal Accessibility.</p>]]></content:encoded>
    </item>
    <item>
      <title>Platform Invoke</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/platform-invoke</link>
      <pubDate>Wed, 28 Apr 2010 08:59:36 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/04/28/platform-invoke/</guid>
      <description><![CDATA[Punch line:&nbsp; PInvoke should be used sparingly; there should be a managed API for almost...]]></description>
      <content:encoded><![CDATA[<p><strong>Punch line:</strong>&nbsp;</p> <p>PInvoke should be used sparingly; there <em>should</em> be a managed API for almost everything you want to do.&nbsp; However, sometimes you absolutely have to talk to the unmanaged world from your comfy managed world.&nbsp; Not using it often is not an excuse for not knowing about it.&nbsp; First, who knows what problems you may run into that could only be solved by invoking some platform API.&nbsp; Moreover, the more you know, the more you know.broadening your understanding of programming concepts is obviously advantageous to a developer.blah, blah, blah learning's good, mmmkay.&nbsp; Recently i was <a href="https://blogs.msdn.com/michkap/archive/2010/04/06/9989320.aspx">prototyping some functionality</a> using the <a href="https://msdn.microsoft.com/library/dd318116.aspx">GetStringScripts API</a> and ran into some issues with out parameters.</p> <p>MSDN defines the syntax for this unmanaged function as the following.</p> <div class="csharpcode"><pre class="alt"><span class="lnum">   1:  </span><span class="kwrd">int</span> GetStringScripts(</pre><pre><span class="lnum">   2:  </span>  __in   DWORD dwFlags,</pre><pre class="alt"><span class="lnum">   3:  </span>  __in   LPCWSTR lpString,</pre><pre><span class="lnum">   4:  </span>  __in   <span class="kwrd">int</span> cchString,</pre><pre class="alt"><span class="lnum">   5:  </span>  __out  LPWSTR lpScripts,</pre><pre><span class="lnum">   6:  </span>  __in   <span class="kwrd">int</span> cchScripts</pre><pre class="alt"><span class="lnum">   7:  </span>);</pre></div>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>

<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>

<p>When i saw the __out LPWSTR lpScripts parameter, i erroneously assumed that i should use the C# <strong>out</strong> keyword.&nbsp; i was getting Access Violation errors until i was wised up by <a href="https://deletethis.net/dave/encodeomatic/dotnet/NationalLanguageSupportUtilities.cs">some site i found</a>.&nbsp; i <strike>hacked</strike> fixed up the code according to the example i saw and everything worked fine.&nbsp; Left ill at ease, i decided to investigate more deeply.&nbsp; i found myself asking, "How do you know how to properly write PInvoke signatures?"&nbsp; <a href="https://www.pinvoke.net/">PInvoke.net</a> is "primarily a wiki, allowing developers to find, edit and add PInvoke signatures, user-defined types, and any other information related to calling Win32 and other unmanaged APIs from managed code" but that's me doing copy-and-paste hacking-that's not me understanding what i'm doing. 
<div class="csharpcode"><pre class="alt"><span class="lnum">   1:  </span>        [DllImport(<span class="str">"kernel32.dll"</span>,</pre><pre><span class="lnum">   2:  </span>                    EntryPoint=<span class="str">"GetStringScripts"</span>,</pre><pre class="alt"><span class="lnum">   3:  </span>                    SetLastError= <span class="kwrd">true</span>,</pre><pre><span class="lnum">   4:  </span>                    CharSet = CharSet.Unicode,</pre><pre class="alt"><span class="lnum">   5:  </span>                    ExactSpelling=<span class="kwrd">true</span>,</pre><pre><span class="lnum">   6:  </span>                    BestFitMapping=<span class="kwrd">false</span>,</pre><pre class="alt"><span class="lnum">   7:  </span>                    ThrowOnUnmappableChar=<span class="kwrd">true</span>,</pre><pre><span class="lnum">   8:  </span>                    CallingConvention = CallingConvention.StdCall)]</pre><pre class="alt"><span class="lnum">   9:  </span>        <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">extern</span> <span class="kwrd">int</span> GetStringScriptsImport(</pre><pre><span class="lnum">  10:  </span>            <span class="kwrd">uint</span> dwFlags,</pre><pre class="alt"><span class="lnum">  11:  </span>            [In, MarshalAs(UnmanagedType.LPWStr)] String lpString,</pre><pre><span class="lnum">  12:  </span>            <span class="kwrd">int</span> cchString,</pre><pre class="alt"><span class="lnum">  13:  </span>            [Out, MarshalAs(UnmanagedType.LPWStr)] String lpScripts,</pre><pre><span class="lnum">  14:  </span>            <span class="kwrd">int</span> cchScripts);</pre></div>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>

<p><strong></strong>&nbsp; <p><strong></strong>C# syntax only allows for DllImport, while <a href="https://msdn.microsoft.com/en-us/library/w4byd5y4.aspx">Visual Basic allows for the declare statement and for the DllImport</a>.&nbsp; While blittable types were a new one on me, my investigation is going to stop shorter than i had originally guessed.&nbsp; The real information that i care about is captured in msdn articles on <a href="https://msdn.microsoft.com/en-us/library/ac7ay120.aspx">Platform Invoke Data Types</a>, <a href="https://msdn.microsoft.com/en-us/library/ms235282.aspx">Marshaling Arguments</a>, and the <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx">DllImportAttribute Class</a> which defines how to deal with complex method definitions that include <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.bestfitmapping.aspx">BestFitMapping</a>, <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.callingconvention.aspx">CallingConvention</a>, <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.exactspelling.aspx">ExactSpelling</a>, <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.preservesig.aspx">PreserveSig</a>, <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.setlasterror.aspx">SetLastError</a>, or <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.throwonunmappablechar.aspx">ThrowOnUnmappableChar</a> fields.&nbsp; And if i ever need to do some more Platform Invocations, i'll look to the <a href="https://msdn.microsoft.com/en-us/library/aa288468.aspx">Platform Invoke Tutorial</a>.
<p><strong>Background Reading:</strong> 
<p>Blittable/Non-Blittable Types 
<p>Broad definition 
<blockquote>
<p>A memory copy operation is sometimes referred to as a 'block transfer'. This term is sometimes abbreviated as BLT (there's actually a BLT instruction on the <a href="https://en.wikipedia.org/wiki/PDP-10">PDP-10</a>) and pronounced 'blit'. The term 'blittable' expresses whether it is legal to copy an object using a block transfer. 
<p>Pasted from &lt;<a href="https://en.wikipedia.org/wiki/Blittable_types">https://en.wikipedia.org/wiki/Blittable_types</a>&gt; </p></blockquote>
<p>.NET framework context 
<blockquote>
<p>Blittable and Non-Blittable Types</p></blockquote>
<blockquote>
<p>Most data types have a common representation in both managed and unmanaged memory and do not require special handling by the interop marshaler. These types are called blittable types because they do not require conversion when they are passed between managed and unmanaged code. 
<p>Return values from platform invoke calls must be blittable types. Platform invoke does not support non-blittable return types. 
<p>The following types from the <a href="https://msdn.microsoft.com/en-us/library/system.aspx">System</a> namespace are blittable types: 
<ul>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.byte.aspx">System.Byte</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.sbyte.aspx">System.SByte</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.int16.aspx">System.Int16</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.uint16.aspx">System.UInt16</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.int32.aspx">System.Int32</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.uint32.aspx">System.UInt32</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.int64.aspx">System.Int64</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.uint64.aspx">System.UInt64</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.intptr.aspx">System.IntPtr</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.uintptr.aspx">System.UIntPtr</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.single.aspx">System.Single</a></p>
<li>
<p><a href="https://msdn.microsoft.com/en-us/library/system.double.aspx">System.Double</a></p></li></ul>
<p>The following complex types are also blittable types: 
<ul>
<li>
<p>One-dimensional arrays of blittable types, such as an array of integers. However, a type that contains a variable array of blittable types is not itself blittable.</p>
<li>
<p>Formatted value types that contain only blittable types (and classes if they are marshaled as formatted types). For more information about formatted value types, see <a href="https://msdn.microsoft.com/en-us/library/0t2cwe11.aspx">Default Marshaling for Value Types</a>.</p></li></ul>
<p>Object references are not blittable. This includes an array of references to objects that are blittable by themselves. For example, you can define a structure that is blittable, but you cannot define a blittable type that contains an array of references to those structures. 
<p>As an optimization, arrays of blittable types and classes that contain only blittable members are <a href="https://msdn.microsoft.com/en-us/library/23acw07k.aspx">pinned</a> instead of copied during marshaling. These types can appear to be marshaled as In/Out parameters when the caller and callee are in the same apartment. However, these types are actually marshaled as In parameters, and you must apply the <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.inattribute.aspx">InAttribute</a> and <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.outattribute.aspx">OutAttribute</a> attributes if you want to marshal the argument as an In/Out parameter. 
<p>Some managed data types require a different representation in an unmanaged environment. These non-blittable data types must be converted into a form that can be marshaled. For example, managed strings are non-blittable types because they must be converted into string objects before they can be marshaled. 
<p>The following table lists non-blittable types from the <a href="https://msdn.microsoft.com/en-us/library/system.aspx">System</a> namespace. <a href="https://msdn.microsoft.com/en-us/library/7esfatk4.aspx">Delegates</a>, which are data structures that refer to a static method or to a class instance, are also non-blittable. 
<p>Non-blittable type 
<p>Description 
<p><a href="https://msdn.microsoft.com/en-us/library/z6cfh6e6.aspx">System.Array</a> 
<p>Converts to a C-style array or a SAFEARRAY. 
<p><a href="https://msdn.microsoft.com/en-us/library/t2t3725f.aspx">System.Boolean</a> 
<p>Converts to a 1, 2, or 4-byte value with true as 1 or -1. 
<p><a href="https://msdn.microsoft.com/en-us/library/6tyybbf2.aspx">System.Char</a> 
<p>Converts to a Unicode or ANSI character. 
<p><a href="https://msdn.microsoft.com/en-us/library/s0968xy8.aspx">System.Class</a> 
<p>Converts to a class interface. 
<p><a href="https://msdn.microsoft.com/en-us/library/2x07fbw8.aspx">System.Object</a> 
<p>Converts to a variant or an interface. 
<p><a href="https://msdn.microsoft.com/en-us/library/z6cfh6e6.aspx">System.Mdarray</a> 
<p>Converts to a C-style array or a SAFEARRAY. 
<p><a href="https://msdn.microsoft.com/en-us/library/s9ts558h.aspx">System.String</a> 
<p>Converts to a string terminating in a null reference or to a BSTR. 
<p><a href="https://msdn.microsoft.com/en-us/library/0t2cwe11.aspx">System.Valuetype</a> 
<p>Converts to a structure with a fixed memory layout. 
<p><a href="https://msdn.microsoft.com/en-us/library/z6cfh6e6.aspx">System.Szarray</a> 
<p>Converts to a C-style array or a SAFEARRAY. 
<p>Class and object types are supported only by COM interop. For corresponding types in Visual Basic 2005, C#, and C++, see the <a href="https://msdn.microsoft.com/en-us/library/hfa3fa08.aspx">.NET Framework Class Library Overview</a>. 
<p>See Also 
<hr>

<p><a></a>
<h6>Other Resources</h6>
<p><a href="https://msdn.microsoft.com/en-us/library/zah6xy75.aspx">Default Marshaling Behavior</a> 
<p>&nbsp; <p>Pasted from <a title="https://msdn.microsoft.com/en-us/library/75dwhxf7.aspx" href="https://msdn.microsoft.com/en-us/library/75dwhxf7.aspx">https://msdn.microsoft.com/en-us/library/75dwhxf7.aspx</a></p></blockquote>
<p>OutAttribute 
<blockquote>
<p>The OutAttribute is optional. The attribute is supported for COM interop and platform invoke only. In the absence of explicit settings, the interop marshaler assumes rules based on the parameter type, whether the parameter is passed by reference or by value, and whether the type is blittable or non-blittable. For example, the <a href="https://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx">StringBuilder</a> class is always assumed to be In/Out and an array of strings passed by value is assumed to be In. 
<p>Out-only behavior is never a default marshaling behavior for parameters. You can apply the OutAttribute to value and reference types passed by reference to change In/Out behavior to Out-only behavior, which is equivalent to using the out keyword in C#. For example, arrays passed by value, marshaled as In-only parameters by default, can be changed to Out-only. However, the behavior does not always provide expected semantics when the types include all-blittable elements or fields because the interop marshaler uses pinning. If you do not care about passing data into the callee, Out-only marshaling can provide better performance for non-blittable types. 
<p>Combining the <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.inattribute.aspx">InAttribute</a> and OutAttribute is particularly useful when applied to arrays and formatted, non-blittable types. Callers see the changes a callee makes to these types only when you apply both attributes. Since these types require copying during marshaling, you can use <a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.inattribute.aspx">InAttribute</a> and OutAttribute to reduce unnecessary copies. 
<p>Pasted from &lt;<a href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.outattribute.aspx">https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.outattribute.aspx</a>&gt; </p></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>MVVM criticism</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/mvvm-criticism</link>
      <pubDate>Mon, 26 Apr 2010 09:58:55 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/04/26/mvvm-criticism/</guid>
      <description><![CDATA[Most literature i've been reading raves about MVVM, but in the spirit of a critical pedagogy, it's...]]></description>
      <content:encoded><![CDATA[<p>Most literature i've been reading raves about MVVM, but in the spirit of a critical pedagogy, <a href="https://forums.silverlight.net/forums/t/159237.aspx">it's good to remember MVVM can't serve as a panacea</a>.  <p>Alexander Biskop's venting session scrutinizes, as opposed to only evangelizing, the pattern à la mode.&nbsp; Biskop's primary charge is aligned with the MVVM sample applications i've seen thus far-they are usually some variation of a form-based record editing application. <blockquote> <p><em>"MVVM is an *awesome* template for record editing applications and simple projects, but </em><em>I would *never* recommend it for a large-scale application."</em></p></blockquote> <p>In the remainder of the forum based rant, Biskop cites and discuses points from the <a href="https://en.wikipedia.org/wiki/MVVM">MVVM article on Wikipedia</a>. <blockquote> <p><em>"There are currently three main areas of criticism regarding the MVVM pattern.</em>  <p><em>The first is that MVVM currently lacks standardization from Microsoft both in implementation and in toolsets. For example, the community has some lack of clarity about where and whether to implement View logic in the View layer or the ViewModel. Given that the MVVM pattern is still relatively new, and that new tool-sets, walkthroughs, or patterns, such as </em><a href="https://wpfonyx.codeplex.com/"><em>Onyx</em></a><em>, the </em><a href="https://wpf.codeplex.com/"><em>Microsoft WPF Toolkit</em></a><em>, </em><a href="https://www.caliburnproject.org/"><em>Caliburn</em></a><em>, </em><a href="https://www.galasoft.ch/mvvm/getstarted/"><em>MVVM Light Toolkit</em></a><em>, and </em><a href="https://www.calciumsdk.net"><em>Calcium</em></a><em> are being released, this problem may be solved over time. Microsoft has announced in discussion boards that </em><a href="https://wpf.codeplex.com/Wiki/View.aspx?title=WPF%20Model-View-ViewModel%20Toolkit"><em>the MVVM template pattern will be released in Visual Studio 2010</em></a><em>.</em>  <p><em>The second comes from MVVM creator John Gossman himself <sup><a href="https://en.wikipedia.org/#cite_note-7">[8]</a></sup>, who points out that the overhead in implementing MVVM is "overkill" for simple UI operations. He also states that for larger applications, generalizing the View layer becomes more difficult. Moreover, he illustrates that data binding, if not managed well, can result in considerable memory consumption in an application.</em>  <p><em>The third is that the exercise in creating large numbers of data bindings to the ViewModel results in duplicate code and maintenance problems<sup><a href="https://en.wikipedia.org/#cite_note-8">[9]</a></sup>. Additionally, because of the nature of the semantics of data bindings, critics suggest that the ViewModel does not directly describe the View."</em></p></blockquote> <p>Biskop's post reminded me to examine when and where MVVM should and shouldn't be used.&nbsp; Thanks, Mr. Biskop!</p>]]></content:encoded>
    </item>
    <item>
      <title>"MVVM - It's Not Kool-Aid" by Jesse Liberty</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/mvvm-its-not-kool-aid-by-jesse-liberty</link>
      <pubDate>Wed, 21 Apr 2010 10:31:00 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/04/21/mvvm-its-not-kool-aid-by-jesse-liberty/</guid>
      <description><![CDATA[Jesse Liberty's blog post titled "MVVM - It's Not Kool-Aid" illustrates succinctly a key refrain in...]]></description>
      <content:encoded><![CDATA[<P><A title="MVVM - It's Not Kool-Aid" href="https://blogs.silverlight.net/blogs/jesseliberty/archive/2010/01/28/mvvm-it-s-not-kool-aid.aspx" mce_href="https://blogs.silverlight.net/blogs/jesseliberty/archive/2010/01/28/mvvm-it-s-not-kool-aid.aspx">Jesse Liberty's blog post titled "MVVM - It's Not Kool-Aid"</A> illustrates succinctly a key refrain in the MVVM mantra.</P>
<BLOCKQUOTE>
<TABLE border=0 cellSpacing=0 cellPadding=2>
<TBODY>
<TR>
<TD><A href="https://blogs.silverlight.net/blogs/jesseliberty/MVVMSketch_3097E6FC.jpg" mce_href="https://blogs.silverlight.net/blogs/jesseliberty/MVVMSketch_3097E6FC.jpg"><IMG title=MVVMSketch border=0 alt=MVVMSketch src="https://blogs.silverlight.net/blogs/jesseliberty/MVVMSketch_thumb_302BB407.jpg" mce_src="https://blogs.silverlight.net/blogs/jesseliberty/MVVMSketch_thumb_302BB407.jpg"></A></TD>
<TD>
<P><EM>"<STRONG>Core Concept #2 Don't Look Up.</STRONG><BR>We tend to conceptualize the View (User Interface objects) at the top, the ViewModel (objects that provide the UI with its data and behaviors) in the middle and the model (often the persistence layer) at the bottom. The View can know about the ViewModel, the ViewModel about the Model, and the Model, like the cheese, stands alone."</EM> </P></TD></TR></TBODY></TABLE></BLOCKQUOTE>
<P>There is intentionally/explicitly <STRONG><EM>NOT</EM></STRONG> a red arrow from the <STRONG>View</STRONG> all the way down to the <STRONG>Model</STRONG> .&nbsp; Also of note is the fact that the arrows are not bidirectional-this underscores the fact that the View knows about the ViewModel and that the ViewModel knows about the Model, but <EM><STRONG>NOT</STRONG> </EM>any combination of<EM>&nbsp;</EM>the reverse.&nbsp; When a field in the ViewModel has been bound to something in the View, the ViewModel is not specifically telling that particular View that the field has changed; instead, generically, the ViewModel's field is changed and the ViewModel notifies subscribers of the change.</P>]]></content:encoded>
    </item>
    <item>
      <title>"Advanced MVVM" by Josh Smith</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/advanced-mvvm-by-josh-smith</link>
      <pubDate>Tue, 20 Apr 2010 14:41:00 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/04/20/advanced-mvvm-by-josh-smith/</guid>
      <description><![CDATA[davihard's "Cliffs Notes" of "Advanced MVVM" 
WPF Review/MVVM Intro 
XAML based layout flow and...]]></description>
      <content:encoded><![CDATA[<P>davihard's "Cliffs Notes" of <A href="https://joshsmithonwpf.wordpress.com/advanced-mvvm/" mce_href="https://joshsmithonwpf.wordpress.com/advanced-mvvm/">"Advanced MVVM"</A> 
<P><STRONG>WPF Review/MVVM Intro</STRONG> 
<P>XAML based layout flow and user interaction event definition; they do some nice painting and rendering performance for you. 
<BLOCKQUOTE>
<P><EM>"It was once commonly said that all roads lead to Rome. Today all WPF and Silverlight best practices lead to the Model-View-ViewModel design pattern."</EM></P></BLOCKQUOTE>
<P>This is great because it alludes to the fact that it's not just Silverlight that does all this XAML sugary goodness, it was WPF first, and now Silverlight. When asked if Silverlight is the death of WPF, most Silverlight evangelists chime in with, "(paraphrase:) Silverlight's the best thing to happen to WPF; Silverlight doesn't kill WPF, it brings a technology that's been in the industry now for a few years back under a fresh spotlight." 
<BLOCKQUOTE>
<P><EM>"The fundamental mechanisms involved in creating applications based on MVVM are data binding and commands. ViewModel objects expose properties to which Views are bound, including properties that return command objects. When the properties of a ViewModel change, the Views bound to that ViewModel receive a notification when the ViewModel raises its PropertyChanged event (which is the sole member of the INotifyPropertyChanged interface). The data binding system will automatically get the new value from the modified property and update the bound properties in the View. Similarly, changes made to the data in the View are pushed back to the ViewModel via bindings. When the user clicks on a button whose Command property is bound to a command exposed by a ViewModel, that command executes and allows the ViewModel to act on the user's interaction. If the ViewModel needs to expose a modifiable collection of objects to a View, the ViewModel can use ObservableCollection&lt;T&gt; to get collection change notifications for free (which the binding system knows how to work with). It's all very simple to implement because data bindings do the grunt work of moving bound data values around when necessary.</EM> 
<P><EM>The magic glue that ties Views and ViewModels together is, more often than not, the DataContext property inherited by all visual elements. When a View is created, its DataContext can be set to a ViewModel so that all elements in the View can easily bind to it. This is not a hard and fast rule, though. Some people prefer to put their ViewModels into resource dictionaries and bind to them via resource references. That technique can make it easier to work with Views in Microsoft's Expression Blend visual design tool."</EM></P></BLOCKQUOTE>
<P><STRONG>Best practices for designing Views</STRONG> 
<BLOCKQUOTE>
<P><EM>"Advanced MVVM" mentions the </EM><A href="https://moleproject.com/" mce_href="https://moleproject.com/"><EM>Mole visualizer</EM></A><EM> which is nice for inspecting the "visual tree" of a piece of UI.</EM> 
<P><EM>"In non-trivial user interfaces there are various bits of code required to make a View work properly. If that code relies on UI elements, resources, or anything else belonging to the realm of the user interface, I see no reason not to put that code into the View's code-behind."</EM></P></BLOCKQUOTE>
<P><STRONG>Best practices for designing ViewModels</STRONG> 
<P>Each View class should have a corresponding ViewModel class; the View's DataContext is set to its ViewModel object. Views should reference ViewModels from a separate project/assembly. The MVVM Foundation library on CodePlex <EM>"contains several useful classes for developers writing ViewModels. The MVVM Foundation classes used in this application are ObservableObject and RelayCommand."</EM> 
<P>Rather creating and assigning the ViewModel in the View code-behind, XAML can also handle declaration and assignment for the DataContext/ViewModel. 
<DIV class=csharpcode><PRE class=alt><SPAN class=lnum>   1:  </SPAN><SPAN class=kwrd>&lt;</SPAN><SPAN class=html>UserControl.DataContext</SPAN><SPAN class=kwrd>&gt;</SPAN>    </PRE><PRE><SPAN class=lnum>   2:  </SPAN>    <SPAN class=kwrd>&lt;</SPAN><SPAN class=html>viewModels:FooViewModel</SPAN><SPAN class=kwrd>/&gt;</SPAN></PRE><PRE class=alt><SPAN class=lnum>   3:  </SPAN><SPAN class=kwrd>&lt;/</SPAN><SPAN class=html>UserControl.DataContext</SPAN><SPAN class=kwrd>&gt;</SPAN></PRE><PRE>&nbsp;</PRE></DIV>
<STYLE type=text/css>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</STYLE>

<BLOCKQUOTE>
<P><EM>"WPF requires collection change notifications to occur on the UI thread."</EM></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P><EM>"DataTriggers in the View layer bind to that property in order to turn on/off visual effects for the bubble group under the cursor. You can see how that works by looking at the Style whose x:Key is 'BubbleGridStyle' in the BubbleViewResources.xaml file, if you re interested."</EM></P></BLOCKQUOTE>
<P><STRONG>Deciding on what state and logic belongs in Views versus ViewModels</STRONG> 
<BLOCKQUOTE>
<P><EM>"[L]imiting your Views to only the code that is specific to their events, elements, resources, etc. enables you to keep the various application layers clear, logical, and loosely coupled. Separation of concerns is a worthwhile goal when writing software."</EM></P></BLOCKQUOTE>
<P><STRONG>Coordinating animated transitions and unlimited undo between the ViewModel and View</STRONG> 
<BLOCKQUOTE>
<P><EM>"When pending tasks are made available, three methods work together to process them and perform animated transitions. These methods are in the code-behind of [the View]"</EM></P></BLOCKQUOTE>
<P>The <A href="https://msdn.microsoft.com/en-us/magazine/dd882510.aspx" mce_href="https://msdn.microsoft.com/en-us/magazine/dd882510.aspx">Unit of Work pattern</A> is an elegant solution for animation precipitating input timing issues; this task-based architecture lends itself well to animated transitions between tasks and ease of unlimited undo functionality. </P>]]></content:encoded>
    </item>
    <item>
      <title>FlowDirection in WPF/Silverlight</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/flowdirection-in-wpfsilverlight</link>
      <pubDate>Wed, 14 Apr 2010 13:07:00 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/04/14/flowdirection-in-wpfsilverlight/</guid>
      <description><![CDATA[A colleague of mine illustrated how easy a majority of our work would be in switching our...]]></description>
      <content:encoded><![CDATA[<P>A colleague of mine illustrated how easy a majority of our work would be in switching our Silverlight application to a bidirectional context layout flow (RTL, rather than LTR). 
<BLOCKQUOTE>
<P>Path seems to flip X coordinate space automatically based on FlowDirection. at least in WPF 3.5. (I didn't have SL4 handy.) There's no reason I know of for SL4 runtime to break compat with WPF on this, so I expect SL4 is the same. 
<P>This XAML: 
<P>&lt;Grid FlowDirection="LeftToRight"&gt; 
<P>&lt;Button Margin="100,0,0,0" Content="Has 'Before' Margin"/&gt; 
<P>&lt;Path Stroke="Black" HorizontalAlignment="Left" Data="M58,47 L34,85 L59,120 L58,93 L115,90 L113,72 L59,70 z"/&gt; 
<P>&lt;/Grid&gt; 
<P>Yields a button with left-side margin, and path rendered as I expected (it's an arrow pointing left.) 
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image002_2.jpg" original-url="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image002_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image002_2.jpg"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image002 border=0 alt=clip_image002 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image002_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image002_thumb.jpg" width=244 height=231 mce_src="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image002_thumb.jpg"></A> 
<P>Change FlowDirection to RightToLeft and you get right-side margin, arrow pointing right. This is all correct for RTL. 
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image004_2.jpg" original-url="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image004_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image004_2.jpg"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image004 border=0 alt=clip_image004 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image004_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image004_thumb.jpg" width=244 height=232 mce_src="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/FlowDirectioninWPFSilverlight_C695/clip_image004_thumb.jpg"></A> 
<P>Wade</P></BLOCKQUOTE>]]></content:encoded>
    </item>
    <item>
      <title>bidirectional text support for text element truncation in HTML</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/bidirectional-text-support-for-text-element-truncation-in-html</link>
      <pubDate>Wed, 14 Apr 2010 12:40:00 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/04/14/bidirectional-text-support-for-text-element-truncation-in-html/</guid>
      <description><![CDATA[my investigation of bidirectional text was largely Silverlight based.&nbsp; i was removed, but...]]></description>
      <content:encoded><![CDATA[<p>my investigation of bidirectional text was largely Silverlight based.&nbsp; i was removed, but cognoscente and curious, about the HTML discussion in which other colleagues of my team were engaged.&nbsp; Hereafter exists the summary of Bob's investigation into dealing with bidirectional text behaviors. <blockquote> <h3>Behavior in a mixed environment for Bidi and non-Bidi text</h3> <p>When dealing with Bidi text, there are two settings to consider - text alignment and text direction, which are independent of each other. <h5> <p>Text Alignment </h5> <p>For text alignment, whether the text should be left or right aligned could depend on either the control's property, user or application language settings, language of the first character, or other settings; it can also be a combination of any of these. The inconsistency among Bidi text alignment is an Office wide issue, because <strong>there's no absolute correct behavior</strong>.&nbsp; It would be the best if options of choosing the alignment are provided to the user.&nbsp; When no options are available, each situation can be different, and using the <strong>surrounding layout as a reference </strong>would be a good starting point. <p>For example, in the screenshot below, user 1 is using Arabic version of Communicator while user 2 is using the English version.&nbsp; The message sent by user 1 is right aligned, while the message from user 2 is left aligned.&nbsp; In this case, since user 1 is in a right-to-left environment and the names were aligned to the right, it would probably have been easier for the user to read all the messages if they were all right aligned regardless of the language of the text.&nbsp; <p><img alt="RTLBehavior1.png" src="https://office/14/howto/Internationalization/Pictures/RTLBehavior1.png"> <h5>Text Direction</h5> <p>Text direction is more important than alignment, since it can affect the meaning of the text.&nbsp; In the worst case, text can become unreadable.&nbsp; There are three types of text direction, <strong>Left-To-Right</strong>, <strong>Context</strong>, and <strong>Right-To-Left</strong>.&nbsp; Below is an example from Outlook options.&nbsp; Some applications don't have support for Context text direction.&nbsp; <p><img alt="RTLBehavior2.png" src="https://office/14/howto/Internationalization/Pictures/RTLBehavior2.png"> <p>Again, don't confuse this with text alignment, as it's possible that each of these text direction can <strong>coexist </strong>with both left or right text alignment.&nbsp; When only Bidi (i.e. Arabic) text are entered by themselves, the text will stream from right to left regardless of the text direction setting, vice versa for or non-Bidi (i.e. English) text, this means the caret will always appear on the left when Arabic is being entered and on the right when English is entered.&nbsp; Here are the differences between each setting, which are also the expected behaviors. <h6><em>Left-To-Right </em></h6> <p>When HOME key is pressed, caret will always appear at the leftmost position.&nbsp; In certain applications like Outlook, when a neutral character (space, most punctuation, numerals, etc.) is entered, the caret will go to the right of current input sequence.&nbsp; If you are entering Arabic text, which goes from right to left, you'll see the caret jumps to the right when you enter a space, and then jumps back to left when you continue to type in Arabic. It's not a bug whether the caret jumps or not. <h6><em>Right-To-Left </em></h6> <p>When HOME key is pressed, caret will always appear at the rightmost position.&nbsp; In certain applications like Outlook, when a neutral character (space, most punctuations, numerals, etc.) is entered, the caret will go to the left of current input sequence.&nbsp; If you are entering English text, which goes from left to right, you'll see the caret jumps to the left when you enter a space, and then jumps back to right when you continue to type in English.&nbsp; Again it's not a bug whether the caret jumps or not. <h6><em>Context&nbsp; </em></h6> <p>Context text direction will behave just like Left-To-Right or Right-To-Left depending on the first non-neutral character entered. If the character is Bidi, then the text direction will become Right-To-Left for the control, and If the character is non-Bidi, then the text direction will become Left-To-Right for the control. <h4><a name="neutral"></a></h4> <h4>Behavior when mixing with neutral characters in Bidi environment</h4> <p>One of the common issues with Bidi environment is the unexpected behavior when mixing with neutral characters. Shown below are examples of forward slashes mixing with URL name containing Bidi text and ellipsis showing on the wrong side of the abbreviated English text.&nbsp; The first bug is more severe since it's hard for the user to read the URL. <p><img alt="RTLBehavior3.png" src="https://office/14/howto/Internationalization/Pictures/RTLBehavior3.png"><br>There are a few approaches to fix the issues. <p>First approach is changing the text direction property in the control if viable.&nbsp; For the first bug, Left-To-Right would be the best since we want the forward slashes in left to right direction regardless of the text surrounding them.&nbsp; For the second bug, Context would be the best since the ellipsis would show in the correct position for both English and Arabic text.&nbsp; <p>For cases like the second bug, which is a SharePoint page with HTML language and doesn't have the Context option, it's recommended to use the dir="ltr|rtl" HTML attribute to define embedded direction changes.&nbsp; For example, the below &lt;span dir="ltr"&gt; markup renders the "." string truncation ellipsis to the right -- "Product Ca.", even though it's within a "rtl" body. <p>&lt;body dir="rtl"&gt; <p>&nbsp;&nbsp;&nbsp; some text <p>&nbsp;&nbsp;&nbsp; &lt;span dir="ltr"&gt;Product Ca.&lt;/span&gt;<br>&lt;/body&gt; <p>Another approach, the last resort, the costly and dangerous way, don't do it unless you are absolutely sure that the text will always be non-Bidi text or always be Bidi text, is to use override characters.&nbsp; We can insert a <strong>Left-To-Right override (U+202D)</strong> character in the beginning of the English text to force the ellipsis to show on the right, vice versa for Bidi text using the <strong>Right-To-Left override </strong><strong>(U+202E) </strong>character.&nbsp;&nbsp;&nbsp; The override will affect not just the direction of the words, but individual letters as well.&nbsp; So "hello world" would become "dlrow olleh" if the Right-To-Left override character is inserted before the text. </blockquote>]]></content:encoded>
    </item>
    <item>
      <title>Nikhil Kothari at MIX'10 on MVVM/RIA/MEF</title>
      <link>https://docs.microsoft.com/archive/blogs/davihard/nikhil-kothari-at-mix10-on-mvvmriamef</link>
      <pubDate>Wed, 14 Apr 2010 09:37:00 GMT</pubDate>
      <dc:creator><![CDATA[davihard]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/davihard/2010/04/14/nikhil-kothari-at-mix10-on-mvvmriamef/</guid>
      <description><![CDATA[A couple of my colleagues, Erich and Nathan, have been trying to impress upon me the magnitude of...]]></description>
      <content:encoded><![CDATA[<P>A couple of my colleagues, Erich and Nathan, have been trying to impress upon me the magnitude of Expression Blend and MVVM and the glorious byproduct of having to write less code. Nikhil illustrates time and again in this presentation many of the points my colleagues have advocated.</P>
<P>Another colleague tells me to "check out <A href="https://live.visitmix.com/mix10/sessions/cl09" mce_href="https://live.visitmix.com/mix10/sessions/cl09">Nikhil Kothari's</A> MIX'10 presentation. . .there's some WCF RIA Services stuff as it works with MVVM. . .interesting."&nbsp; He was right: it's a beautiful bright future for RIAs; this illustrates one aspect of why and more importantly how.&nbsp; Developers will be able to rapidly deploy applications in an extremely well patterned manner.&nbsp; When i say developers, i'm referring to both developers internal to and external to Microsoft Corporation.&nbsp; This has direct implications on Silverlight for Windows Phone 7 <A href="https://www.techflash.com/seattle/2010/04/windows_phone_7_drops_series.html" mce_href="https://www.techflash.com/seattle/2010/04/windows_phone_7_drops_series.html"><STRIKE>Series</STRIKE></A> RIAs.&nbsp; I think that we're posing ourselves nicely for competition with iPhone.&nbsp; Personally, i'd kill to not have to write an iPhone App.&nbsp; i can't stand their developer experience; It's horrible.&nbsp; Between Expression Blend, MVVM, Visual Studio 2010, and a hundred other reasons, i'd love to pursue the possibility of switching from the iPhone. 
<P><STRONG>ViewModel, RIA Services, and MEF Vision</STRONG> 
<UL>
<UL>
<LI>Separating your UI from your interesting Application Logic.</LI></UL>
<UL>
<LI>Facilitate Designers and Developers working together.</LI></UL>
<UL>
<LI>Encapsulates the state and operations of your application.</LI></UL>
<UL>
<LI>Improve maintainability</LI></UL>
<UL>
<LI>Facilitate testability</LI></UL></UL>
<P><SPAN style="COLOR: red">xmlns:local</SPAN><SPAN style="COLOR: blue">=</SPAN><SPAN style="COLOR: black">"</SPAN><SPAN style="COLOR: blue">clr-namespace:SDKSample</SPAN><SPAN style="COLOR: black">"</SPAN><BR>&nbsp;</P>
<P><A href="https://blogs.msdn.com/unnir/archive/2009/07/12/introducing-sample-data-for-developers.aspx">https://blogs.msdn.com/unnir/archive/2009/07/12/introducing-sample-data-for-developers.aspx</A></P>
<P><STRONG>View</STRONG>: Presentation logic--XAML, UI Logic in the code-behind. In the XAML you define a <A href="https://karlshifflett.wordpress.com/2009/10/21/visual-studio-2010-beta2-sample-data-project-templates/" mce_href="https://karlshifflett.wordpress.com/2009/10/21/visual-studio-2010-beta2-sample-data-project-templates/">d:DataContext</A> (the design time data context) to the appropriate Type attribute value (and a flag for IsDesignTimeCreatable) lets the IDE know about what types of Properties and Methods so that the data binding picker works. 
<P>The&nbsp;IDE properties pane for the UI Element allows you to set the ItemSource;&nbsp;the presented options are Properties off of the d:DataContext Type definition. An alternative to handling Command Operation to Method Invocation mappings, by configuring Methods in the ViewModel using ICommandProperties Attributes, is to define such mappings in the Page Resources definitions in the View XAML. Once you have those definitions in the View XAML, the IDE allows the Page resource to apply Command operations as a resource in the Properties pane of the IDE. The CommandParameters attribute in the Properties pane can be bound to the another UI element, allowing the Command (Method Invoke) to take in parameters. 
<P><STRONG>View Model</STRONG>: App State, Operations, Change Notifications. Any class that implements INotifyPropertyChanged can serve as a View Model, Nikhil demonstrated that he uses <A href="https://msdn.microsoft.com/en-us/magazine/dd419663.aspx#id0090051" mce_href="https://msdn.microsoft.com/en-us/magazine/dd419663.aspx#id0090051">ViewModelBase</A>. An Instance of the View Model serves as the DataContext for your UI/View, (hooked up immediately following initialization of the View); this is more or less a refactoring, more like obsolescence, of the code-behind file for the View. 
<BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/davihard/WindowsLiveWriter/NikhilKotharisMIX10WCFRIAMVVMpresentatio_EEE2/clip_image001_2.png" original-url="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/NikhilKotharisMIX10WCFRIAMVVMpresentatio_EEE2/clip_image001_2.png" mce_href="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/NikhilKotharisMIX10WCFRIAMVVMpresentatio_EEE2/clip_image001_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=clip_image001 border=0 alt=clip_image001 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/davihard/WindowsLiveWriter/NikhilKotharisMIX10WCFRIAMVVMpresentatio_EEE2/clip_image001_thumb.png" original-url="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/NikhilKotharisMIX10WCFRIAMVVMpresentatio_EEE2/clip_image001_thumb.png" width=244 height=160 mce_src="https://blogs.msdn.com/blogfiles/davihard/WindowsLiveWriter/NikhilKotharisMIX10WCFRIAMVVMpresentatio_EEE2/clip_image001_thumb.png"></A></P></BLOCKQUOTE>
<BLOCKQUOTE>
<P>States and Operations map to the ViewModel Class Methods and Properties.</P></BLOCKQUOTE>
<P><STRONG>Data Model and MEF</STRONG>: Services, Business Rules. RIA Services detects from your Data Model Class Attribute definitions for, optionally custom, validation rules. This partial, server side shared code, gets propagated to the client along with metadata intent for the validation rules. The Model Entity Framework handles propagating that server side validation rule to the client generated code stubs. Database field constraints in the schema (VARCHAR(10)) can cause these validation rules to show up in the client stub also. This constitutes client side validation. You're going to add other validations that can only be run server side. The ability to explicitly configure CRUD invocations using Attributes in the client illustrates how you can separate client to server communication logic from contextually named methods for readability. On EITHER the server side OR the client side partial classes allow individual for deviations/customizations of the Entity depending client vs. server side distinction subtleties. Entity State can be bound to a UI Element to indicate entity state in a visual indicator/decorator can be done with little code and can be done in the IDE rather than in boring ugly, and tightly coupled source code. </P>]]></content:encoded>
    </item>
  </channel>
</rss>