<?xml version="1.0" encoding="UTF-8"?>
	
 
		<rss version="2.0">
			<channel>
			<ttl>5</ttl>
				<title>ppedv Blog</title>
				<link>http://blogs.ppedv.de</link>
				<description>update by ppedv ***** Team Blog</description>
				<lastbuildDate>Tue, 14 Apr 2026 08:01:57 GMT</lastbuildDate>

				<image>
				    <url>http://blogs.ppedv.de/images/logo2.gif</url>
				    <title>ppedv Blog</title>
				    <link>http://www.ppedv.de</link>
				</image>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    aneinandergereiht: POCO nach XML oder JSON in Silverlight
			</title>
			<description>&lt;p&gt;Aktuell bin ich wieder mal in einer Silverlight Schulung. Obwohl ich das Thema wirklich von A-Z kenne, entdecke ich immer wieder Neues. Dieses mal im ausgezeichneten Silverlight 4 Buch von Thomas Claudius Huber (erschienen bei Galileo). Thomas macht auf Seite 833 etwas, was ich so nicht tun w&#252;rde. Er nimmt einen DataContractJsonSerializer um einen JSon R&#252;ckgabe eines REST Services nach POCO zu wandeln. Interessante Idee, aber nicht im Sinne des Erfinders. Daf&#252;r waren wohl eher die Klassen JSoneArray oder JSonObject gedacht. Nicht desto trotz – einen Blick wert. Aber ich m&#246;chte erst mal die Basics aufgreifen. Ein Objekt, hier z.B. Person muss serialsiert werden um z.B. im Isolated Storage dauerhaft gespeichert zu werden.&lt;/p&gt;  &lt;p&gt;Zun&#228;chst einmal ein Prototyp der einfach das Objekt serialisiert und im UI ausgibt. Es m&#252;ssen drei Namensr&#228;ume eingebunden werden&lt;/p&gt;  &lt;p&gt;System.IO   &lt;br /&gt;System.Runtime.Serialization    &lt;br /&gt;System.Text&lt;/p&gt;  &lt;p&gt;Dann wird der klassische DataContractSerializer angeworfen der XML erzeugen wird. Am Ende wird das erzeugte Byte Array in UTF Encodiert um die Anzeige zu realisieren.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; p &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person
&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; ms &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; MemoryStream()
&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; ser &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; DataContractSerializer(&lt;span style=&quot;color: blue&quot;&gt;GetType&lt;/span&gt;(person))
ser.WriteObject(ms, p)
&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; array() &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Byte&lt;/span&gt; = ms.ToArray()
ms.Close()
TextBlock1.Text = Encoding.UTF8.GetString(array, 0, array.Length)
&lt;a href=&quot;http://blogs.ppedv.de/data/Aufge_12932/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/Aufge_12932/image_thumb.png&quot; width=&quot;351&quot; height=&quot;101&quot; /&gt;&lt;/a&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Alternativ gibt es auch noch ein Klasse XMLSerializer mit den Methoden Serialize und Deserialize auf die ich hier aktuell nicht eingehen m&#246;chte. Will man Json erzeugen muss man einen anderen Serialisierer nehmen. Der wiederum findet sich im Namensraum System.Runtime.Serialization.Json. Dann muss nur eine Zeile getauscht werden.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; ser &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; DataContractJsonSerializer(&lt;span style=&quot;color: blue&quot;&gt;GetType&lt;/span&gt;(person))
&lt;a href=&quot;http://blogs.ppedv.de/data/Aufge_12932/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/Aufge_12932/image_thumb_1.png&quot; width=&quot;353&quot; height=&quot;69&quot; /&gt;&lt;/a&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Deutlich zu erkennen ist, das die Datenmenge bei Json im Vergleich zu XML deutlich geringer ist. Aus diesem Grund sehe ich auch SOAP als noch viel schwer gewichtigeres XML Format sehr kritisch und sehe die Zukunft eher in REST basierten Ans&#228;tzen wie das moderne ODATA.&lt;/p&gt;

&lt;p&gt;Wie kommen nun die Daten wieder zur&#252;ck? Der sehr gut verk&#252;rzte Code.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; p &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person
&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; ser &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; DataContractJsonSerializer(&lt;span style=&quot;color: blue&quot;&gt;GetType&lt;/span&gt;(person))
&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; ms &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; MemoryStream(Encoding.UTF8.GetBytes(TextBlock1.Text))
p = ser.ReadObject(ms)
ms.Close()
    &lt;/pre&gt;
&lt;/div&gt;
Im Grund nichts Neues. Das gibts in .NET schon eine ganze Weile (seit 3.5).

</description>
			<link>http://blogs.ppedv.de/hannesp/archive/aneinandergereiht-POCO-nach-XML-oder-JSON-in-Silverlight</link>
			<author>Hannes Preishuber</author>
			<pubDate>Wed, 15 Sep 2010 21:54:48 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			.Net</category><category>Silverlight</category><category>VB</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Asynchrone Validierung von Benutzereingaben mit INotifydataErrorInfo
			</title>
			<description>&lt;p&gt;Manchmal ist die Wahl wirklich die Qual. In Silverlight 4 gibt es mindestens vier mir bekannte M&#246;glichkeiten in Dialogen Eingaben des Benutzers zu pr&#252;fen. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;per Exception (von Anbegin)&lt;/li&gt;    &lt;li&gt;per Eigenschaftsattribut (mit RIA Services eingef&#252;hrt)&lt;/li&gt;    &lt;li&gt;IDataErrorInfo&lt;/li&gt;    &lt;li&gt;INotifyDataErrorInfo (neu in SL4)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Mit dem letzteren werden wir uns hier nun besch&#228;ftigen. Wenn eine Datenklasse das Interface INotifyDataerrorInfo implementiert kann von andere Stelle im Code ein Fehler Event aufgerufen werden. Im Unterschied zu IDataErrorInfo kann dann ein Property auch mehrere Fehler besitzen (ob es sich dar&#252;ber freuen wird?) was den Code nicht einfacher macht.&lt;/p&gt;  &lt;p&gt;Dar&#252;ber hinaus kann man direkt das ErrorsChanged Event aufrufen und so auch asynchron validieren.&lt;/p&gt;  &lt;p&gt;Mein folgendes Silverlight Beispiel ist Teil einer kleinen APP die die UST ID auf G&#252;ltigkeit beim zust&#228;ndigen Finanzamt pr&#252;ft. Das hei&#223;t es werden Daten an einen Webservice geschickt und dieser antwortet f&#252;r jedes Feld ob dies g&#252;ltig oder ung&#252;ltig ist. Der Benutzer muss dann die Eingabe korrigieren oder seinem Gesch&#228;ftspartner mitteilen das eine UST freie Lieferung nicht m&#246;glich ist.&lt;/p&gt;  &lt;p&gt;Dazu erstellte ich mir einen Datenklasse die sp&#228;ter dann auch an das UI per Binding gebunden wird. Die Attribute dienen ebenfalls der Eingabe validierung bzw dem Layout des Dialoges. Dort kommen Label Steuerelemente zum Einsatz die dann z.B. Display Name verwenden.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt; ustidFirma
    &lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; INotifyDataErrorInfo
    &amp;lt;Required()&amp;gt;
    &amp;lt;Display(Name:=&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Ustid&amp;quot;&lt;/span&gt;)&amp;gt;
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; ustid &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;
    &amp;lt;Required()&amp;gt;
    &amp;lt;Display(Name:=&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Firma&amp;quot;&lt;/span&gt;)&amp;gt;
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; firma &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Wesentlicher ist aber die Logik. Eine exemplarische Implementierung nachdem das Interface InotifyDataErrorInfo implementiert wird. Es werden zwei Methoden ben&#246;tigt. Die Eigenschaft HasErrors definiert ob grundlegend Fehler vorhanden sind. Die Funktion GetErrors gibt eine Liste der Fehler zur&#252;ck die f&#252;r einen bestimmte Eigenschaft, z.B. ustid, vorliegen. Das ErrorsChanged Event dient dazu die UI &#252;ber &#196;nderungen zu informieren.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Imports&lt;/span&gt; System.ComponentModel
&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt; test1
    &lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; INotifyDataErrorInfo
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Event&lt;/span&gt; ErrorsChanged(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Object&lt;/span&gt;, &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.ComponentModel.DataErrorsChangedEventArgs) &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; System.ComponentModel.INotifyDataErrorInfo.ErrorsChanged
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt; GetErrors(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; propertyName &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;) &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Collections.IEnumerable &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; System.ComponentModel.INotifyDataErrorInfo.GetErrors
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;ReadOnly&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; HasErrors &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Boolean&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; System.ComponentModel.INotifyDataErrorInfo.HasErrors
        &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;



&lt;p&gt;Zur&#252;ck zu meinem Beispiel UST Pr&#252;fung. Um die Fehler zu verwalten erstelle ich mir eine Liste f&#252;r die Attribute und deren Fehler.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt; &lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; errors &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; Dictionary(Of &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;, List(Of &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;))&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;HasErrors liefert dann zur&#252;ck ob in der Liste was drin steht.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;ReadOnly&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; HasErrors &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Boolean&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; System.ComponentModel.INotifyDataErrorInfo.HasErrors
 &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
     &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; errors.&lt;span style=&quot;color: blue&quot;&gt;Count&lt;/span&gt; &amp;gt; 0
 &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Die Funktion GetErrors, liefert die Fehlerliste f&#252;r das ausgew&#228;hlte Property.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt; GetErrors(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; propertyName &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;) &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Collections.IEnumerable &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; System.ComponentModel.INotifyDataErrorInfo.GetErrors
  &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt; errors.ContainsKey(propertyName) &lt;span style=&quot;color: blue&quot;&gt;Then&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; errors(propertyName)
  &lt;span style=&quot;color: blue&quot;&gt;Else&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Nothing&lt;/span&gt;
  &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;





&lt;p&gt;Eine manuell von mir erstellte Hilfsfunktion RaisErrorsChanged f&#252;llt die Fehlerliste und wirft dann das Event um im&amp;#160; Userinterface die Bindung zu aktualisieren.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; RaiseErrorsChanged(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; propertyName &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; Fehler &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;)
 &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Not&lt;/span&gt; errors.ContainsKey(propertyName) &lt;span style=&quot;color: blue&quot;&gt;Then&lt;/span&gt; errors(propertyName) = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; List(Of &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;)()
   errors(propertyName).Add(Fehler)
   &lt;span style=&quot;color: blue&quot;&gt;RaiseEvent&lt;/span&gt; ErrorsChanged(&lt;span style=&quot;color: blue&quot;&gt;Me&lt;/span&gt;,
   &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; DataErrorsChangedEventArgs(propertyName))
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Diese Sub wird von mir sozusagen per Hand aufgerufen. Die dazu geh&#246;rige Logik blende ich hier aus. Stellen Sie sich einfach einen Button vor der folgenden Code enth&#228;lt.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt; &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; ui &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; ustidFirma = LayoutRoot.DataContext
 ui.RaiseErrorsChanged(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ustid&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;USTID falsch&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Da es sich um eine gebundenes Objekt handelt kann ich jederzeit dieses Objekt zur&#252;ckholen und darauf dann die Methode RaiseErrorsChanged aufrufen. Im XAML Code sind daf&#252;r mehrere Dinge n&#246;tig. Der Namensraum (hier willk&#252;rlich &lt;em&gt;local&lt;/em&gt; genannt) um auf die Projektklassen zugreifen zu k&#246;nnen. Die deklarative Instanz mit dem frei gew&#228;hlten Namen &lt;em&gt;uf1&lt;/em&gt;.&amp;#160; Das Grid mit dem Namen Layoutroot ( Silverligth Default) bekommt dann dieses Objekt &lt;em&gt;uf1&lt;/em&gt; per Binding in seinem DataContext zugewiesen. Beachten Sie das dies notwendig ist, um im vorigen Codeblock damit agieren zu k&#246;nnen und das Label und die Textbox zu Binden. Dabei ist noch wesentlich das in der Bindung der Text Eigenschaft der Textbox das Binding Attribut ValidatesOnNotifyDataErrors gesetzt wird. Der folgende XAML Code ist stark gek&#252;rzt.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;xmlns:local=&amp;quot;clr-namespace:KoelnSL&amp;quot;
             &amp;gt;
    &amp;lt;UserControl.Resources&amp;gt;
        &amp;lt;local:ustidFirma x:Key=&amp;quot;uf1&amp;quot;/&amp;gt;&lt;br /&gt;.....
&amp;lt;Grid x:Name=&amp;quot;LayoutRoot&amp;quot; DataContext=&amp;quot;{Binding Source={StaticResource uf1}}&amp;quot;&amp;gt;
    .....     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;sdk&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Label&lt;/span&gt;  &lt;span style=&quot;color: red&quot;&gt;Target&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{Binding ElementName=txtmyID}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;sdk&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Label&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Target&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{Binding ElementName=txtID}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
 ..&lt;br /&gt;        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TextBox&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt; x:Name=&amp;quot;txtmyID&amp;quot;&lt;/span&gt;  &lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TextBox&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt; x:Name=&amp;quot;txtID&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{Binding ustid,Mode=TwoWay,ValidatesOnExceptions=true, &lt;br /&gt;NotifyOnValidationError=true,ValidatesOnNotifyDataErrors=True}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
      ..   &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;



&lt;p&gt;Der Vollst&#228;ndigkeit halber noch der fertige Dialog.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/AsynchroneValidierungvonBenutzereingaben_54C0/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/AsynchroneValidierungvonBenutzereingaben_54C0/image_thumb.png&quot; width=&quot;244&quot; height=&quot;192&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Asynchrone-Validierung-von-Benutzereingaben-mit-INotifydataErrorInfo</link>
			<author>Hannes Preishuber</author>
			<pubDate>Wed, 15 Sep 2010 06:57:51 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			.Net</category><category>Silverlight</category><category>VB</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    WebCam Bild schiessen und in Isolated Storage speichern
			</title>
			<description>&lt;p&gt;Man muss das Rad nicht immer neu erfinden. Im heutigen Beispiel kommt deshalb die &lt;a href=&quot;http://imagetools.codeplex.com/&quot;&gt;Library Imagetools&lt;/a&gt; zum Einsatz. Diese verwendet wiederum eine &lt;a href=&quot;http://www.icsharpcode.net/OpenSource/SharpZipLib/&quot;&gt;Zip Bibliothek&lt;/a&gt; und die wiederum … Und am Ende wird meine Silverlight Anwendung davon profitieren. Der “Use Case” ist eine Webcam im Browser. Der Benutzer kann ein Foto Schie&#223;en und dieses dauerhaft speichern.&lt;/p&gt;  &lt;p&gt;Den Part mit der Webcam halte ich hier sehr kurz. Zur Darstellung wird ein einfaches Rechteck (Rectangle1) verwendet.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt; &lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; Button1_Click(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Object, &lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Windows.RoutedEventArgs)
CaptureDeviceConfiguration.GetAvailableVideoCaptureDevices(0)
  &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; wb &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; VideoBrush
  wb.SetSource(cs)
  Rectangle1.Fill = wb
  &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt; CaptureDeviceConfiguration.AllowedDeviceAccess &lt;span style=&quot;color: blue&quot;&gt;Or&lt;/span&gt; CaptureDeviceConfiguration.RequestDeviceAccess &lt;span style=&quot;color: blue&quot;&gt;Then&lt;/span&gt;
     cs.Start()
  &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Wenn der Benutzer auf den Button dr&#252;ckt l&#228;uft das aktuelle Bild als Video. Ein zweiter Button dient dazu den Snapshot zu erstellen und das Bild zu speichern. Dazu m&#252;ssen die DLL’s ImageTools, ImageTools.IO.Png und ImageTools.Utils als Referenz eingebunden werden.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/dd970884ff08_11F98/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/dd970884ff08_11F98/image_thumb.png&quot; width=&quot;234&quot; height=&quot;135&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Frage Nummer eins ist, wie kommt man ans Bild? Und in welchem Format? Wer in den Dokus nachschl&#228;gt wird immer das Event CaptureImageAsync finden. Allerdings kann man auch direkt die Writeablebitmap Klasse verwenden um einen Screenshot eines beliebigen UIElements zu erstellen. Auch bei CaptureImageAsync erh&#228;lt man ein Obekt vom Typ WriteableBitmap. Braucht nur ein bisschen mehr Code. Ein weiterer Unterschied ist, das Writeablebitmap erst nach vollst&#228;ndigen Rendering den “Screenshot” erstellt. Mit CaptureImageasync&amp;#160; bekommt man den Screenshot schneller aber ohne Effekte ala Pixelshader. F&#252;r das Capturen von laufenden Videos braucht es aber noch ein wenig mehr. Dazu dient dann Videosink. Mehr dazu im &lt;a href=&quot;http://kodierer.blogspot.com/2010/06/push-and-pull-silverlight-webcam.html&quot;&gt;Blog&lt;/a&gt; von Rene Schulte.&lt;/p&gt;

&lt;p&gt;Im Silverlight Isolated Storage kann dann das Bild serialisiert gespeichert werden. Dazu wird aus dem WriteableBitmap zun&#228;chst ein Bild vom Typ PNG erzeugt. Ein netter Trick ist die Extension Methode ToImage, die der WriteableBitmap Klasse zugewiesen wird. (enthalten in Utils). Der PngEncoder erzeugt das korrekte PNG Format. Es liegen auch noch Encoder f&#252;r BMP, GIF und JPG bei.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; speichern_Click(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Object, &lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Windows.RoutedEventArgs) &lt;span style=&quot;color: blue&quot;&gt;Handles&lt;/span&gt; speichern.Click
 &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; wb &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; WriteableBitmap(Rectangle1, &lt;span style=&quot;color: blue&quot;&gt;Nothing&lt;/span&gt;)
 Image1.Source = wb
 &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; iso &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication
 &lt;span style=&quot;color: blue&quot;&gt;Using&lt;/span&gt; sr &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; IsolatedStorageFileStream = iso.OpenFile(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild&amp;quot;&lt;/span&gt; + &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;.Now.ToString(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;YYYMMDDHHmmss&amp;quot;&lt;/span&gt;) + &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;.png&amp;quot;&lt;/span&gt;, FileMode.OpenOrCreate)
   &lt;span style=&quot;color: blue&quot;&gt;Using&lt;/span&gt; bw &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; BinaryWriter = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; BinaryWriter(sr)
     &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; enc &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; PngEncoder = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; PngEncoder()
     &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; bytesImage &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Byte&lt;/span&gt;()
     &lt;span style=&quot;color: blue&quot;&gt;Using&lt;/span&gt; ms &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; MemoryStream = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; MemoryStream()
       &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; itImage = wb.ToImage()
       enc.Encode(itImage, ms)
       bytesImage = ms.ToArray()
       bw.Write(bytesImage)
     &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Using&lt;/span&gt;
  &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Using&lt;/span&gt;
 &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Using&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ziemlich cool ist, das die Bilder dann auch wirklich physikalisch auf der Festplatte rum liegen.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/dd970884ff08_11F98/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/dd970884ff08_11F98/image_thumb_1.png&quot; width=&quot;455&quot; height=&quot;162&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/WebCam-Bild-schiessen-und-in-Isolated-Storage-speichern</link>
			<author>Hannes Preishuber</author>
			<pubDate>Mon, 13 Sep 2010 21:10:30 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			.Net</category><category>VB</category><category>Silverlight</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Bild aus Explorer in die Silverlight Anwendung ziehen
			</title>
			<description>&lt;p&gt;“Nur kein Code ist guter Code”. Ein Zitat aus meinem Munde [Hannes Preishuber]. Entsprechend versuche ich immer mit minimalen Code mein Ziel zu erreichen. Vielleicht auch ein Grund warum ich mit Layern und MVxx recht sparsam umgehe.&lt;/p&gt;  &lt;p&gt;Deshalb bin ich auch ganz stolz auf mein Silverlight Bilder Drag &amp;amp; Drop Beispiel. F&#252;nf Zeilen Code. Weniger geht kaum. &lt;/p&gt;  &lt;p&gt;Drag&amp;amp; Drop ist eine Funktion in Silverlight 4 die sowohl f&#252;r OOB als auch in Browser Anwendungen funktioniert. Der Benutzer kann eine oder mehrere Dateien auf ein UIElement ziehen und dort fallen lassen. Daf&#252;r muss im UIElement das Attribut Allowdrop auf true gesetzt werden. Dann werden vier m&#246;gliche Events gefeuert.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;DragEnter&lt;/li&gt;    &lt;li&gt;DragOver&lt;/li&gt;    &lt;li&gt;DragLeaver&lt;/li&gt;    &lt;li&gt;Drop&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt; Wirklich wichtig ist nur das letzte Ereignis Drop. Die anderen Events k&#246;nnten verwendet werden um den Benutzer durch z.B. Farb&#228;nderungen sichtbar zu machen wohin er gerade dropped. In Meinem Beispiel m&#246;chte ich auf ein Image Element ein Bild ziehen k&#246;nnen. Da das Image ohne Bild nicht sichtbar ist, reagiert es auch auf keine Events und ist nicht absch&#228;tzbar wo die Grenzen sind. &#196;hnliches passiert meinen Silverlight Kurs Teilnehmer recht h&#228;ufig mit einem Rechteck. Das ist auch nur clickbar wenn es mit einer Brush gef&#252;llt ist.&lt;/p&gt;  &lt;p&gt;Um also den Rahmen zu zeichnen und das Drop Event zu bekommen, packe ich einfach das Image in ein Border der gef&#252;llt ist.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Border&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Left&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;211&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;75,0,0,0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Drop&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Image1_Drop&amp;quot;&lt;/span&gt;
   &lt;span style=&quot;color: red&quot;&gt;AllowDrop&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;True&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;202&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;Border.Background&amp;gt;
 &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;LinearGradientBrush&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;EndPoint&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0.5,1&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;StartPoint&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0.5,0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;GradientStop&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Black&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Offset&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;GradientStop&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;White&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Offset&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;/Border.Background&amp;gt;
&amp;lt;Image &lt;br /&gt;MouseLeftButtonDown=&amp;quot;Image1_MouseLeftButtonDown&amp;quot;
x:Name=&amp;quot;Image1&amp;quot; Stretch=&amp;quot;Fill&amp;quot; /&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Border&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Im Drop&amp;#160; Event bekommt man per e.Data die Liste der gedroppten Dateien. In meinem Fall nehme ich einfach die erste Datei im Index und gehe davon aus das es ein JPG oder PNG ist. Dann wird die Datei per Filestream ge&#246;ffnet und einem BitmapImage zugewiesen. Dieses wiederum ist die perfekte Quelle f&#252;r das Image Element.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; Image1_Drop(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Object, &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Windows.DragEventArgs)
  &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; fi &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; FileInfo = &lt;br /&gt;     e.Data.GetData(DataFormats.FileDrop)(0)
  &lt;span style=&quot;color: blue&quot;&gt;Using&lt;/span&gt; fs &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; FileStream = fi.OpenRead
     &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; bi &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; BitmapImage
     bi.SetSource(fs)
     Image1.Source = bi
  &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Using&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/BildausExplorerindieSilverlightAnwendung_11CDD/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/BildausExplorerindieSilverlightAnwendung_11CDD/image_thumb.png&quot; width=&quot;305&quot; height=&quot;191&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/BildausExplorerindieSilverlightAnwendung_11CDD/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/BildausExplorerindieSilverlightAnwendung_11CDD/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;191&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;wie gesagt alles Beispiele aus meiner &lt;a href=&quot;http://www.ppedv.de/schulung/kurse/silverlight.aspx&quot;&gt;Silverlight Schulung. Der n&#228;chste Termin ist in Leipzig&lt;/a&gt;.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Bild-aus-Explorer-in-die-Silverlight-Anwendung-ziehen</link>
			<author>Hannes Preishuber</author>
			<pubDate>Thu, 09 Sep 2010 20:34:00 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			.Net</category><category>Silverlight</category><category>VB</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Silverlight Zwischenablage
			</title>
			<description>&lt;p&gt;Ein weiteres (sehr kleines) Beispiel aus meiner Silverlight Trickkiste. Irgendwann muss ich das mal strukturieren und ein Silverlight Tutorial draus machen. Da irgendwann in weiter Zukunft liegt zun&#228;chst mal was kleines. Die Zwischenablage des Betriebssystems kann in Silverlight 4 gelesen und geschrieben werden. Leider kann der Benutzer aber nur reine Texte kopieren.&lt;/p&gt;  &lt;p&gt;Es gibt drei Methoden auf dem statischen Clipboard Objekt. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;ContainsText&lt;/li&gt;    &lt;li&gt;GetText &lt;/li&gt;    &lt;li&gt;SetText&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Name ist Programm.&lt;/p&gt;  &lt;p&gt;Da der User den Zugriff auf die Zwischenablage (&#228;hnlich der Webcam) explizit erlauben muss, gibt es eigentlich drei F&#228;lle. Folgender Silverlight Code mit VB.NET zeigt die Szenarien.&lt;/p&gt;  &lt;p&gt;&lt;span style=&quot;color: blue&quot;&gt;Try&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt; Clipboard.ContainsText() &lt;span style=&quot;color: blue&quot;&gt;Then&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; TextBox1.Text = Clipboard.GetText()    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;Else&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MessageBox.Show(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Zwischenablage leer&amp;quot;&lt;/span&gt;)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;Catch&lt;/span&gt; ex &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; SecurityException    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; MessageBox.Show(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Bitte Zugriff auf Zwischenablage erlauben&amp;quot;&lt;/span&gt;)    &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Try&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;Das funktioniert OOB ( out of browser) und auch f&#252;r Browser Anwendungen.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Silverlight-Zwischenablage</link>
			<author>Hannes Preishuber</author>
			<pubDate>Thu, 09 Sep 2010 20:13:34 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>VB</category><category>.Net</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Dynamische Silverlight UI mit C(l)ick
			</title>
			<description>&lt;p&gt;Manchmal kommen mir so Ideen und ich probiere rum bis es geht ohne eine Idee zu haben wof&#252;r eigentlich. Meine heutige Abendbesch&#228;ftigung sind entsch&#228;rfte Commands um dynamisch ein Formular zu erzeugen. Meist sieht man den Einsatz von Commands im Zusammenhang mit MVVM. Ich will es aber einfacher. Zun&#228;chst die Ausgangsituation. Silverlight 4 besitzt ein Command Attribut mit denen man Commands deklarativ zuweisen kann. Weiters kann man mit dem XAMLReader ein UI Element aus einem String erzeugen lassen. Wenn man Events per Attribut zuweisen m&#246;chte meckert der XAML Parser.&lt;/p&gt;  &lt;p&gt;Also wie sieht normalerweise ein Button Event aus&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt; &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Button&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;fester Button&amp;quot;&lt;/span&gt;  &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;37&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Button1_Click&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Left&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;42,35,0,0&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;102&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Im VB.NET Code dann im Ansatz so&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt; &lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; Button1_Click(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Object, &lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Windows.RoutedEventArgs)&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Alternativ kann man auch im Command Attribut ein Command angeben. Dazu ben&#246;tigt man aber eine Klasse die das Interface ICommand implementiert. In der minimal Ausstattung wie folgt mit einer simplen MessageBox.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt; HannesCommand1
    &lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; ICommand
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; HannesCommand1()
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt; CanExecute(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; parameter &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Object&lt;/span&gt;) &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Boolean&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; System.Windows.Input.ICommand.CanExecute
        &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;True&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt;

    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Event&lt;/span&gt; CanExecuteChanged(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.EventArgs) &lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; System.Windows.Input.ICommand.CanExecuteChanged

    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; Execute(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; parameter &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Object&lt;/span&gt;) &lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; System.Windows.Input.ICommand.Execute
        MessageBox.Show(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;hannescommand1&amp;quot;&lt;/span&gt;)
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Das Command kann aber nicht direkt verwendet werden. Der Umweg muss &#252;ber die Ressourcen. In jedem Fall ben&#246;tig man den Namensraum auf das aktuelle Silverlight Projekt das den Namen KoelnSL hei&#223;t. Der Namensraum wird willk&#252;rlich local genannt.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt; xmlns:local=&amp;quot;clr-namespace:KoelnSL&amp;quot;
  &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Das Command wird dann als Unterelement deklariert &#252;ber den Namesraum local und den Klassennamen.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Button&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Button&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;38&amp;quot;&lt;/span&gt; 
    &lt;span style=&quot;color: red&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Left&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;121,227,0,0&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;105&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
   &amp;lt;Button.Command&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;HannesCommand1&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;HannesCommand1&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
   &amp;lt;/Button.Command&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Button&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Alternativ besteht auch die M&#246;glichkeit &#252;ber eine Statische Ressource zu gehen. Die Instanz wird per x:Key willk&#252;rlich hCommand benannt.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&amp;lt;UserControl.Resources&amp;gt;
        &amp;lt;local:HannesCommand1 x:Key=&amp;quot;hCommand&amp;quot;&amp;gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;HannesCommand1&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;/UserControl.Resources&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Im XAML des Button Elements kann man dann mit kurzer Syntax direkt per Command Attribut die Bindung deklarieren auf hCommand.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Button&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Button&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;38&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{StaticResource hCommand}&amp;quot;&lt;/span&gt;
                 &lt;span style=&quot;color: red&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Left&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;121,227,0,0&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;105&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Soweit die Theorie zum Teil Commands. Als n&#228;chstes gehts um das dynamsiche laden von XAML. Die passende Klasse ist XAMLReader zu finden im Namenraum System.Windows.Markup. Damit kann aus einem String ein UIElement erstellt werden, das man an den XAML Tree anh&#228;ngen kann. Der Parser ben&#246;tigt allerdings den XAML presentation Namensraum im String.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt; &lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; Button1_Click(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Object, &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Windows.RoutedEventArgs)
&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; s &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt; =
   &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;&amp;lt;Button xmlns=&amp;quot;&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&amp;quot; &amp;quot;&lt;/span&gt; +
  &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot; Content=&amp;quot;&amp;quot;dynamischer Button&amp;quot;&amp;quot; Command=&amp;quot;&amp;quot;{StaticResource hCommand}&amp;quot;&amp;quot; &lt;br /&gt;Height=&amp;quot;&amp;quot;37&amp;quot;&amp;quot; HorizontalAlignment=&amp;quot;&amp;quot;Left&amp;quot;&amp;quot; &amp;quot;&lt;/span&gt; +
  &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot; Margin=&amp;quot;&amp;quot;42,107,0,0&amp;quot;&amp;quot; Name=&amp;quot;&amp;quot;Button2&amp;quot;&amp;quot; VerticalAlignment=&amp;quot;&amp;quot;Top&amp;quot;&amp;quot; Width=&amp;quot;&amp;quot;189&amp;quot;&amp;quot; &amp;gt;&amp;quot;&lt;/span&gt; +
  &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;&amp;lt;/Button&amp;gt;&amp;quot;&lt;/span&gt;
  &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; xaml &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; UIElement = XamlReader.Load(s)
  LayoutRoot.Children.Add(xaml)
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Das Problem war bei mir das der XAML Parser von Silverlight zur Laufzeit einen Fehler wirft, weil er hCommand nicht findet. Es scheint ein Problem in der Hierarchie geben, dem ich sp&#228;ter auf den Grund gehen werde. Aber ich weis das wenn eine Resource nicht gefunden wird, der Parser in den Ressourcen von APP.XAML nachschl&#228;gt. Deshalb also einfach dort deklariert.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&amp;lt;Application xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;    &lt;br /&gt;xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot; 
             xmlns:d=&lt;a href=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;&gt;http://schemas.microsoft.com/expression/blend/2008&lt;/a&gt;&lt;br /&gt; xmlns:mc=&amp;quot;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;quot; 
             x:Class=&amp;quot;KoelnSL.App&amp;quot;
             xmlns:local=&amp;quot;clr-namespace:KoelnSL&amp;quot;&amp;gt;
   &amp;lt;Application.Resources&amp;gt;
   &amp;lt;local:HannesCommand1 x:Key=&amp;quot;hCommand1&amp;quot;&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;HannesCommand1&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
   &amp;lt;/Application.Resources&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Application&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Demn&#228;chst auch ein echtes MVVM Beispiel mit Binding.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Dynamische-Silverlight-UI-mit-Click</link>
			<author>Hannes Preishuber</author>
			<pubDate>Tue, 07 Sep 2010 21:55:34 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>XAML</category><category>.Net</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Silverlight Transformationen Detailinfos
			</title>
			<description>&lt;p&gt;In meiner letzten Silverlight Schulung hat ein Teilnehmer ziemlich pentrant nachgefragt in welcher Reihenfolge Transformationen ausgef&#252;hrt werden. Ich habe geantwortet gleichzeitig. Damit hatte ich recht und unrecht zugleich.&lt;/p&gt;  &lt;p&gt;Seit Silverlight 4 erzeugt Expression Blend Transformationen per Attribute in einem CompositeTransform Element&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Button&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Button&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;RenderTransformOrigin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0.5,0.5&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;UseLayoutRounding&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;False&amp;quot; d:LayoutRounding=&amp;quot;Auto&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;5&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
    &amp;lt;Button.RenderTransform&amp;gt;
    	&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;CompositeTransform&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;TranslateY&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;-13&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Rotation&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;19.549&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
    &amp;lt;/Button.RenderTransform&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Button&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Wenn nun mehrere Buttons in einem Stackpanel platziert werden sieht man in Blend zwei Effekte&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/SilverlightTransformationenDetailinfos_12682/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/SilverlightTransformationenDetailinfos_12682/image_thumb.png&quot; width=&quot;244&quot; height=&quot;86&quot; /&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Die Urspr&#252;ngliche Position des Buttons wird hellblau dargestellt. Das liegt daran das das Reendering zun&#228;chst durchgef&#252;hrt wird als ob das UIElement ganz normal vorhanden w&#228;re. Hier eben drei Buttons in einem Stackpanel. Das macht auch sicher Sinn. Wohin sollten die Buttons auch rutschen? Danach wird die Transformation angewandt. In diesem Beispiel eine Drehung und eine Positions&#228;nderung auf der Y Achse.&lt;/p&gt;

&lt;p&gt;Vor Silverlight 4 hat Expression Blend (als 3 oder kleiner) eine Transformgroup erzeugt. Diese enthielt dann die Transformationen als Unterelemente. Eine Menge XAML Code und vor allem teuflisch da Animationen die Elemtente per Index angesteuert haben. Ein entferntes Transformation Element hat so ziemlich weit reichende Auswirkungen. Entsprechend ist der L&#246;sungsansatz von Silverlight 4 per CompositeTransform auch wesentlich besser.&lt;/p&gt;

&lt;p&gt;Seltsamerweise enthalten die &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyID=e9da0eb8-f31b-4490-85b8-92c2f807df9e&amp;amp;displaylang=en&quot;&gt;Silverlight 4 Design Vorlagen&lt;/a&gt; auch noch immer den alten Weg per Transformgroup&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;LinearGradientBrush&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;EndPoint&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0,1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;MappingMode&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Absolute&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;SpreadMethod&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Repeat&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;StartPoint&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;20,1&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;LinearGradientBrush.Transform&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TransformGroup&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TranslateTransform&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;SkewTransform&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;AngleX&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;-30&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TransformGroup&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;                                 &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Nun zur zentralen Frage. Spielt die Reihenfolge der Element in der Transformgroup eine Rolle? Die Standardreihenfolge unter Blend war wie folgt. Dies habe ich auch nie in Frage gestellt und ver&#228;ndert.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TransformGroup&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ScaleTransform&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;SkewTransform&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;RotateTransform&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TranslateTransform&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TransformGroup&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/SilverlightTransformationenDetailinfos_12682/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/SilverlightTransformationenDetailinfos_12682/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;144&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Wenn man nun die Reihenfolge von TranslateTransform und RotateTransform wie folgt tauscht, &#228;ndert sich in der Tat die Oberfl&#228;che, was der Beweis daf&#252;r ist, das es eine entscheidende Rolle spielt.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TransformGroup&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TranslateTransform&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;X&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;200&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
 &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;RotateTransform&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Angle&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;45&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TransformGroup&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;a href=&quot;http://blogs.ppedv.de/data/SilverlightTransformationenDetailinfos_12682/image_6.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/SilverlightTransformationenDetailinfos_12682/image_thumb_2.png&quot; width=&quot;244&quot; height=&quot;230&quot; /&gt;&lt;/a&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Silverlight-Transformationen-Detailinfos</link>
			<author>Hannes Preishuber</author>
			<pubDate>Mon, 06 Sep 2010 21:21:06 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>Blend</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Selektierten Eintrag in Silverlight Listbox anders darstellen
			</title>
			<description>&lt;p&gt;Die Silverlight Listbox wird noch ein Thema f&#252;r ein eigenes Buch. Wer bei Bing nach Betr&#228;gen dazu sucht wird vieles dazu finden. U.a. &lt;a href=&quot;http://blogs.ppedv.de/hannesp/archive/Listbox-eintraumlge-die-die-ganze-Breite-einnehmen&quot;&gt;hier&lt;/a&gt; und &lt;a href=&quot;http://blogs.ppedv.de/hannesp/archive/Silverlight-Listbox-1x1&quot;&gt;hier&lt;/a&gt; und &lt;a href=&quot;www.ppedv.de/schulung/kurse/silverlight.aspx&quot;&gt;hier&lt;/a&gt;. Ein Kunde meiner Silverlight Schulung hat mich gefragt wie man einen Eintrag einer Listbox der ausgew&#228;hlt (selected) ist, anders darstellt. Nun habe ich mich geistig auf die Suche nach dem passenden Template gemacht. Das ist ist aber falsch gedacht. Silverlight verwendet f&#252;r die “aktiven” Parts den Visual State Manager der das Verhalten beeinflusst.&lt;/p&gt;  &lt;p&gt;Um an diesem VSM zu gelangen muss man in das generated Item Container Template der Silverlight Listbox.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/SelektiertenEintraginSilverlightListboxa_116FE/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/SelektiertenEintraginSilverlightListboxa_116FE/image_thumb.png&quot; width=&quot;564&quot; height=&quot;137&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Dann erh&#228;lt man umfangreichen XMAL Code. Die wichtigen Stellen habe ich gelb markiert.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&amp;lt;UserControl.Resources&amp;gt;
&amp;lt;Style x:Key=&amp;quot;ListBoxItemStyle1&amp;quot; TargetType=&amp;quot;ListBoxItem&amp;quot;&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Setter&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Padding&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;3&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Setter&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;HorizontalContentAlignment&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Left&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Setter&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;VerticalContentAlignment&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Top&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Setter&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Background&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Transparent&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Setter&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;BorderThickness&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Setter&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;TabNavigation&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Local&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Setter&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Template&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;Setter.Value&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ControlTemplate&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;TargetType&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;ListBoxItem&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Grid&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{TemplateBinding Background}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;VisualStateManager.VisualStateGroups&amp;gt;
&amp;lt;VisualStateGroup x:Name=&amp;quot;CommonStates&amp;quot;&amp;gt;
&amp;lt;VisualState x:Name=&amp;quot;Normal&amp;quot;/&amp;gt;
&amp;lt;VisualState x:Name=&amp;quot;MouseOver&amp;quot;&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;DoubleAnimation&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Duration&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;To&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;.35&amp;quot; Storyboard.TargetProperty=&amp;quot;Opacity&amp;quot; Storyboard.TargetName=&amp;quot;fillColor&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;VisualState&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;VisualState x:Name=&amp;quot;Disabled&amp;quot;&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;DoubleAnimation&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Duration&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;To&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;.55&amp;quot; Storyboard.TargetProperty=&amp;quot;Opacity&amp;quot; Storyboard.TargetName=&amp;quot;contentPresenter&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;VisualState&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;VisualStateGroup&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;VisualStateGroup x:Name=&amp;quot;SelectionStates&amp;quot;&amp;gt;
&amp;lt;VisualState x:Name=&amp;quot;Unselected&amp;quot;/&amp;gt;
&amp;lt;VisualState x:Name=&amp;quot;Selected&amp;quot;&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;font style=&quot;background-color: #ffff00&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;DoubleAnimation&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Duration&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;To&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;/font&gt;&lt;font style=&quot;background-color: #ffff00&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;.75&amp;quot; &lt;br /&gt;Storyboard.TargetProperty=&amp;quot;Opacity&amp;quot;&lt;br /&gt; Storyboard.TargetName=&amp;quot;fillColor2&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;VisualState&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;VisualStateGroup&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;VisualStateGroup x:Name=&amp;quot;FocusStates&amp;quot;&amp;gt;
&amp;lt;VisualState x:Name=&amp;quot;Focused&amp;quot;&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Duration&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0&amp;quot; &lt;br /&gt;Storyboard.TargetProperty=&amp;quot;Visibility&amp;quot; &lt;br /&gt;Storyboard.TargetName=&amp;quot;FocusVisualElement&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;DiscreteObjectKeyFrame&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;KeyTime&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;DiscreteObjectKeyFrame.Value&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Visibility&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;Visible&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Visibility&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;/DiscreteObjectKeyFrame.Value&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;VisualState&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;VisualState x:Name=&amp;quot;Unfocused&amp;quot;/&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;VisualStateGroup&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;/VisualStateManager.VisualStateGroups&amp;gt;
&amp;lt;Rectangle x:Name=&amp;quot;fillColor&amp;quot; Fill=&amp;quot;#FFBADDE9&amp;quot;&lt;br /&gt; IsHitTestVisible=&amp;quot;False&amp;quot; Opacity=&amp;quot;0&amp;quot; RadiusY=&amp;quot;1&amp;quot; RadiusX=&amp;quot;1&amp;quot;/&amp;gt;
&amp;lt;&lt;font style=&quot;background-color: #ffff00&quot;&gt;Rectangle x:Name=&amp;quot;fillColor2&amp;quot; Fill=&amp;quot;red&amp;quot;&lt;/font&gt; &lt;br /&gt;IsHitTestVisible=&amp;quot;False&amp;quot; &lt;font style=&quot;background-color: #ffff00&quot;&gt;Opacity=&amp;quot;0&amp;quot;&lt;/font&gt; RadiusY=&amp;quot;1&amp;quot; RadiusX=&amp;quot;1&amp;quot;/&amp;gt;
&amp;lt;ContentPresenter x:Name=&amp;quot;contentPresenter&amp;quot; Margin=&amp;quot;5&amp;quot;
 ContentTemplate=&amp;quot;{TemplateBinding ContentTemplate}&amp;quot; 
 Content=&amp;quot;{TemplateBinding Content}&amp;quot; 
 HorizontalAlignment=&amp;quot;Left&amp;quot; /&amp;gt;
&lt;font style=&quot;background-color: #ffff00&quot;&gt;&amp;lt;Rectangle x:Name=&amp;quot;FocusVisualElement&amp;quot; &lt;br /&gt;&lt;font style=&quot;background-color: #ffffff&quot;&gt;RadiusY=&amp;quot;1&amp;quot; RadiusX=&amp;quot;1&amp;quot; Stroke=&amp;quot;#FF6DBDD1&amp;quot;&lt;br /&gt;&lt;/font&gt; StrokeThickness=&amp;quot;5&amp;quot; &lt;/font&gt;&lt;font style=&quot;background-color: #ffffff&quot;&gt;Visibility=&amp;quot;Collapsed&amp;quot;/&amp;gt;&lt;/font&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ControlTemplate&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;/Setter.Value&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Setter&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Style&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;/UserControl.Resources&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Entsprechend sieht dann meine Liste nicht mehr besonders sch&#246;n aber aus. Aber ich konnte das selektierte Item ver&#228;ndern und kann sogar die Animation dazu steuern. Und wieder ein Auftrag erf&#252;llt.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/SelektiertenEintraginSilverlightListboxa_116FE/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/SelektiertenEintraginSilverlightListboxa_116FE/image_thumb_1.png&quot; width=&quot;165&quot; height=&quot;197&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Selektierten-Eintrag-in-Silverlight-Listbox-anders-darstellen</link>
			<author>Hannes Preishuber</author>
			<pubDate>Fri, 27 Aug 2010 20:04:24 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Blend</category><category>Silverlight</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Visual Studio 2010 und Expression Blend Datenbindung mit Designer unterstzung
			</title>
			<description>&lt;p&gt;Wenn man in Silverlight Projekten Datenklassen erstellt und dann bindet entsteht der Wunsch im Designer schon einen sinnvollen Preview zu haben. F&#252;r Expression Blend gibt es die M&#246;glichkeit mit Designtime zu arbeiten. In diesem Silverlight Beispiel will ich aber direkt die DAL pimpen. Daf&#252;r muss einfach der Konstrukor herhalten, der f&#252;r die verschiedenen F&#228;lle unterschiedliche Daten generiert.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt; person
    &lt;span style=&quot;color: blue&quot;&gt;Implements&lt;/span&gt; INotifyPropertyChanged
    &lt;span style=&quot;color: blue&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt;()
    &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt; DesignerProperties.IsInDesignTool &lt;span style=&quot;color: blue&quot;&gt;Then&lt;/span&gt;
        _name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Hannes Preishuber ist ein Designer&amp;quot;&lt;/span&gt;
     &lt;span style=&quot;color: blue&quot;&gt;Else&lt;/span&gt;
      &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt; HtmlPage.IsEnabled &lt;span style=&quot;color: blue&quot;&gt;Then&lt;/span&gt;
                _name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Hannes Preishuber nuttzt den Webbrowser&amp;quot;&lt;/span&gt;
      &lt;span style=&quot;color: blue&quot;&gt;Else&lt;/span&gt;
        _name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Hannes Preishuber startet die Anwendung OOB&amp;quot;&lt;/span&gt;
      &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt;
  &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Die&amp;#160; Bindung wird voll deklarativ durchgef&#252;hrt.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&amp;lt;UserControl.Resources&amp;gt;
  &amp;lt;local:person x:Key=&amp;quot;personDataSource&amp;quot; d:IsDataSource=&amp;quot;True&amp;quot;/&amp;gt;
&amp;lt;/UserControl.Resources&amp;gt;
&amp;lt;Grid x:Name=&amp;quot;LayoutRoot&amp;quot; Background=&amp;quot;White&amp;quot; &lt;br /&gt;DataContext=&amp;quot;{Binding Source={StaticResource personDataSource}}&amp;quot;&amp;gt;
	&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TextBox&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;23&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;151,23,12,0&amp;quot;&lt;br /&gt;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;TextWrapping&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Wrap&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{Binding name, Mode=TwoWay}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;In Visual Studio 2010 (cidder)
  &lt;br /&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/VisualStudio2010undExpressionBlendDatenb_10E3D/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/VisualStudio2010undExpressionBlendDatenb_10E3D/image_thumb.png&quot; width=&quot;244&quot; height=&quot;113&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Im Webbrowser
  &lt;br /&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/VisualStudio2010undExpressionBlendDatenb_10E3D/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/VisualStudio2010undExpressionBlendDatenb_10E3D/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;94&quot; /&gt;&lt;/a&gt;

  &lt;br /&gt;Out Of Browser (OOB)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/VisualStudio2010undExpressionBlendDatenb_10E3D/image_6.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/VisualStudio2010undExpressionBlendDatenb_10E3D/image_thumb_2.png&quot; width=&quot;244&quot; height=&quot;54&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Visual-Studio-2010-und-Expression-Blend-Datenbindung-mit-Designer-untersuumltzung</link>
			<author>Hannes Preishuber</author>
			<pubDate>Fri, 27 Aug 2010 19:22:39 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Blend</category><category>Silverlight</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Listbox eintrge die die ganze Breite einnehmen
			</title>
			<description>&lt;p&gt;Diesesmal hat mein Silverlight Schulungsteilnehmer (Stephan) mir eine cooles Silverlight Sample gezeigt. W&#228;hrend der Schulung war wieder mal die Listbox ein Thema (dar&#252;ber k&#246;nnte ich schon ein Buch schreiben. Es sollte eine Liste mit Namen angezeigt werden und dabei das Itemtemplate ver&#228;ndert werden. Das geht eigentlich ganz einfach entweder mit Expression Blend oder direkt im XAML Code ala&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&amp;lt;ListBox.ItemTemplate&amp;gt;
     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Border&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;5&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;BorderBrush&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;#FF340CF9&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;CornerRadius&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;5&amp;quot;&lt;/span&gt;  &lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;32&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
	&amp;lt;Border.Background&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;LinearGradientBrush&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;EndPoint&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0.5,1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;StartPoint&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0.5,0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;GradientStop&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Black&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Offset&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;GradientStop&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Color&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;White&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Offset&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
 		&amp;lt;/Border.Background&amp;gt;
	&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{Binding}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Foreground&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;#FFF9F5F5&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;FontWeight&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Bold&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;4,2&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
      	&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Border&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;/ListBox.ItemTemplate&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/ListboxeintrgediedieganzeBreiteeinnehmen_10912/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/ListboxeintrgediedieganzeBreiteeinnehmen_10912/image_thumb.png&quot; width=&quot;244&quot; height=&quot;165&quot; /&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Das ganze sieht allerdings mehr nach Balkengrafik aus. Der Wunsch ist das alle Listboxitems gleich breit sein sollen. Eigentlich ganz einfach. Die Width der Broder gesetzt und… Aber es soll genau so breit sein wie die Listbox. &lt;/p&gt;

&lt;p&gt;Das geht indem man das HorizontalContentAlignment auf Stretch setzt. Da kommt man leider gar nicht so leicht ran. Entweder man nimmt Expression Blend und zerlegt die Listbox in sein Template. Contextmen&#252; – &lt;em&gt;Edit Template-Edit a copy&lt;/em&gt;.- und erh&#228;lt 300 Zeilen XAML Code&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/ListboxeintrgediedieganzeBreiteeinnehmen_10912/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/ListboxeintrgediedieganzeBreiteeinnehmen_10912/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Oder man nimmt die relevante Setter Stelle einfach raus und setzt sie sozusagen auf dem kurzen Dienstweg im ItemContainerstyle der Silverlight Listbox&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ListBox&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;96,26,129,54&amp;quot; x:Name=&amp;quot;listbox1&amp;quot;&lt;/span&gt;  &lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
  &amp;lt;ListBox.ItemContainerStyle&amp;gt;
     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Style&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;TargetType&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;ListBoxItem&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Setter&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;HorizontalContentAlignment&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Stretch&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Style&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
  &amp;lt;/ListBox.ItemContainerStyle&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Perfektes Ergebnis im Browser&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/ListboxeintrgediedieganzeBreiteeinnehmen_10912/image_6.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/ListboxeintrgediedieganzeBreiteeinnehmen_10912/image_thumb_2.png&quot; width=&quot;244&quot; height=&quot;171&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Listbox-eintraumlge-die-die-ganze-Breite-einnehmen</link>
			<author>Hannes Preishuber</author>
			<pubDate>Fri, 27 Aug 2010 19:05:01 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>Blend</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Einen Silverlight Clipping Path Animieren
			</title>
			<description>&lt;p&gt;Aktuell habe ich in meiner Silverlight Schulung einen Teilnehmer, der wirklich interessante Fragen aufwirft, deren Antwort ich dann im Nachgang suche und hier in meinem Blog poste. Schlie&#223;lich sind nur gl&#252;ckliche Silverlight Kurs Teilnehmer auch gute Teilnehmer. In diesem Silverlight 4 Beispiel soll ein Bild beschnitten werden. Das geht auch ganz einfach mit dem Clipping Path Attribut. &lt;/p&gt;  &lt;p&gt;Mit Expression Blend nimmt man ein Bild, legt dar&#252;ber eine Kurve (z.B. Kreis) und markiert beide. Dann wird im Context Men&#252; &lt;em&gt;Path&lt;/em&gt;- &lt;em&gt;Make Clipping Path&lt;/em&gt; ausgew&#228;hlt.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/472cbddbf1bc_116B2/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/472cbddbf1bc_116B2/image_thumb.png&quot; width=&quot;244&quot; height=&quot;150&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Im XAML sieht das wie folgt&amp;#160; aus und man sieht nur mehr den Hintern der h&#252;bschen Person vom Foto &lt;img style=&quot;border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none&quot; class=&quot;wlEmoticon wlEmoticon-winkingsmile&quot; alt=&quot;Zwinkerndes Smiley&quot; src=&quot;http://blogs.ppedv.de/data/472cbddbf1bc_116B2/wlEmoticon-winkingsmile_2.png&quot; /&gt;.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Image&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;30,41,-140,-124&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Source&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;/maus[1].jpg&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Stretch&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Fill&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;Clip&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;M470.5,351.5 C470.5,387.3985 425.05692,416.5 369,416.5 C312.94308,416.5 &lt;br /&gt;267.5,387.3985 267.5,351.5 C267.5,315.6015 312.94308,286.5 369,286.5 &lt;br /&gt;C425.05692,286.5 470.5,315.6015 470.5,351.5 z&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
	&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Leider l&#228;sst sich das so nicht mehr animieren. Viele Attribute eines UIElements lassen sich durch ein Unterelement aufsplitten. So auch das Clip Attribut zu Image.Clip. Der Pfad wird dann mit Geometry Elementen beschrieben. In unserem Beispiel eben eine Ellipse.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&amp;lt;Image x:Name=&amp;quot;image&amp;quot; Source=&amp;quot;/maus[1].jpg&amp;quot; Stretch=&amp;quot;Fill&amp;quot; RenderTransformOrigin=&amp;quot;0.5,0.5&amp;quot; &amp;gt;
  &amp;lt;Image.Clip&amp;gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;EllipseGeometry&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;RadiusX&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;50&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;RadiusY&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;50&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Center&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;100,100&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;EllipseGeometry&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt; 		
  &amp;lt;/Image.Clip&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Image&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
Insgesamt gibt es f&#252;nf solcher Geomtrien.&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;div style=&quot;background-color: white; color: black&quot;&gt;EllipseGeometry &lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div style=&quot;background-color: white; color: black&quot;&gt;GeometryGroup&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div style=&quot;background-color: white; color: black&quot;&gt;LineGeometry&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div style=&quot;background-color: white; color: black&quot;&gt;PathGeometry&lt;/div&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;div style=&quot;background-color: white; color: black&quot;&gt;RectangleGeometry&lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Jetzt bleibt nur mehr das Problem der Animation. Leider gibt es keine Unterst&#252;tzung durch Expression Blend oder schon gar nicht Visual Studio 2010. Also ran per Hand. Da ich eine Punkt verschieben m&#246;chte ist die PointAnimation das passende. Recht Tricky ist die Adressierung des Center Propertys &#252;ber die XAML Hierarchie.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&amp;lt;Storyboard x:Name=&amp;quot;Storyboard1&amp;quot;&amp;gt;
&amp;lt;PointAnimation BeginTime=&amp;quot;0&amp;quot; Duration=&amp;quot;0:0:01&amp;quot; From=&amp;quot;0,0&amp;quot; To=&amp;quot;200,200&amp;quot;
 Storyboard.TargetName=&amp;quot;image&amp;quot; 
 Storyboard.TargetProperty=&amp;quot;(UIElement.Clip).(EllipseGeometry.Center)&amp;quot;&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;PointAnimation&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;	&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Gestartet wird die Animation per Expression Blend behavior. Am Ende eine Null Code L&#246;sung.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&amp;lt;i:Interaction.Triggers&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;EventTrigger&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;EventName&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;MouseLeftButtonDown&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ei&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ControlStoryboardAction&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Storyboard&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{StaticResource Storyboard1}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;EventTrigger&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;/i:Interaction.Triggers&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Funktioniert. Ich bin wieder mal begeistert.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/472cbddbf1bc_116B2/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/472cbddbf1bc_116B2/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;111&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/472cbddbf1bc_116B2/image_6.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/472cbddbf1bc_116B2/image_thumb_2.png&quot; width=&quot;197&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/472cbddbf1bc_116B2/image_8.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/472cbddbf1bc_116B2/image_thumb_3.png&quot; width=&quot;244&quot; height=&quot;135&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Einen-Silverlight-Clipping-Path-Animieren</link>
			<author>Hannes Preishuber</author>
			<pubDate>Thu, 26 Aug 2010 20:30:24 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>.Net</category><category>Blend</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    BusyIndicator in ObservableCollection einbinden
			</title>
			<description>&lt;p&gt;In meiner aktuellen Silverlight Schulung haben wir ein wenig auf Performance geschaut. Ein Ladevorgang einer sehr langen Liste dauert etwas l&#228;nger und w&#228;hrend dieser Zeit soll der eine Wartemeldung angezeigt werden. Im Silverlight Toolkit befindet sich auch passend ein entsprechendes Control der BusyIndicator.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/5161a92f2baf_6E3B/BusyIndicator-Default_2.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;BusyIndicator-Default&quot; border=&quot;0&quot; alt=&quot;BusyIndicator-Default&quot; src=&quot;http://blogs.ppedv.de/data/5161a92f2baf_6E3B/BusyIndicator-Default_thumb.png&quot; width=&quot;204&quot; height=&quot;104&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Dieser l&#228;sst sich auch in sein Template zerlegen und optisch anpassen. W&#228;hrend der Busyindicator l&#228;uft kann der User keine UI Elemente nutzen und so z.B. einen Button eben nicht zwei mal dr&#252;cken.&lt;/p&gt;  &lt;p&gt;Die entscheidende Frage ist, wie zeige ich den BusyIndicator nun an. Zun&#228;chst hat dieser eine Boolsche Eigenschaft IsBusys die man setzen kann. Manchmal l&#228;uft die Logik aber in einer Komponente dahinter von der man keinen Zugriff aufs UI hat.&amp;#160; In meinem Fall eben eine Liste die von ObservableCollection erbt. Diese Liste wird zur Laufzeit durch einen l&#228;nger laufenden Download gef&#252;llt, zur Design Zeit mit Dummy Daten.&amp;#160; Diese Entscheidung wird duchr HTMLPagel.Isenabled getroffen. Die Observeable Collection muss ich nehmen damit das gebundene UI Element ( z.B. Datagrid oder Listbox) automatisch und asynchron die Daten auch anzeigen sobald sie fertig geladen sind. Zus&#228;tzlich verpasse ich der personen Liste ein Property isBusy. Dieses wird gesetzt wenn der Download startet. In der OpenreadCompleted Methode wird dann der Wert wieder auf false gesetzt.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt; personen
    &lt;span style=&quot;color: blue&quot;&gt;Inherits&lt;/span&gt; ObservableCollection(Of person)
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt;()
        &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt; HtmlPage.IsEnabled &lt;span style=&quot;color: blue&quot;&gt;Then&lt;/span&gt;
            &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; wc &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; WebClient
            &lt;span style=&quot;color: blue&quot;&gt;AddHandler&lt;/span&gt; wc.OpenReadCompleted, &lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; fertig
            IsBusy = &lt;span style=&quot;color: blue&quot;&gt;True&lt;/span&gt;
            wc.OpenReadAsync(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; Uri(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;namen.txt&amp;quot;&lt;/span&gt;, UriKind.Relative))
        &lt;span style=&quot;color: blue&quot;&gt;Else&lt;/span&gt;
            Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 27, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Hannes&amp;quot;&lt;/span&gt;})
            Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 32, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Andreas&amp;quot;&lt;/span&gt;})
            Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 23, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Bernhard&amp;quot;&lt;/span&gt;})
            Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 45, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Stefan&amp;quot;&lt;/span&gt;})
            Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 12, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Arnold&amp;quot;&lt;/span&gt;})
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;

    &lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; _IsBusy &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Boolean&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; IsBusy() &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Boolean&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
            &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; _IsBusy
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;Set&lt;/span&gt;(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; value &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Boolean&lt;/span&gt;)
            _IsBusy = value
            OnPropertyChanged(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; PropertyChangedEventArgs(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;IsBusy&amp;quot;&lt;/span&gt;))
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Set&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Im XAML wird dann der BusyIndicator an die IsBusy Eigenschaft gebunden. Dies ist auch der Grund f&#252;r die onpropertyChanged Codezeile im vorigen Beispiel. Damit kann das UI &#196;nderung der Daten im Personen Object “abbonieren”. Damit wird die Anzeige eben sofort erneuert.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;BusyIndicator&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;100&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Left&amp;quot;&lt;/span&gt;  &lt;span style=&quot;color: red&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;BusyIndicator1&amp;quot;&lt;/span&gt; 
   &lt;span style=&quot;color: red&quot;&gt;IsBusy&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{Binding IsBusy}&amp;quot;&lt;/span&gt; 
   &lt;span style=&quot;color: red&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;150&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;BusyIndicator&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;/pre&gt;
&lt;/div&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/BusyIndicator-in-ObservableCollection-einbinden</link>
			<author>Hannes Preishuber</author>
			<pubDate>Wed, 11 Aug 2010 08:04:52 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>XAML</category><category>.Net</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Liste 2x1 Itemscontrol
			</title>
			<description>&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/hannesp/archive/Silverlight-Listbox-1x1&quot;&gt;Letztes mal&lt;/a&gt; habe ich kurz beschrieben was man mit einer Listbox und Templating in Silverlight so machen kann. Wenn man allerdings &lt;em&gt;keine&lt;/em&gt; Auswahl M&#246;glichkeit braucht, kann man auch das schlankere Itemscontrol (&#252;brigens erbt Listbox davon) verwendet werden.&lt;/p&gt;  &lt;p&gt;Die Daten werden als Liste in einer Klasse erzeugt.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt; personen
    &lt;span style=&quot;color: blue&quot;&gt;Inherits&lt;/span&gt; List(Of person)
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt;()
        Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 27, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Hannes&amp;quot;&lt;/span&gt;})
        Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 32, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Andreas&amp;quot;&lt;/span&gt;})
        Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 23, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Bernhard&amp;quot;&lt;/span&gt;})
        Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 45, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Stefan&amp;quot;&lt;/span&gt;})
        Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.alter = 12, .Firma = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;ppedv ag&amp;quot;&lt;/span&gt;, .Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Arnold&amp;quot;&lt;/span&gt;})
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Diese Daten werden deklarativ instanziert und gebunden. Nicht weil es n&#246;tig w&#228;re, sondern schlicht weil es m&#246;glich ist. Das folgende passiert dann auch in der XAML Datei&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;...   xmlns:local=&amp;quot;clr-namespace:KoelnSL&amp;quot;&amp;gt;
&amp;lt;UserControl.Resources&amp;gt;
    &amp;lt;local:personen x:Key=&amp;quot;personen&amp;quot;&amp;gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;personen&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&amp;lt;/UserControl.Resources&amp;gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ein positver Nebeneffekt ist, das die Bindung auch in Blend und Visual Studio 2010 zur Entwurfszeit voll sichtbar ist.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/Liste2x1Itemscontrol_12CD9/image_2.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/Liste2x1Itemscontrol_12CD9/image_thumb.png&quot; width=&quot;304&quot; height=&quot;166&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Im XAML werden dann die drei Templates definiert&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ItemsControl&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;100&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;ItemsSource&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{Binding Source={StaticResource personen}}&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
  &amp;lt;ItemsControl.Template&amp;gt;
      &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ControlTemplate&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;TargetType&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;ItemsControl&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Border&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;BorderBrush&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;BlueViolet&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;BorderThickness&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;CornerRadius&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
           &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ItemsPresenter&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Border&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ControlTemplate&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
   &amp;lt;/ItemsControl.Template&amp;gt;
      &amp;lt;ItemsControl.ItemsPanel&amp;gt;
        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
           &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;StackPanel&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Orientation&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Vertical&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;SkyBlue&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;5&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
   &amp;lt;/ItemsControl.ItemsPanel&amp;gt;
   &amp;lt;ItemsControl.ItemTemplate&amp;gt;
     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
       &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;{Binding Name}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;20&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;50&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;4&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TextBlock&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
   &amp;lt;/ItemsControl.ItemTemplate&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ItemsControl&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Liste-2x1-Itemscontrol</link>
			<author>Hannes Preishuber</author>
			<pubDate>Mon, 09 Aug 2010 21:38:52 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    IIS-Pickup-Verzeichnis kann nicht abgerufen werden bei SMTPClient.Send
			</title>
			<description>&lt;p&gt;Oder wie der Brite auch sagen w&#252;rde “Cannot get IIS pickup directory”. Beim senden von EMails aus ASP.NET per SMTP Service kann ich immer nur raten, nicht die Network Methode zu w&#228;hlen, sondern direkt ins Pickup Directory des IIS zu schreiben. Das geht schneller und ist ausfallsicher falls der SMTP Server mal nicht erreichbar ist. Ein typischer Anwendungsfall von asynchroner Architektur. Nun ist der SMTP Server beim IIS 7 (und 7.5) noch immer der alte aus dem IIS 6. Wenn man also WIndows Server 2008 oder 2008 R2 hat muss man den SMTP Server extra verwalten mit der alten MMC Console. Das heist die Metabase ist nach wie vor im Spiel und nicht die neuen Config Dateien. &#220;brigens war Microsoft auf so nett den POP3 Server rauszunehmen. Worauf mein Kollege Cosmin den &lt;a href=&quot;http://www.visendo.de/de/default.aspx&quot;&gt;kostenfreien VIsendo SMTP Extender&lt;/a&gt; programmiert hat.&lt;/p&gt;  &lt;p&gt;Beim IIS7 7.5 wird per default der Benutzer ApplicationPoolIdentity verwendet um die Web Anwendung zu betreiben. Dieser Benutzer hat stark limiterte Rechte. &lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/7e215cdcfb5b_C5A2/image_2.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/7e215cdcfb5b_C5A2/image_thumb.png&quot; width=&quot;244&quot; height=&quot;167&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Ebenso fehlt wohl das Zugriffsrecht (ACL) auf die Eintr&#228;ge aus dem SMTP Bereich in der Metabase.&lt;/p&gt;  &lt;p&gt;Wenn nun beim versenden einer Mail die Meldung kommt “IIS-Pickup-Verzeichnis kann nicht abgerufen werden” dann helfen folgende L&#246;sungsans&#228;tze&lt;/p&gt;  &lt;p&gt;1) &lt;span style=&quot;color: #1f497d&quot;&gt;In der Web.config den Namen des&amp;#160; Pickupdirectorys manuell setzen        &lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin: 0cm 0cm 0pt&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #1f497d&quot;&gt;&lt;a href=&quot;http://blogs.ppedv.de/hannesp/archive/Mail-Sender-Klartextnamen-in-web.config-setzen&quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;http://blogs.ppedv.de/hannesp/archive/Mail-Sender-Klartextnamen-in-web.config-setzen&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin: 0cm 0cm 0pt&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #1f497d&quot;&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin: 0cm 0cm 0pt&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #1f497d&quot;&gt;2) Man kann dem Beutzer auch die Rechte geben. Dazu sollte man den Metabase Editor verwenden. Dieser ist im IIS6 Resource Kit enthalten. Per Rechtsclick auf den Knoten im Tree (hier 1) kann man dann die ben&#246;tigten Rechte setzen.&lt;/span&gt;&lt;/p&gt;  &lt;p style=&quot;margin: 0cm 0cm 0pt&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #1f497d&quot;&gt;        &lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/7e215cdcfb5b_C5A2/image_4.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/7e215cdcfb5b_C5A2/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;177&quot; /&gt;&lt;/a&gt;&lt;/p&gt; 3) Den Benutzer in den Einstellungen des Application Pools ( Abbildung 1) auf System &#228;ndern. Mit entsprechenden Konsequenzen in der Sicherheit.   </description>
			<link>http://blogs.ppedv.de/hannesp/archive/IIS-Pickup-Verzeichnis-kann-nicht-abgerufen-werden-bei-SMTPClient.Send</link>
			<author>Hannes Preishuber</author>
			<pubDate>Tue, 27 Jul 2010 14:24:10 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			ASP.NET</category><category>Windows Server 2008</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Freigestellte Personen in Silverlight Video
			</title>
			<description>&lt;p&gt;Auf jedem guten TV Sender gibt es eine Wetter Fee. Diese meist sehr attraktive Person&amp;#160; choreographiert vor einer blauen oder heute meist gr&#252;nen Wand. Die Clouds oder Sonnen werden Computer animiert eingespielt.&lt;/p&gt;  &lt;p&gt;Dazu brauchen wir eine Wetterfee, eine Kamera, ein Aufnahmestudio, Expression Blend 4 und .. die M&#246;glichkeit in einem&amp;#160; Video eine Farbe auf transparent zu schalten. Die Wetterfee ist meine entz&#252;ckende Kollegin Lilly. Die Kamera eine Smartflip ( jetzt Cisco). Das Aufnahmestudio eines Fotografen der im gleichen Haus sitzt und eine gr&#252;ne Rollwand besitzt. Diese rollt man ein St&#252;ck &#252;ber den Boden so das auch keine Kanten sichtbar sind. Dann das ganze nach Expression Blend importiert und per Drag&amp;amp; Drop auf eine Seite ziehen.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_2.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_thumb.png&quot; width=&quot;244&quot; height=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Warum Lilly hier so seltsame Handbewegungen macht? Ich wollte sp&#228;ter eine per Silverlight Animation eine Sonne durchs Bild schieben. Was man hier gut sehen kann ist, das der Hintergrund nicht homogen ist. Das ist mir bei unserem 30 Sekunden Shot nicht aufgefallen. Es liegt daran das Fotografen in der Regel einen Spot auf den Hintergrund legen um das Foto aufzulockern. Hier m&#252;sste der Spot abgeschalten werden. Dazu aber gleich mehr.&lt;/p&gt;  &lt;p&gt;Seit Silverlight 3 gibt es Pixelshader. Diese helfen Bilder direkt in der Grafikkarte performant zu ver&#228;ndern( Wenn GPU Acceleration aktiviert ist). Per Standard ist Schatten und Unsch&#228;rfe vorhanden. In Blend 4 noch ein wenig mehr Shader. Wir brauchen aber einen Pixelshader der aus Gr&#252;n Transparent macht.&lt;/p&gt;  &lt;p&gt;Dies nennt man fachspezfisch den ChromaKey f&#252;rs Alpha Blending. Entsprechend auch der Name ChromaKeyAlphaEffect. Der Download f&#252;r die installierbare MSI findet sich hier&lt;/p&gt;  &lt;p&gt;&lt;a title=&quot;http://code.msdn.microsoft.com/SL3ChromaKeyEffect/Release/ProjectReleases.aspx?ReleaseId=3900&quot; href=&quot;http://code.msdn.microsoft.com/SL3ChromaKeyEffect/Release/ProjectReleases.aspx?ReleaseId=3900&quot;&gt;http://code.msdn.microsoft.com/SL3ChromaKeyEffect/Release/ProjectReleases.aspx?ReleaseId=3900&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Leider ist der aktuelle Build 1.3 vom 9.Februar.2010 noch SL 3. Entsprechend ist Blend 4 und Visual Studio 2010 ein wenig mit der Aufgabe &#252;berfordert und man ben&#246;tigt etwas Handarbeit. Zun&#228;chst setzt man eine Referenz im Silverlight Projekt auf Synergist.Effects.dll. Dann kann man in Expression Blend im Reiter Assets den Chroma Key Alpha Effect auf das Video ziehen.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_4.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;233&quot; /&gt;&lt;/a&gt;    &lt;br /&gt;Im Property Dialog sollte dann entweder direkt in den Eigenschaften des ChromaAlphaEffect (siehe Bild) oder in den Eigenschaften des Videos im Effect Reiter die Farbe ausgew&#228;hlt werden k&#246;nnen.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_6.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_thumb_2.png&quot; width=&quot;244&quot; height=&quot;144&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Am besten geht das mit dem Color Picker des &#252;blichen Farbdialoges. Leider tritt hier der erste Bug zu Tage. Das zus&#228;tzliche Property Tolerance wird nicht angeboten. Damit kann man den Gr&#252;nbereich etwas aufweiten. M&#246;gliche Werte sind 0-1. Ganz gut trifft oft rund um 0,2.&lt;/p&gt;  &lt;p&gt;Aktuell sieht dann Lilly so aus.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_8.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_thumb_3.png&quot; width=&quot;244&quot; height=&quot;107&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Wenn man im XAML Source dann Tolerance setzt,&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&amp;lt;MediaElement   x:Name=&amp;quot;lilly1_wmv&amp;quot; Source=&amp;quot;lilly1.wmv&amp;quot; &lt;br /&gt;Stretch=&amp;quot;Fill&amp;quot; AutoPlay=&amp;quot;True&amp;quot; &lt;br /&gt;MediaEnded=&amp;quot;lilly1_wmv_MediaEnded&amp;quot; &amp;gt;
&amp;lt;MediaElement.Effect&amp;gt;
	&amp;lt;Synergist_Effects:ChromaKeyAlphaEffect 
       Tolerance=&amp;quot;0.2&amp;quot;
	ColorKey=&amp;quot;#FF9DE094&amp;quot;/&amp;gt;
    	&amp;lt;/MediaElement.Effect&amp;gt;
&amp;lt;/MediaElement&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; siehts in Blend so aus.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_10.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_thumb_4.png&quot; width=&quot;244&quot; height=&quot;120&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Visual Studio 2010 ist es im Ergebnis das gleiche. Allerdings lauff&#228;hig ist das ganze schon. Also ab&amp;#160; in den Browser und staunen.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_12.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/FreigestelltePersoneninSilverlightVideo_12A95/image_thumb_5.png&quot; width=&quot;244&quot; height=&quot;171&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Noch nicht perfekt und ich habe deswegen auf die Animation verzichtet aber ich glaube wir machen noch einen zweiten Dreh mit besseren Hintergrund. &lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Freigestellte-Personen-in-Silverlight-Video</link>
			<author>Hannes Preishuber</author>
			<pubDate>Thu, 22 Jul 2010 21:51:30 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>Blend</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Silverlight WCF Services 1x1
			</title>
			<description>&lt;p&gt;In den n&#228;chsten Blog Eintr&#228;gen werde ich meine Gedanken zum Thema Services mit Silverlight zu ordnen beginnen. Es gibt einfach zu viele Wege um Daten mit der Client Server Technologie Silverlight hin und her zu schicken. Leider sind die recht einfachen ASMX Web Services obsolet und in&amp;#160; WCF aufgegangen. Der gr&#246;&#223;te Unterschied ist das man WCF (Windows Communication Foundation) Dienste nicht mal so spa&#223;eshalber im Browser aufrufen kann. Erg&#228;nzend der Hinweis auf das &lt;a href=&quot;http://blogs.ppedv.de/bernhardg/archive/Silverlight-DataBinding-zu-WCF-Service---Teil-12&quot;&gt;Blog&lt;/a&gt; meines Kollegen Bernhard, der ein wahres WCF Genie ist.&lt;/p&gt;  &lt;p&gt;Zun&#228;chst einmal die Vorarbeit mit einer Datenklasse. &lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Imports&lt;/span&gt; System.Runtime.Serialization

&amp;lt;DataContract()&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt; person

    &lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; _FamName &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;
    &amp;lt;DataMember()&amp;gt;
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; FamName() &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
            &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; _FamName
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;Set&lt;/span&gt;(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; value &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;)
            _FamName = value
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Set&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt;

    &lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; _GebDat &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;
    &amp;lt;DataMember()&amp;gt;
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; GebDat() &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
            &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; _GebDat
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;Set&lt;/span&gt;(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; value &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;)
            _GebDat = value
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Set&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt;

    &lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; _bild &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;
    &amp;lt;DataMember()&amp;gt;
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; bild() &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
            &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; _bild
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Get&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;Set&lt;/span&gt;(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; value &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;String&lt;/span&gt;)
            _bild = value
        &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Set&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Wenn DataMember nicht dekoriert wird, gibt es sp&#228;ter beim aufrufen des Services einen deserialisierungsfehler in der Form InnerException: System.Runtime.Serialization.SerializationException. Das sind eben WCF Basics. Dann erstelle ich eine Business Objekt das mir eine Liste von Personen zur&#252;ck gibt.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt; BO1
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt; getPersonen() &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; List(Of person)
        &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; lofP &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; List(Of person)
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild1.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Maier&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;((&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;))})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild2.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Huber&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild3.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;M&#252;ller&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild4.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Gates&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild5.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Heuer&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild6.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Holesch&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild7.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;dela Rosa&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild8.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Jobs&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild9.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Hayat&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild10.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Hatahet&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        lofP.Add(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; person &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.bild = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;bild11.jpg&amp;quot;&lt;/span&gt;, .FamName = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Thyret&amp;quot;&lt;/span&gt;, .GebDat = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;01.13.1978&amp;quot;&lt;/span&gt;)})
        &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; lofP

    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ein WCF Service wird im Silverlight Projekt per Template Silverlight-Enabled-WCF-Service erstellt. Dieser Service ruft dann die Funktion auf, die die Personenliste erstellt. Per Dafult findet sich da immer die DoWork Prozedur.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;    &amp;lt;OperationContract()&amp;gt;
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt; GetAllPersons() &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; List(Of person)
        &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; bo &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; BO1
        &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; bo.getPersonen()
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Der Service ist im Browser aufrufbar. Mit dem Parameter WSDL erscheint auch die Beschreibung der Funktion und Objekte. Diese wird von Werkzeugen verwendet um Proxy Klassen erzeugen zu k&#246;nnen. Das sollten Sie f&#252;r einen ersten Test auf alle F&#228;lle tun.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/SilverlightWCFServices1x1_8D99/image_4.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/SilverlightWCFServices1x1_8D99/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;181&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Dann wechseln wir in das Silverlight Projekt und erstellen eine Service Referenz im Projekt Baum per Context Men&#252; Add Service.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/SilverlightWCFServices1x1_8D99/image_2.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/SilverlightWCFServices1x1_8D99/image_thumb.png&quot; width=&quot;244&quot; height=&quot;98&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In der Silverlight Anwendung wird dann eine Instanz der Proxy Klasse erzeugt, eine R&#252;cksprung Methode definiert und der Service aufgerufen. Vergessen Sie nicht, das Silverlight nur Asynchron arbeitet und deswegen nicht auf eine R&#252;ckgabe wartet.&amp;#160; Die eigentliche Liste von Personen wird dann per e.Result in der R&#252;cksprung Methode ausgelesen und einem Datagrid zugewiesen. Hier passiert eine wenig VB casting magic. Sie sollten wissen das&amp;#160; der Visual Studio Proxy Wizard immer aus Listen einen Typ ObservableCollection erzeugt. ich habe bereits hierzu ein paar &lt;a href=&quot;http://blogs.ppedv.de/hannesp/archive/WCF-Services-in-Silverlight-einbinden&quot;&gt;Worte&lt;/a&gt; verloren, das das auch anders geht.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; WCF1_Loaded(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Object&lt;/span&gt;, &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Windows.RoutedEventArgs) &lt;span style=&quot;color: blue&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Me&lt;/span&gt;.Loaded
        &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; svc &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; ServiceReference1.Service1Client
        &lt;span style=&quot;color: blue&quot;&gt;AddHandler&lt;/span&gt; svc.GetAllPersonsCompleted, &lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; fertig

        svc.GetAllPersonsAsync()
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;

&lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; fertig(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Object&lt;/span&gt;, &lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; ServiceReference1.GetAllPersonsCompletedEventArgs)
  SVC1.ServiceReference1.person)

        DataGrid1.ItemsSource = e.Result
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Silverlight-WCF-Services-1x1</link>
			<author>Hannes Preishuber</author>
			<pubDate>Sun, 11 Jul 2010 10:23:58 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>WCF</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    RIA Services binary, Json, Odata und SOAP Endpunkte
			</title>
			<description>&lt;p&gt;Mit Hilfe des Silverlight RIA Services Toolkit lassen sich zus&#228;tzliche Optionen der RIA Services nutzen.&lt;/p&gt;  &lt;li&gt;LinqToSql DomainService &lt;/li&gt;  &lt;li&gt;SOAP Endpoint &lt;/li&gt;  &lt;li&gt;JSON Endpoint&amp;#160; &lt;/li&gt;  &lt;li&gt;ASP.NET DomainDataSource Control    &lt;p&gt;In diesem Blog Eintrag betrachte ich einmal die M&#246;glichkeiten der serialisierung. Insgesamt kann man stand heute folgenden Formate w&#228;hlen.&lt;/p&gt; &lt;/li&gt;  &lt;li&gt;Binary &lt;/li&gt;  &lt;li&gt;OData &lt;/li&gt;  &lt;li&gt;SOAP &lt;/li&gt;  &lt;li&gt;JSON    &lt;p&gt;Allerdings muss in der Web.Config manuell die Konfiguration erweitert werden.&lt;/p&gt;    &lt;div style=&quot;background-color: white; color: black&quot;&gt;     &lt;pre&gt; &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;domainServices&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;endpoints&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;OData&amp;quot;&lt;/span&gt;
             &lt;span style=&quot;color: red&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;System.ServiceModel.DomainServices.Hosting.ODataEndpointFactory, &lt;br /&gt;System.ServiceModel.DomainServices.Hosting.OData, Version=4.0.0.0, Culture=neutral, &lt;br /&gt;PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
           &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;JSON&amp;quot;&lt;/span&gt;
                &lt;span style=&quot;color: red&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Microsoft.ServiceModel.DomainServices.Hosting.JsonEndpointFactory, &lt;br /&gt;Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, &lt;br /&gt;PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
           &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Soap&amp;quot;&lt;/span&gt;
             &lt;span style=&quot;color: red&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory, &lt;br /&gt;Microsoft.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, &lt;br /&gt;PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
 &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;endpoints&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;domainServices&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;

  &lt;p&gt;Der Aufruf f&#252;r eine JSon R&#252;ckgabe erfolgt in der Form &lt;/p&gt;
  &lt;font size=&quot;2&quot; face=&quot;Consolas&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Consolas&quot;&gt;
      &lt;p&gt;http://localhost:[port]/ClientBin/[Projektname]-Web-[DomainServiceklasse].svc/Json/[Methode]&lt;/p&gt;
    &lt;/font&gt;&lt;/font&gt;

  &lt;p&gt;Da die SVC Dateien nicht wirklich existieren sondern per IIS Modul Mapping behandelt werden kann der Pfad statt Clientbin auch z.B. Service lauten.&lt;/p&gt;

  &lt;p&gt;Wenn man den Traffic mit Fiddler mitschneidet kann man sehr gut erkennen wie das Json Format aufgebaut ist.&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/RIAServicesbinaryJsonOdataundSOAPEndpunk_F314/image_2.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/RIAServicesbinaryJsonOdataundSOAPEndpunk_F314/image_thumb.png&quot; width=&quot;565&quot; height=&quot;135&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

  &lt;p&gt;Die Aufrufe der einzelnen Methoden und die R&#252;ckgabe Datenmenge in KB im Vergleich&lt;/p&gt;

  &lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; width=&quot;562&quot;&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign=&quot;top&quot; width=&quot;458&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Consolas&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Consolas&quot;&gt;
              &lt;p&gt;..KoelnSL-Web-DomainServiceMD.svc/binary/GetOrdersDetails&lt;/p&gt;
            &lt;/font&gt;&lt;/font&gt;&lt;/td&gt;

        &lt;td valign=&quot;top&quot; width=&quot;102&quot;&gt;607K&lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign=&quot;top&quot; width=&quot;458&quot;&gt;
          &lt;p&gt;..KoelnSL-Web-DomainServiceMD.svc/Json/GetOrdersDetails&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign=&quot;top&quot; width=&quot;102&quot;&gt;563K&lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign=&quot;top&quot; width=&quot;458&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Consolas&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Consolas&quot;&gt;
              &lt;p&gt;..KoelnSL-Web-DomainServiceMD.svc/OData/GetOrdersDetails&lt;/p&gt;
            &lt;/font&gt;&lt;/font&gt;&lt;/td&gt;

        &lt;td valign=&quot;top&quot; width=&quot;102&quot;&gt;1109K&lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign=&quot;top&quot; width=&quot;458&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Consolas&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Consolas&quot;&gt;
              &lt;p&gt;..KoelnSL-Web-DomainServiceMD.svc/Soap/GetOrdersDetails&lt;/p&gt;
            &lt;/font&gt;&lt;/font&gt;&lt;/td&gt;

        &lt;td valign=&quot;top&quot; width=&quot;102&quot;&gt;erzeugt 400er Error&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;

  &lt;p&gt;Soap Abrufe sind leider im Browser nicht direkt m&#246;glich. Deshalb auch die Fehlermeldung. Um den Service bzw die Methode testweise aufzurufen k&#246;nnten man das Hilfstool WCFtestClient.exe verwenden. Leider unterst&#252;tzt dieses keine Domainservices. Also bleibt nur der Weg &#252;ber das Silverlight Projekt.&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/RIAServicesbinaryJsonOdataundSOAPEndpunk_F314/image_4.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/RIAServicesbinaryJsonOdataundSOAPEndpunk_F314/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;111&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;p&gt;Leider kompiliert meine L&#246;sung anschliessend nicht mehr. Selbst auf Nachfrage bei Microsoft konnte man adhoc das Problem nicht l&#246;sen. Die einzige Antwort das es aktuellere Bits der RIA Services und Silverlight (GDR) gibt hilft nicht, da ich daf&#252;r alles neu installieren muss und dann mit RC Bits arbeite die nirgendwo laufen. Entsprechend werde ich die L&#246;sung f&#252;r SOAP in einem sp&#228;teren Blog nachliefern.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/RIA-Services-binary-Json-Odata-und-SOAP-Endpunkte</link>
			<author>Hannes Preishuber</author>
			<pubDate>Thu, 08 Jul 2010 07:27:10 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Master Detail mit WCF RIA Services in 10 Sekunden
			</title>
			<description>&lt;p&gt;Die Headline stimmt nur bedingt, aber schliesslich muss ich meinen Artikel ja verkaufen &lt;img style=&quot;border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none&quot; class=&quot;wlEmoticon wlEmoticon-winkingsmile&quot; alt=&quot;Winking smile&quot; src=&quot;http://blogs.ppedv.de/data/MasterDetailmitWCFRIAServicesin10Sekunde_141D7/wlEmoticon-winkingsmile_2.png&quot; /&gt;. Am Ende ist es aber auch nicht ganz falsch. Wenn ein Silverlight Projekt mit RIA Services besteht, ist Master Detail tats&#228;chlich nur 1 Codezeile und 2 clicks entfernt.&lt;/p&gt;  &lt;p&gt;Zun&#228;chst einmal nehme ich die gute alte Nordwind Datenbank und die Tabellen Orders und OrderDetails als Ausgangspunkt und erstelle im Web Projekt mit Entity Framework ein Modell.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/MasterDetailmitWCFRIAServicesin10Sekunde_141D7/image_2.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/MasterDetailmitWCFRIAServicesin10Sekunde_141D7/image_thumb.png&quot; width=&quot;239&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Weiter geht es mit einer neuen Domain Service Klasse. Wie immer vorher kompilieren nicht vergessen und die Metadaten erzeugen lassen.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/MasterDetailmitWCFRIAServicesin10Sekunde_141D7/image_4.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/MasterDetailmitWCFRIAServicesin10Sekunde_141D7/image_thumb_1.png&quot; width=&quot;200&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In der DomainService Klasse erzeuge ich per copy paste eine weitere Queryklasse. Per Standard findet sich nur die GetOrders. Da ich ja noch die Details mit liefern m&#246;chte nenne ich die Funktion GetOrdersDetails. Wichtig ist per LINQ Query und dem Kommando Include die Kind Tabelle Order_Details einzubinden. Mit dem Attribut &amp;lt;Query&amp;gt; stelle ich sicher das sp&#228;ter im Data Designer die Query auch auftaucht.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt; &amp;lt;Query()&amp;gt; _
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt; GetOrdersDetails() &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; IQueryable(Of Orders)
        &lt;span style=&quot;color: blue&quot;&gt;Return&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Me&lt;/span&gt;.ObjectContext.Orders.Include(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;Order_Details&amp;quot;&lt;/span&gt;)
    &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Function&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Dann muss in den Metadaten (xxx.metadata.vb) noch der Schl&#252;ssel Property markiert werden. Dazu wird &amp;lt;Include()&amp;gt; vor den bereits vorhandenen Propertynamen vorgestellt.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;    &amp;lt;Include()&amp;gt;
        &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; Order_Details &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; EntityCollection(Of Order_Details)&lt;/pre&gt;
Seit VB 2010 braucht man daf&#252;r &#252;brigens keinen Unterstrich mehr *like`*. Dann wieder kompilieren. &lt;/div&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;In Visual Studio ins Silverligth Projekt wechseln und eine XAML Datei ausw&#228;hlen. Dann ist der Men&#252;punkt Data vorhanden. Dort einfach die Darstellungsform Datagrid einstellen und die Orders und die Order Details auf die Page ziehen.&lt;/div&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;&amp;#160;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/MasterDetailmitWCFRIAServicesin10Sekunde_141D7/image_8.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/MasterDetailmitWCFRIAServicesin10Sekunde_141D7/image_thumb_3.png&quot; width=&quot;244&quot; height=&quot;193&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Das fertige Ergebnis nach 9,67 Sekunden im Browser
  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/MasterDetailmitWCFRIAServicesin10Sekunde_141D7/image_6.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/MasterDetailmitWCFRIAServicesin10Sekunde_141D7/image_thumb_2.png&quot; width=&quot;244&quot; height=&quot;142&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Master-Detail-mit-WCF-RIA-Services-in-10-Sekunden</link>
			<author>Hannes Preishuber</author>
			<pubDate>Sun, 04 Jul 2010 23:07:28 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    klare Regeln frs tgliche Leben- Die sterreichische Ampel App mit Silverlight
			</title>
			<description>&lt;p&gt;Ich habe mir einen Wunschtraum erf&#252;llt. Eine &#246;sterreische Ampel als mini App. Da Windows Phone noch kein Silverlight unterst&#252;tzt, vorerst nur als Desktop Anwendung&lt;/p&gt;  &lt;p&gt;Was macht nun eine &#246;sterreichische Ampel so einmalig. Sie blinkt 3 mal Gr&#252;n bevor sie auf gelb schaltet! Diese Ampel kann uns nun den Arbeitsalltag vers&#252;ssen, gibt uns klare Richtlinien vor. Sinnlosses Starren auf den&amp;#160; Fortschrittsbalken ist nun endg&#252;ltig vorbei. Jetzt kommt sinnloses Starren auf die Ampel. Ich bitte um &#220;berweisung von 3,99 € pro Download. Reklamation und R&#252;ckgabe ausgeschlossen.&lt;/p&gt;  &lt;p&gt;Zun&#228;chst einmal das technsiche Konzept. Ich implementiere die Ampel als Usercontrol und nutze den Visual Statemanager um die Statusinformation Rot, Gelb und Gr&#252;n mit Animationen hinterlegen zu k&#246;nnen.&lt;/p&gt;  &lt;p&gt;Startpunkt ist das UI Design mit Blend. Es beginnt relativ harmlos mit einer Border, Farbverlauf und wie immer runden Ecken.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_2.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_thumb.png&quot; width=&quot;128&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Dann widme ich mich der ersten Lampe. Ein Kreis mit etwas dickerem Rand (Strockethickness 10) und zwei gegenl&#228;ufige Farbverl&#228;ufe im Graubereich erzeugen einen 3D Eindruck.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_4.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;164&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Da rein kommt dann nochmal ein kleinerer Kreis, der ein wenig Abstand zum &#228;usseren Rahmen hat auf den ersten Kreis. So das man den Hintergrund am Rand noch ein wenig sehen kann. Dieser Kreis wird rot gef&#228;rbt und bekommt einen im Zentrum leicht versetzten runden Farbverlauf. Das GradientBrushtool ( dicker Pfeil) aus der linken Toolleiste hilft dabei ungemein.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_6.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_thumb_2.png&quot; width=&quot;244&quot; height=&quot;161&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Um die die W&#246;lbung perfekt zu machen, wird Lichteinfall von oben simuliert. Dazu wird ein wei&#223;e, sehr transparente Elypse, dar&#252;ber gelegt. Das gleiche machen Comic Zeichner z.B. mit den gro&#223;en Heidi Augen um diese w&#228;ssrig aussehen zu lassen. Ich verwende hier 30% alpha blending und vers&#252;se das mit einem Effekt um ein unscharfe Kontur zu haben.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_8.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_thumb_3.png&quot; width=&quot;244&quot; height=&quot;139&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Dann werden die Ui Element in ein Canvas gepackt, kopiert und umgef&#228;rbt.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_10.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_thumb_4.png&quot; width=&quot;125&quot; height=&quot;244&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Weiter gehts mit dem Visual State Manager. Dort erzeuge ich eine Gruppe mit dem Namen Phasen und darin die drei States: rot, gelb und gruen. Dann kann jeder in jedem State und &#220;bergang&amp;#160; das UI animiert werden. Im wesentlichen werden die beiden anderen Kreise einfach schwarz gef&#228;rbt mit einem Delay von 0,2 Sekunden. Schliesslich leuchtet so eine antike Gl&#252;hbirne ja nach. LED Ampeln gibts in &#214;sterreich noch nicht. F&#252;r die Phase Gr&#252;n auf Gelb habe ich einen speziellen &#220;bergang definiert. Diese Animation l&#228;uft drei Sekunden und wechselt dabei von abwechselnd drei mal von Gr&#252;n nach Schwarz den SolidcolorBrush im Fill Attribut.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_12.png&quot;&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/e6577d942ef9_10A63/image_thumb_5.png&quot; width=&quot;420&quot; height=&quot;454&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Als n&#228;chstes wird das Usercontrol in eine weitere XAML Seite eingepackt. Dort gehts dann nur mehr mit puren Code zur Sache. Ein Timer wirft die Status&#228;nderungen an. Da die Ampelphasen ja unterschiedlich lang sind, brauch ich ein wenig Logik um die Timer Zeiten zu &#228;ndern.&amp;#160; Da die Gr&#252;n Blink Phase 3 Sekunden dauert muss die Gelb Phase 5 Sekunden sein um in Summe 2 Sekunden Gelb zu sehen. Ich denke der Code spricht auch ohne refactoring f&#252;r sich selbst&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; dp &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; DispatcherTimer
&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; status &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Integer&lt;/span&gt; = 0
&lt;span style=&quot;color: blue&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; page35_Loaded(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; System.Windows.RoutedEventArgs) &lt;span style=&quot;color: blue&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Me&lt;/span&gt;.Loaded
   dp.Interval = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; TimeSpan(0, 0, 10)
   &lt;span style=&quot;color: blue&quot;&gt;AddHandler&lt;/span&gt; dp.Tick, &lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; ticking
   VisualStateManager.GoToState(Ampel1, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;rot&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;True&lt;/span&gt;)
   status = 1
   dp.Start()
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; ticking(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; EventArgs)
   &lt;span style=&quot;color: blue&quot;&gt;Select&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Case&lt;/span&gt; status
    &lt;span style=&quot;color: blue&quot;&gt;Case&lt;/span&gt; 0
      VisualStateManager.GoToState(Ampel1, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;rot&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;True&lt;/span&gt;)
      dp.Interval = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; TimeSpan(0, 0, 10)
      status = 1
    &lt;span style=&quot;color: blue&quot;&gt;Case&lt;/span&gt; 1
      VisualStateManager.GoToState(Ampel1, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;gelb&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;True&lt;/span&gt;)
      dp.Interval = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; TimeSpan(0, 0, 2)
      status = 2
    &lt;span style=&quot;color: blue&quot;&gt;Case&lt;/span&gt; 2
      VisualStateManager.GoToState(Ampel1, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;gruen&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;True&lt;/span&gt;)
      dp.Interval = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; TimeSpan(0, 0, 10)
      status = 3
    &lt;span style=&quot;color: blue&quot;&gt;Case&lt;/span&gt; 3
      VisualStateManager.GoToState(Ampel1, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;gelb&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;True&lt;/span&gt;)
      dp.Interval = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; TimeSpan(0, 0, 5)
      status = 0
   &lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Select&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Jetzt habe ich nur mehr das Problem, wie komme ich an Ihr Geld. Bzw wie k&#246;nnen Sie ganz einfach die Anwendung starten?&lt;/p&gt;

&lt;p&gt;Dazu rufen Sie einfach folgende &lt;a href=&quot;http://www.ppedv.de/silverlightapps/atampel1.aspx&quot;&gt;Website&lt;/a&gt; auf. Per rechtsclick k&#246;nnen Sie diese auch lokal installieren.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/klare-Regeln-fuumlrs-taumlgliche-Leben--Die-Oumlsterreichische-Ampel-App-mit-Silverlight</link>
			<author>Hannes Preishuber</author>
			<pubDate>Thu, 01 Jul 2010 07:31:17 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>Blend</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Silverlight kann nun auch rechts click
			</title>
			<description>&lt;p&gt;In meiner aktuellen Silverlight Schulung wurde heute das Thema Mouse Events besprochen. Seit Silverlight 4 gibt es ja bekannterweise auch Events zur rechten Maustaste.&amp;#160; Also sollte theoretisch auch eine Textbox per Rechstclick ein Context Men&#252; anzeigen k&#246;nnen. Die Idee des Schulungs Teilnehmers sah ungef&#228;hr so aus.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TextBox&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;111&amp;quot;&lt;/span&gt;  &lt;span style=&quot;color: red&quot;&gt;MouseRightButtonUp&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;textBox1_MouseRightButtonUp&amp;quot;&lt;/span&gt;  &lt;span style=&quot;color: red&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;textBox1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;180&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Allerdings funktioniert das nicht, weil die Textbox das Event als behandelt markiert und damit nicht mehr weiter reicht. Um ein Context Men&#252; zu erstellen gibt es aber seit Silverligth 4 im seperat erh&#228;ltlichen Toolkit eine passende L&#246;sung. Mit dem ContectMenuService wird ala Tooltip die Textbox um zus&#228;tzliche Funktion erweitert.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/Silverlightkannnunauchrechtsclick_13228/image_2.png&quot;&gt;&lt;img style=&quot;border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px&quot; class=&quot;wlDisabledImage&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;http://blogs.ppedv.de/data/Silverlightkannnunauchrechtsclick_13228/image_thumb.png&quot; width=&quot;211&quot; height=&quot;121&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Das Context Men&#252; funktioniert genauso wie in WPF. Es besteht aus Menuitems. Pro Men&#252;punkt ein Item. Dieses wiederum aus einem Header, der &#252;blicherweise den Men&#252;text darstellt. Optisch aufgepeppt wird &#252;ber ein Unterelement MenuItem.Icon per Image Element. Das Attribut Icon im MenuItem Element kann daf&#252;r nicht genutzt werden. F&#252;r den Trennstrich gibt es das Seperator Element. &lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TextBox&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;30&amp;quot;&lt;/span&gt;  &lt;span style=&quot;color: red&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Left&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;161,36,0,0&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: red&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;textBox1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;180&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
  &amp;lt;toolkit:ContextMenuService.ContextMenu&amp;gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ContextMenu&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;MenuItem&lt;/span&gt;
          &lt;span style=&quot;color: red&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Hyperlink&amp;quot;&lt;/span&gt;
          &lt;span style=&quot;color: red&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;MenuItem1_Click&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
          &amp;lt;toolkit:MenuItem.Icon&amp;gt;
          &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Image&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Source&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Images/link.png&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Image&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
          &amp;lt;/toolkit:MenuItem.Icon&amp;gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Separator&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;MenuItem&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;drucken&amp;quot;&lt;/span&gt;
        &lt;span style=&quot;color: red&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;MenuItem2_Click&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
          &amp;lt;toolkit:MenuItem.Icon&amp;gt;
          &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Image&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Source&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Images/print.png&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Image&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
          &amp;lt;/toolkit:MenuItem.Icon&amp;gt;
     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;MenuItem&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Header&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;speichern&amp;quot;&lt;/span&gt;
          &lt;span style=&quot;color: red&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;MenuItem3_Click&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;IsEnabled&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;True&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
          &amp;lt;toolkit:MenuItem.Icon&amp;gt;
          &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Image&lt;/span&gt; &lt;span style=&quot;color: red&quot;&gt;Source&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;quot;Images/save.png&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;Image&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
          &amp;lt;/toolkit:MenuItem.Icon&amp;gt;
     &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;toolkit&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;ContextMenu&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;
 &amp;lt;/toolkit:ContextMenuService.ContextMenu&amp;gt;
&lt;span style=&quot;color: blue&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515&quot;&gt;TextBox&lt;/span&gt;&lt;span style=&quot;color: blue&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
  &lt;br /&gt;In diesem Beispiel werden einzelne Events pro Men&#252;punkt deklariert. Denkbar ist auch per Commands zu arbeiten. Dann wird das Attribut Command bzw CommandParameter verwendet.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Silverlight-kann-nun-auch-rechts-click</link>
			<author>Hannes Preishuber</author>
			<pubDate>Tue, 29 Jun 2010 22:33:24 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>
			</category>
			
		</item>
	
	        </channel>
		</rss>
	
    
    

