<?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>Wed, 19 Jun 2013 10:18:37 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>
			    [cosmin dumitru]
			    Unified Messaging Tools von Visendo Software   Ein berblick
			</title>
			<description>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;F&#252;r alle, die neu hier sind: Ein kurzer &#220;berblick &#252;ber uns und unserer Produkte. &lt;/p&gt;  &lt;p&gt;Wir stehen f&#252;r h&#246;chstes technisches Know-How: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;mehr als 13 Jahre Erfahrung im Bereich Electronic Communications &lt;/li&gt;    &lt;li&gt;Microsoft Gold Partner mit 3 Microsoft Kompetenzen – ISV, Hardware Solutions, Unified Messaging &lt;/li&gt;    &lt;li&gt;Technology Partner von Funkwerk, Lancom, Dialogic, TE-Systems, AASTRA &lt;/li&gt;    &lt;li&gt;&lt;b&gt;Visendo Software&lt;/b&gt; ist in Wikipedia - &lt;a href=&quot;http://en.wikipedia.org/wiki/Fax_server#List_of_fax_servers&quot;&gt;http://en.wikipedia.org/wiki/Fax_server#List_of_fax_servers&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;    &lt;p&gt;&lt;i&gt;&lt;/i&gt;&lt;/p&gt; Alle unsere Produkte     &lt;ul&gt;   &lt;li&gt;bieten volle 64-Bit Unterst&#252;tzung &lt;/li&gt;    &lt;li&gt;24 Monate kostenlosen Support &lt;/li&gt;    &lt;li&gt;haben eine automatische Update-Funktion &lt;/li&gt;    &lt;li&gt;k&#246;nnen in virtuellen Umgebungen eingesetzt werden (Hyper-V, VMWARE, Virtual Box) &lt;/li&gt;    &lt;li&gt;unterst&#252;tzen die neuesten Betriebssysteme (Windows 7, Windows 2008 Server, Windows 2008 Server R2, Windows SBS 2011 ) und sind als “Designed for Windows” zertifiziert &lt;/li&gt;    &lt;li&gt;k&#246;nnen mit den neuesten SMTP-Servern betrieben werden (Exchange 2007, Exchange 2010, Postfix ) &lt;/li&gt;    &lt;li&gt;haben eine transparente Architektur und Backend-Unterst&#252;tzung, so dass sie in jeder Umgebung eingesetzt werden k&#246;nnen ( SQL, Oracle, MySQL) &lt;/li&gt;    &lt;li&gt;bieten Enterprise Platform Integration mit Office 2010, SharePoint, Windows Azure und SAP &lt;/li&gt;    &lt;li&gt;sind 100% Green IT: verringerter Energieverbrauch, um einen geringen Carbon Footprint zu erzeugen &lt;/li&gt;    &lt;li&gt;k&#246;nnen in 5-10 Minuten installiert oder migriert werden &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Teil I: Fax-Software &lt;/h2&gt;  &lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; width=&quot;697&quot;&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;450&quot;&gt;         &lt;p&gt;&lt;a href=&quot;http://www.visendo.com/de/FaxServerMicrosoftExchange.aspx&quot;&gt;Fax- und Dokumentmanagement-L&#246;sungen (Produkt&#252;bersicht)&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;          &lt;ul&gt;           &lt;li&gt;Faxe empfangen/senden und per Mail, ins Dateisystem oder an den Drucker weiterleiten &lt;/li&gt;            &lt;li&gt;M&#228;chtiges Regelsystem f&#252;r spezielle Weiterleitungsregeln &lt;/li&gt;            &lt;li&gt;Elektronische Dokumente als Fax versenden &lt;/li&gt;            &lt;li&gt;VoIP, Messaging Gateways, FOIP &lt;/li&gt;            &lt;li&gt;Integration              &lt;ul&gt;               &lt;li&gt;Office 2007 / 2010 &lt;/li&gt;                &lt;li&gt;SharePoint 2007 / 2010 &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;            &lt;li&gt;Clients: Fax Drucker, Web, Mobile (Android, I-Pad, I-Phone, Windows Phone 7 &lt;/li&gt;         &lt;/ul&gt;       &lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;28&quot;&gt;&amp;#160;&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;217&quot;&gt;         &lt;p&gt;&lt;a href=&quot;http://www.visendo.com/documents/fax/visendo_Fax_Virtualization_case_study_de.pdf&quot;&gt;Weitere Informationen&lt;/a&gt; &lt;/p&gt;          &lt;p&gt;&lt;i&gt;Visendo Fax Server &lt;/i&gt;&lt;/p&gt;          &lt;ul&gt;           &lt;li&gt;&lt;i&gt;&lt;a href=&quot;http://www.visendo.com/documents/fax/visendo_Fax_Virtualization_case_study_de.pdf&quot;&gt;Virtualisierung&lt;/a&gt;&lt;/i&gt; &lt;/li&gt;            &lt;li&gt;&lt;i&gt;&lt;a href=&quot;http://www.visendo.com/documents/fax/fax_applications_Sheet_Lancom_de.pdf&quot;&gt;Lancom applications sheet&lt;/a&gt;&lt;/i&gt; &lt;/li&gt;            &lt;li&gt;&lt;i&gt;&lt;a href=&quot;http://www.visendo.com/documents/fax/fax_applications_Sheet_funkwerk_de.pdf&quot;&gt;Funkwerk applications sheet&lt;/a&gt;&lt;/i&gt; &lt;/li&gt;            &lt;li&gt;&lt;i&gt;&lt;a href=&quot;http://www.visendo.com/de/faxserverclients.aspx&quot;&gt;Fax Server: Clients&lt;/a&gt; &lt;/i&gt;&lt;/li&gt;            &lt;li&gt;&lt;i&gt;&lt;a href=&quot;http://www.visendo.com/Documents/fax/Visendo_fax_Sharepoint.pdf&quot;&gt;Sharepoint Integration&lt;/a&gt;&lt;/i&gt; &lt;/li&gt;            &lt;li&gt;&lt;i&gt;&lt;a href=&quot;http://www.visendo.com/Documents/fax/iFilter_TiFF.pdf&quot;&gt;Dokumentmanagement mit ITiff-Filter&lt;/a&gt;&lt;/i&gt; &lt;/li&gt;         &lt;/ul&gt;          &lt;p&gt;&lt;i&gt;Visendo Fax@Mail10&lt;/i&gt;&lt;/p&gt;          &lt;ul&gt;           &lt;li&gt;&lt;i&gt;&lt;a href=&quot;mailto:Fax@Mail f&amp;uuml;r KMU&quot;&gt;Fax@Mail f&#252;r KMU&lt;/a&gt;&lt;/i&gt; &lt;/li&gt;            &lt;li&gt;&lt;i&gt;&lt;a href=&quot;http://www.visendo.com/documents/fax/faxatmail2008_FAQ_de.pdf&quot;&gt;Fax@Mail FAQ&lt;/a&gt;&lt;/i&gt; &lt;/li&gt;         &lt;/ul&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;</description>
			<link>http://blogs.ppedv.de/cosmind/archive/Unified-Messaging-Tools-von-Visendo-Software--ndash-Ein-Uumlberblick</link>
			<author>cosmin dumitru</author>
			<pubDate>Wed, 15 Jun 2011 16:26:10 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Ganzer Bildschirm Voller Screen
			</title>
			<description>&lt;p&gt;Es ist ein leichtes eine Silverlight Anwendung in den FullScreen Modus zu schalten.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;Application.Current.Host.Content.IsFullScreen = &lt;span style=&quot;color: blue&quot;&gt;True&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Es gibt allerdings Einschr&#228;nkungen. So kann der Benutzer keine Texteingaben mehr durchf&#252;hren und man muss diese Codezeile in&amp;#160; ein vom Benutzer initiiertes Event legen. Button Click ist so eines.&lt;/p&gt;

&lt;p&gt;Den FullScreen kann der Benutzer mit ESC wieder verlassen. Ausnahme ist wenn man per ALT TAB (oder auch sonst wie) die aktive Anwendung wechseln m&#246;chte. Dann ist der Fullscreen&amp;#160; Modus ganz von alleine weg. Wenn man dies ver&#228;ndern m&#246;chte hilft folgendes Silverlight Beispiel Code&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;Application.Current.Host.Content.FullScreenOptions =
        System.Windows.Interop.FullScreenOptions.StaysFullScreenWhenUnfocused&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Der Silverlight User erh&#228;lt nun einen Dialog ob er dieses Verhalten erlauben m&#246;chte und kann seine Antwort auch dauerhaft abspeichern.&lt;/p&gt;



&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/Windows-Live-Writer/ganzer-Bildschirm_10D1D/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/Windows-Live-Writer/ganzer-Bildschirm_10D1D/image_thumb.png&quot; width=&quot;422&quot; height=&quot;159&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wenn die Silverlight Anwendung OOB ( Out Off Browser) mit elevated Priviliges l&#228;uft, kommt der Dialog nicht und der Benutzer kann sogar Tastatureingaben durchf&#252;hren.&lt;/p&gt;

&lt;p&gt;Der Zoom Faktor des Browser wird &#252;brigens im Vollbild Modus ignoriert. Wenn man das wissen und nutzen m&#246;chte, gibt es im Content.ZoomFaktor den Vergr&#246;&#223;erungswert als Double zur&#252;ck. Dies und noch viel mehr lernen Sie bei den &lt;a href=&quot;http://blogs.ppedv.de/hannesp/archive/Anonyme-Typen-an-ein-Silverlight-Datagrid-binden&quot;&gt;Silverlight Schulungen&lt;/a&gt; der ppedv.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Ganzer-Bildschirm-Voller-Screen</link>
			<author>Hannes Preishuber</author>
			<pubDate>Wed, 17 Nov 2010 19:26:02 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>.Net</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Anonyme Typen an ein Silverlight Datagrid binden
			</title>
			<description>&lt;p&gt;Was soll ich sagen, man lernt nie aus. In meiner aktuellen &lt;a href=&quot;http://www.ppedv.de/schulung/kurse/silverlight.aspx&quot;&gt;Silverlight Schulung&lt;/a&gt; sa&#223; ein Kurs Teilnehmer der es genau wissen wollte. Mein Silverlight Beispiel zeigt wie man mit minimalen Aufwand einen RSS Feed (hier n-tv) an ein Datagrid bindet. Daf&#252;r braucht man eine Klasse (hier rss) mit Eigenschaften (hier title) die Public sind. Struct geht schon mal nicht.&lt;/p&gt;  &lt;p&gt;Der sehr einfache Silverlight Prototyp:&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;span style=&quot;color: blue&quot;&gt;Handles&lt;/span&gt; Button1.Click
        &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.DownloadStringCompleted, &lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; fertig
        wc.DownloadStringAsync(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; Uri(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;xmlfile1.xml&amp;quot;&lt;/span&gt;, UriKind.Relative))
    &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;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; DownloadStringCompletedEventArgs)
        &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; xml = XDocument.Parse(e.Result)
        &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; query = &lt;span style=&quot;color: blue&quot;&gt;From&lt;/span&gt; x &lt;span style=&quot;color: blue&quot;&gt;In&lt;/span&gt; xml.Descendants(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;item&amp;quot;&lt;/span&gt;)
                    &lt;span style=&quot;color: blue&quot;&gt;Select&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; rss &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.titel = x.&amp;lt;title&amp;gt;.Value}
        DataGrid1.ItemsSource = query
    &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;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Class&lt;/span&gt; rss
    &lt;span style=&quot;color: blue&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Property&lt;/span&gt; titel &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;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;Die Ausgabe in der Silverlight Anwendung dann ungef&#228;hr so.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/Windows-Live-Writer/b6c41e44f5c0_106A5/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/Windows-Live-Writer/b6c41e44f5c0_106A5/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;108&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Der liebe Silverlight Kurs Teilnehmer war faul und wollte es mit anonymen Typen versuchen also ohne die RSS Klasse zu erstellen ala&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; query = &lt;span style=&quot;color: blue&quot;&gt;From&lt;/span&gt; x &lt;span style=&quot;color: blue&quot;&gt;In&lt;/span&gt; xml.Descendants(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;item&amp;quot;&lt;/span&gt;)
                    &lt;span style=&quot;color: blue&quot;&gt;Select&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;With&lt;/span&gt; {.titel = x.&amp;lt;title&amp;gt;.Value}
        DataGrid1.ItemsSource = query&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Das Ergbebnis dann&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/Windows-Live-Writer/b6c41e44f5c0_106A5/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/Windows-Live-Writer/b6c41e44f5c0_106A5/image_thumb.png&quot; width=&quot;244&quot; height=&quot;156&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Meine Antwort ist halt so. Anonym geht eben nicht da diese als internal deklariert sind und deshalb nicht sichtbar. Da mein Teilnehmer mit Testing ganz versiert war wusste er das man innen nach au&#223;en kehren kann mit &lt;strong&gt;InternalsVisibleTo&lt;/strong&gt;. Dies muss man in der Datei AssemblyInfo.vb deklarieren. &#220;blicherweise befindet sich diese im Verzeichnis Properties der Silverlight Anwendung. Wenn nicht vorhanden einfach anlegen und folgendes reintippen.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;&amp;lt;Assembly: System.Runtime.CompilerServices.InternalsVisibleTo(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;System.Windows&amp;quot;&lt;/span&gt;)&amp;gt; &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Und schwupp gehts auch anonym.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Anonyme-Typen-an-ein-Silverlight-Datagrid-binden</link>
			<author>Hannes Preishuber</author>
			<pubDate>Wed, 17 Nov 2010 18:53:21 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>.Net</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Silverlight MCP 71-506
			</title>
			<description>&lt;p&gt;So heute habe ich nun die Beta Pr&#252;fung zum Silverlight MCP gemacht. Habe ich bestanden? Will ich mal hoffen. Als Beta Tester erf&#228;hrt man das erst sp&#228;ter. Leider darf ich nichts zum Inhalt sagen. Ist alles NDA. War jedenfalls wirklich schwierig. So einen k&#252;rzen &#220;berblick will ich Euch dennoch geben. Durchaus einige WCF Fragen und gar nichts zu RIA Services. Auch gar nichts zu Blend.&amp;#160; Animationen per Hand (wer macht das schon). In meinem Fall habe ich die VB.NET Variante gew&#228;hlt. Schwierig waren vor allem die langen Fragen. Wenn man &#252;ber zwei Bildschirme scrollen muss ist es recht m&#252;hsam den &#220;berblick zu behalten. Auch war ein paar Tricks eingebaut, wo man die genaue Fragestellung lesen musste. Oft steht aber in der Frage auch &#252;berfl&#252;ssiges Blabla und man schaut am besten gleich auf die Antworten ob da offensichtlich unsinniges dabei ist. &#220;berrascht hat mich auch der Umfang zu iCommand und eine Routing Fragen (aus dem Navigation Application Template). Die Databinding Sache empfand ich wieder als leicht. Wenn dann die Frage zu leicht ist suche ich immer den Haken. Keine Ahnung on da einer ist. Da ich die Pr&#252;fung in Englisch machen musste war manchmal nicht ganz klar was die eigentliche Bedeutung ist. Ein Lexikon hilft da auch nicht. &lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://www.microsoft.com/learning/en/us/exam.aspx?ID=70-506&amp;amp;locale=en-us#tab2&quot;&gt;Inhalt&lt;/a&gt; ist aber ohnehin schon public. Allerdings nicht ganz komplett. Der Begriff CollectionViewSource fehlt auf der Seite &lt;img style=&quot;border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none&quot; class=&quot;wlEmoticon wlEmoticon-winkingsmile&quot; alt=&quot;Zwinkerndes Smiley&quot; src=&quot;http://blogs.ppedv.de/data/SilverlightMCP_BF3D/wlEmoticon-winkingsmile_2.png&quot; /&gt;.&lt;/p&gt;  &lt;p&gt;Wer die Pr&#252;fung besteht hat nachgewiesen &#252;berdurchschnittliches Silverlight Know How. Kritik Punkt ist, das manche Fragen so exotisch sind (zb Assembly Caching Detail) das wenn ich das Feature mal alle 3 Monate brauche, ich einfach in der Doku nachlese.&lt;/p&gt;  &lt;p&gt;Public Solls ab Anfang Januar 2011 sein.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Silverlight-MCP-71-506</link>
			<author>Hannes Preishuber</author>
			<pubDate>Fri, 15 Oct 2010 13:50:55 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    MP3 download mit Silverlight
			</title>
			<description>&lt;p&gt;Nein dies ist kein Filesharing Anleitung um illegale MP3 Musik zu downloaden. Ich schreibe grad einen Vokabeltrainer f&#252;r meinen Sohn. Dabei soll auch die Aussprache trainiert werden. Leo.org bietet neben &#220;bersetzung auch den Service den Englischen Text vorzulesen. F&#252;r meine Lernanwendung m&#246;chte ich aber gelernte Vokabel speichern. Also das MP3 per Download im Isolatedstorage speichern. Die Download URL ist relativ simpel das gesprochene Wort mit der Endung mp3. Mittels dem Webclient wird ein asynchroner Download gestartet. Da es sich um bin&#228;re Daten handelt macht ein Stream mehr Sinn. Diesen erh&#228;lt man per Openreadcompleted.&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; url &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;http://www.leo.org/dict/audio_en/&amp;quot;&lt;/span&gt; + txtenglisch.Text + &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;.mp3&amp;quot;&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; mp3fertig
wc.OpenReadAsync(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; Uri(url, UriKind.Absolute)))&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Wenn nun der Download der MP3 Datei fertig ist, muss man sich &#252;berlegen wie man die Datei speichert. Da gibt&#39;s im wesentlichen nur die Methode im IsolatedStorage. F&#252;r m&#246;glichst kurzen Code hole ich mir die L&#228;nge des Streams &#252;ber einen kleinen Umweg StreamResourceInfo. Dann muss man Bin&#228;r lesen und schlie&#223;lich Bin&#228;r schreiben.&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; mp3fertig(&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; OpenReadCompletedEventArgs)
  &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; srInfo = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; StreamResourceInfo(e.Result, &lt;span style=&quot;color: blue&quot;&gt;Nothing&lt;/span&gt;)
  &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; sr &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; BinaryReader = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; BinaryReader(srInfo.Stream)
  &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; iosr &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; IsolatedStorageFileStream = iso.OpenFile(txtenglisch.Text + &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;.mp3&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(iosr)
        bw.Write(sr.ReadBytes(srInfo.Stream.Length))
     &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;
 sr.Close()
&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;Schlie&#223;lich noch der Hinweis. Wenn der Platz&amp;#160; (1 MB) nicht reichen sollte, kann dieser vergr&#246;&#223;ert werden. Der Benutzer muss das aber noch best&#228;tigen. IncreaseQuotaTo(1000000)&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/MP3-download-mit-Silverlight</link>
			<author>Hannes Preishuber</author>
			<pubDate>Mon, 04 Oct 2010 18:35:12 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Silverlight</category><category>.Net</category><category>VB</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    die Zeichen mehren sich
			</title>
			<description>&lt;p&gt;Bill Gates kommt zur&#252;ck. Zumindest in Outlook 2010 und dem social Connector.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/afa051e18bd1_D75A/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/afa051e18bd1_D75A/image_thumb.png&quot; width=&quot;504&quot; height=&quot;202&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Ich habs mit Expression Design vektorisiert.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;      &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/afa051e18bd1_D75A/image_6.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/afa051e18bd1_D75A/image_thumb_2.png&quot; width=&quot;244&quot; height=&quot;228&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Die Zeichen mehren sich, Bill Gates kommt zur&#252;ck.&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/die-Zeichen-mehren-sich</link>
			<author>Hannes Preishuber</author>
			<pubDate>Fri, 01 Oct 2010 15:31:37 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			Design</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Silverlight Socket Client
			</title>
			<description>&lt;p&gt;In einem fr&#252;heren &lt;a href=&quot;http://blogs.ppedv.de/hannesp/archive/Socket-Server-mit-VB.NET&quot;&gt;Post&lt;/a&gt; habe ich beschrieben, wie man einen einfachen Socket Server baut. Dieses mal will ich den Service konsumieren. Eine Socket Service Kommunikation ist extrem effizient. Allerdings m&#252;ssen die verwendeten Ports in allen beteiligten Firewalls auch frei geschalten sein. Silverlight auferlegt sich zudem eine k&#252;nstliche Beschr&#228;nkung auf den Bereich 4502-4534. Noch viel schwerwiegender ist, das man bei der TCP Socket Kommunikation sehr schnell in Cross Domain Szenarien landet. Dann erh&#228;lt man Security Exceptions, au&#223;er die Anwendung l&#228;uft OOB full trusted. F&#252;r allen jene denen diese Beschreibung noch nicht verwirrend genug ist: Wenn die Anwendung im Browser l&#228;uft muss eine ClientAccessPolicy.XML Datei angelegt werden, die dann von Silverlight ungefragt angefordert wird. Format und Inhalt ungef&#228;hr so.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;&amp;lt;?xml version=&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding=&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;?&amp;gt;
&amp;lt;access-policy&amp;gt;
  &amp;lt;cross-domain-access&amp;gt;
    &amp;lt;policy&amp;gt;
      &amp;lt;allow-&lt;span style=&quot;color: blue&quot;&gt;from&lt;/span&gt; http-request-headers=&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt;&amp;gt;
        &amp;lt;domain uri=&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt; /&amp;gt;
      &amp;lt;/allow-&lt;span style=&quot;color: blue&quot;&gt;from&lt;/span&gt;&amp;gt;
      &amp;lt;grant-&lt;span style=&quot;color: blue&quot;&gt;to&lt;/span&gt;&amp;gt;
        &amp;lt;socket-resource port=&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;4502-4534&amp;quot;&lt;/span&gt; protocol=&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;tcp&amp;quot;&lt;/span&gt; /&amp;gt;
      &amp;lt;/grant-&lt;span style=&quot;color: blue&quot;&gt;to&lt;/span&gt;&amp;gt;
    &amp;lt;/policy&amp;gt;
  &amp;lt;/cross-domain-access&amp;gt;
&amp;lt;/access-policy&amp;gt; &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Der vorl&#228;ufige H&#246;hepunkt ist, das Silverlight ab Version 4 versucht diese Datei auf Port 943 anzufordern. Daf&#252;r m&#252;sste man nun noch einen extra Socket Server schreiben der auf diesem Port lauscht und die Datei &#252;bertr&#228;gt. Ist m&#252;hsam und deswegen gibt es wohl nun die Zweitm&#246;glichkeit die Datei in das root des Webservers zu legen und per http auszuliefern. Allerdings muss man Silverlight das im Code noch mitteilen (SocketClientAccessPolicyProtocol.Http) wie wir gleich im folgenden Code sehen werden. Erlaubt sei noch der Hinweis das dies mit dem WebDev Server aus Visual Studio nicht geht, weil dieser auf einen zuf&#228;lligen Port lauscht und nicht auf 80. &lt;/p&gt;

&lt;p&gt;Weiter gehts mit der Initialisierung der Socket Verbindung.&amp;#160;&amp;#160; Die Sache mit der IP Adresse ist ein wenig m&#252;hsam und muss &#252;ber den DNS Endpoint gel&#246;st werden um rauszukriegen auf welcher Website die Anwendung l&#228;uft. Am Ende wird versucht die Verbindung herzustellen.&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; sock &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; Socket
&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;Handles&lt;/span&gt; Button1.Click
    &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; ep &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; DnsEndPoint =
    &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; DnsEndPoint(Application.Current.Host.Source.DnsSafeHost, 4506)
    sock = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; Socket(AddressFamily.InterNetwork,
       SocketType.Stream, ProtocolType.Tcp)
    &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; args &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; SocketAsyncEventArgs = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; SocketAsyncEventArgs()
    args.RemoteEndPoint = ep
    args.SocketClientAccessPolicyProtocol = &lt;br /&gt;SocketClientAccessPolicyProtocol.Http &lt;span style=&quot;color: green&quot;&gt;&#39;Clientaccesspolicy&lt;/span&gt;
    &lt;span style=&quot;color: blue&quot;&gt;AddHandler&lt;/span&gt; args.Completed, &lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; onSocketConnect
    sock.ConnectAsync(args)
&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;Da das ganze asynchron l&#228;uft, wie bei Silverlight &#252;blich, ben&#246;tigt man die Funktion &lt;em&gt;onSocketConnect&lt;/em&gt;, die aufgerufen wird sobald die Verbindung besteht. Jetzt wirds ein wenig Tricky. Um die eingehenden Daten zu erhalten, brauchen wir noch ein zweites Event &lt;em&gt;OnSocketEmpfang&lt;/em&gt;. Da dies auch am Completed Event der SocketArgs h&#228;ngt, habe ich die Events durch deregistrieren und registrieren ausgetauscht. Ob dies der beste Weg ist, ist mir nicht bekannt. Zumindest habe ich auf an anderer Stelle &#228;hnliche Ans&#228;tze gefunden. Nun gehts ans Empfangen mit ReceiveAsync.&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; onSocketConnect(&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; SocketAsyncEventArgs)
  &lt;span style=&quot;color: blue&quot;&gt;If&lt;/span&gt; sock.Connected &lt;span style=&quot;color: blue&quot;&gt;Then&lt;/span&gt;
     &lt;span style=&quot;color: blue&quot;&gt;RemoveHandler&lt;/span&gt; e.Completed, &lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; onSocketConnect
     &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; resp(1024) &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Byte&lt;/span&gt;
     e.SetBuffer(resp, 0, resp.Length)
     &lt;span style=&quot;color: blue&quot;&gt;AddHandler&lt;/span&gt; e.Completed, &lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; onSocketEmpfang
     sock.ReceiveAsync(e)
  &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 dann ab und zu mal Sekunden in der Form 40 oder so eintrudeln, landen wir im OnSocketEmpfang. Die Daten stehen zwar freundlicherweise im e.Buffer, aber leider befinden wir uns im Background Thread. Entsprechend muss per BeginInvoke ein Delegate definiert werden die eine Methode aufruft die im UI Thread l&#228;uft.&amp;#160; Dabei werden die Argumente e als Parameter &#252;bergeben. Schlussendlich rufe ich wieder den ReceiveAsync Befehl auf, weil die Daten regelm&#228;&#223;ig bis zum Sankt Nimmerleinstag kommen.&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; onSocketEmpfang(&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; SocketAsyncEventArgs)
        Dispatcher.BeginInvoke&lt;br /&gt;(&lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; Action(Of SocketAsyncEventArgs)(&lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; updateUI), e)
        sock.ReceiveAsync(e)
&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;Der Vollst&#228;ndigkeit halber noch der Teil der letztendlich eine TextBox im Frontend aktualisiert.&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; updateUI(&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; SocketAsyncEventArgs)
   TextBlock1.Text = &lt;br /&gt;Encoding.UTF8.GetString(e.Buffer, 0, e.BytesTransferred) + &lt;br /&gt;Environment.NewLine
&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;Wer keine Erfahrung mit dem synchronsieren von Threads hat und das f&#252;r Teufelszeug h&#228;lt, soll mal in die app.xaml.vb oder app.xaml.cs blicken. Dort wird das globale Fehlerhandling genau so realisiert. Mit Hilfe einer Lambda Expression noch etwas eleganter codieren, obs lesbarer ist mag jeder selbst entscheiden.&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;Dispatcher.BeginInvoke(
 &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; Action(Of SocketAsyncEventArgs)(&lt;br /&gt;&lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;()
     TextBlock1.Text += &lt;br /&gt;Encoding.UTF8.GetString(e.Buffer, 0, e.BytesTransferred) +
Environment.NewLine
&lt;span style=&quot;color: blue&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt;), e)&lt;/pre&gt;
&lt;/div&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Silverlight-Socket-Client</link>
			<author>Hannes Preishuber</author>
			<pubDate>Thu, 30 Sep 2010 23:03:32 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			.Net</category><category>Silverlight</category><category>XAML</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Socket Server mit VB.NET
			</title>
			<description>&lt;p&gt;Um ein gr&#246;&#223;eres Ziel zu verfolgen musste ich einen Socket Server schreiben. Tendenziell wird man bei Server an einen L&#246;sungsansatz mit Service denken. Ich nehme aber eine einfach Winforms Anwendung, weil mein Server nur Sinn macht wenn ein Benutzer angemeldet ist. Im weitesten Sinn &#252;berwacht mein Socket Server ein St&#252;ck Hardware und meldet Daten in einer Art Event an eine Silverlight Anwendung. Die Implementierung erfolgt auf Alpha Prototyp Level. Also sicher noch erhebliches Refactoring Potential. Ich war wirklich faul und habe mich auch auf die vorhandenen Steuerelemente gest&#252;rzt und eben ein Timer Control (Timer1) auf das Formular gezogen.&lt;/p&gt;  &lt;p&gt;Der Socket Server lauscht auf Port 5406, weil dies im Bereich der von Silverlight nutzbaren Ports liegt.&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;tcpL = &lt;span style=&quot;color: blue&quot;&gt;New&lt;/span&gt; TcpListener(IPAddress.Parse(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;127.0.0.1&amp;quot;&lt;/span&gt;), 4506)
tcpL.Start()
tcpL.BeginAcceptSocket(&lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; onConnect, &lt;span style=&quot;color: blue&quot;&gt;Nothing&lt;/span&gt;)&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Der Listener und auch der Client (es reicht eine Verbindung) wird global in der Forms Klasse definiert.&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; tcpL &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; TcpListener
 &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; tcpClient &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; TcpClient&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Weil es sp&#228;ter zur Laufzeit recht wenig Transparenz gibt, was das Programm gerade tut, schreibe ich in das Output Fenster von Visual Studio. Mit AcceptClient wird der Kanal ge&#246;ffnet und gewartet bis sich ein Client meldet. Die eigentliche Kommunikation findet dann asynchron statt. Da ich die Daten die vom Silverlight Client gesendet werden nicht brauche, ist die Funktion der “ClientSpricht” leer.&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; iasy &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; IAsyncResult
&lt;span style=&quot;color: blue&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;Sub&lt;/span&gt; onConnect(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; ia &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; IAsyncResult)
 &lt;span style=&quot;color: blue&quot;&gt;Try&lt;/span&gt;
  tcpClient = tcpL.EndAcceptTcpClient(ia)
  iasy = tcpL.BeginAcceptTcpClient(&lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; clientSpricht, &lt;span style=&quot;color: blue&quot;&gt;Nothing&lt;/span&gt;)
  Trace.WriteLine(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;connected...&amp;quot;&lt;/span&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; Exception
  Trace.WriteLine(ex.ToString())
 &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;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;Viel wichtiger ist, was der Server zum Server sagt. Dazu wird regelm&#228;&#223;ig ein Timer Event gefeuert, das folgenden Code ausf&#252;hrt und die zur Demonstration Sekunden sendet.&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;If&lt;/span&gt; IsNothing(tcpClient) = &lt;span style=&quot;color: blue&quot;&gt;False&lt;/span&gt; &lt;span style=&quot;color: blue&quot;&gt;AndAlso&lt;/span&gt; tcpClient.Connected &lt;span style=&quot;color: blue&quot;&gt;Then&lt;/span&gt;
  &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; networkStream &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; NetworkStream = tcpClient.GetStream
  &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; sendBytes &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; [&lt;span style=&quot;color: blue&quot;&gt;Byte&lt;/span&gt;]() = Encoding.ASCII.GetBytesDate.Now.Second.ToString)
  networkStream.Write(sendBytes, 0, sendBytes.Length)
Trace.WriteLine(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;sending...&amp;quot;&lt;/span&gt; + &lt;span style=&quot;color: blue&quot;&gt;Date&lt;/span&gt;.Now.Second.ToString)
&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;/pre&gt;
&lt;/div&gt;







&lt;p&gt;Wie kann man nun feststellen das dieser Server auch funktioniert? Ganz einfach mit Telnet4358. Zuerst wird das Kommando telnet localhost 4506 eingegeben und dann erscheinen die Zahlen wie im Bild ersichtlich regelm&#228;&#223;ig.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/SocketServermitVB.NET_D8AE/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/SocketServermitVB.NET_D8AE/image_thumb.png&quot; width=&quot;244&quot; height=&quot;74&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Socket-Server-mit-VB.NET</link>
			<author>Hannes Preishuber</author>
			<pubDate>Thu, 30 Sep 2010 16:21:50 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			.Net</category><category>VB</category><category>Silverlight</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Jscript Zauberei mit Silverlight
			</title>
			<description>&lt;p&gt;Wenn man nachfolgende Webentwicklern um den Verstand bringen will, arbeitet man mit dynamisch generierten JScript Code. Da gibt es nachher nichts im Browser zu sehen mit View Source. Um das ganze auf die Spitze zu treiben, erzeuge ich aus&amp;#160; einer Silverlight Anwendung den Code im Browser. Es gibt dazu auch durchaus Probleme, die zu dieser L&#246;sung passen k&#246;nnten. In fr&#252;heren Silverlight &lt;a href=&quot;http://blogs.ppedv.de/hannesp/archive/Cross-Domain-und-die-drei-tapferen-Network-Stacks&quot;&gt;Weblog&lt;/a&gt; Eintrag habe ich beschrieben wie man statt WebClient den Browser Stack direkt ansprechen kann. Basierend auf diesem Ansatz nun eine Jscript L&#246;sung. Ist kein sch&#246;ner Code, sondern eher nur konzeptionell. Basis ist eine XMLRPC Abfrage der G&#252;ltigkeit einer USTID beim Finanzamt. &lt;/p&gt;  &lt;p&gt;Zun&#228;chst wird eine Callback Funktion mit Rufmichan im Browser erzeugt. Dann wird die Methode erzeugt die dann eine Instanz des XMLHTTP Objektes erzeugt und den Webservice aufruft. Dann muss diese Funktion (callws) aufgerufen werden. Dies passiert per Invoke.&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;Handles&lt;/span&gt; Button1.Click
   createRufmichan()
   createJSCall(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;http://evatr.bff-online.de/evatrRPC?UstId_1=&lt;br /&gt;DE123456789&amp;amp;UstId_2=AB1234567890&amp;amp;Firmenname= &lt;br /&gt;&amp;amp;Ort=&amp;amp;PLZ=&amp;amp;Strasse=&amp;amp;Druck=&amp;quot;&lt;/span&gt;)
  &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; r = HtmlPage.Window.Invoke(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;callWS&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;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Nun sehen wir uns den Code an der im Browser erzeugt werden soll und wie das geschieht. Um der nachfolgenden R&#252;ckruffunktion eine M&#246;glichkeit zu geben auf dei INstnaz zuzugreifen wird w ausserhalb der Funktion callWS definiert. Das HtmlPage Objekt von Silverlight kann per Createlement auch JScript Elemente erzeugen und dann per AppendChild ans DOM des Browserwindows anh&#228;ngen.&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; createJSCall(&lt;span style=&quot;color: blue&quot;&gt;ByVal&lt;/span&gt; url &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;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;w = new XMLHttpRequest();&lt;br /&gt;w.onreadystatechange=rufmichan;&lt;br /&gt;w.open(&#39;GET&#39;, url; w.send(null);&amp;quot;&lt;/span&gt;
  &lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; js = HtmlPage.Document.CreateElement(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;script&amp;quot;&lt;/span&gt;)
  js.SetAttribute(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;)
  js.SetAttribute(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;var w;function callWS() {&amp;quot;&lt;/span&gt; + s + &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot; }&amp;quot;&lt;/span&gt;)
  HtmlPage.Document.DocumentElement.AppendChild(js)
&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 dann der Callback zur&#252;ck kommt wird folgende Funktion ben&#246;tigt.&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; createRufmichan()
  d&lt;span style=&quot;color: blue&quot;&gt;im&lt;/span&gt; js = HtmlPage.Document.CreateElement(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;script&amp;quot;&lt;/span&gt;)
  js.SetAttribute(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;type&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;)
  js.SetAttribute(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;function rufmichan() &lt;br /&gt;{if (w.readyState == 4) {alert(w.responseText);}}&amp;quot;&lt;/span&gt;)
  HtmlPage.Document.DocumentElement.AppendChild(js)   &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Das wars schon. Wie kann ich aber feststellen das alles passt? Nat&#252;rlich wenn die Messagebox mit dem Ergebnis kommt. Auch sehr hilfreich sind seit IE8 die Entwiclertools zu starten mit F12 Taste.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/JscriptZaubereimitSilverlight_13C7A/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/JscriptZaubereimitSilverlight_13C7A/image_thumb.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/Jscript-Zauberei-mit-Silverlight</link>
			<author>Hannes Preishuber</author>
			<pubDate>Fri, 24 Sep 2010 22:45:22 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			ASP.NET</category><category>JScript</category><category>Silverlight</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    ppedv Konferenzen
			</title>
			<description>&lt;p&gt;Ich versuche mein Blog Werbefrei zu halten. Insofern auch mehr zur Info, weil ich weis das viele Leser meines Blogs auch gerne mal auf Konferenzen sprechen.&lt;/p&gt;  &lt;p&gt;Also was ist am Plan &lt;/p&gt;  &lt;p&gt;SQLdays&amp;#160; Rosenheim 19.-20.Oktober&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://www.sqldays.net/&quot;&gt;http://www.sqldays.net/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Highlights: schaut euch mal die Sprecher an. Ist ein sehr kommunikativer Rahmen. Als ne echte Chance f&#252;r die BI und SQL Spezialisten sich zu treffen.&lt;/p&gt;  &lt;p&gt;ADC Advanced Developer Conference&lt;/p&gt;  &lt;p&gt;Bonn 25.-26.Oktober&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://www.adc10.de/&quot;&gt;http://www.adc10.de/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Die &#228;lteste Konferenz (seit gut 15 Jahren)&amp;#160; f&#252;r professionelle Entwickler. Keine Einstieg oder Einf&#252;hrung Sessions, Level 300 und up. Cooles Sprecherboard! &lt;/p&gt;  &lt;p&gt;GUI&amp;amp;Design&lt;/p&gt;  &lt;p&gt;N&#252;rnberg 8.-9. Dezember&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://gui-design.ppedv.de&quot;&gt;http://gui-design.ppedv.de&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Weg vom grauen Rechteck im oberen Bildschirmeck. Hin zu Anwendungen die die Benutzer lieben. Auf allen Ger&#228;ten von kleinsten Windows Phone 7 bis zu Surface Formfaktor. Eben die Mischung von Usablity und Design die der Entwickler in Zukunft braucht. Call for papers ist offen.&lt;/p&gt;  &lt;p&gt;VSone und Sharepoint konferenz&lt;/p&gt;  &lt;p&gt;16.-17.Februar 2011 M&#252;nchen&lt;/p&gt;  &lt;p&gt;Neue bessere Location! Das Key Event der Branche mit 10 parallelen Tracks und allen Themen. Hier trifft sich die gesamte Community im Microsoft Eco System. Call for papers ist nicht er&#246;ffnet.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://www.vsone.de&quot;&gt;www.vsone.de&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Geheim Projekt- coming soon&lt;/p&gt;  &lt;p&gt;18.-19 Februar M&#252;nchen… &lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/ppedv-Konferenzen</link>
			<author>Hannes Preishuber</author>
			<pubDate>Wed, 22 Sep 2010 13:00:17 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			.Net</category><category>Konferenzen</category><category>
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Unbutu auf Virtual PC installieren
			</title>
			<description>&lt;p&gt;Weil es nichts gibt was man nciht probieren k&#246;nnte, installiere ich heute mal Unbutu auf Windows 7 und dessen virtual PC. Leider geht das nicht problemlos. Deshalb hier eine Schrittweise Anleitung. Nachdem man das ISO runtergeladen wurde muss der VPC in Windows 7 eingerichtet werden. in meinem Beispiel habe ich eine virtuelle VHD mit einer Gr&#246;&#223;e von 10G vorformatiert. Dann muss die ISO Datei als DVD Laufwerk eingerichtet werden.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/5a91f8428e7b_11120/image_6.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/5a91f8428e7b_11120/image_thumb_2.png&quot; width=&quot;244&quot; height=&quot;61&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Dann kann wird der VPC gestartet und man muss &#246;fter auf F4 dr&#252;cken. &lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/5a91f8428e7b_11120/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/5a91f8428e7b_11120/image_thumb.png&quot; width=&quot;244&quot; height=&quot;202&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Der Dialog wird mit ESC geschlossen und dann durch dr&#252;cken von F6 die Kommando Zeile f&#252;rs Booten angezeigt. Nach einmaligen dr&#252;cken von ESC kann die Zeile direkt bearbeitet werden.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/5a91f8428e7b_11120/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/5a91f8428e7b_11120/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;108&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Da muss dann vga=791 noreplace-paravirt eingef&#252;gt werden statt splash –.&lt;/p&gt;    &lt;p&gt;Nach installation nicht rebooten. ESC dr&#252;cken&lt;/p&gt;  &lt;p&gt;Dann das Programm Terminal &#246;ffnen. &lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/5a91f8428e7b_11120/image_10.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/5a91f8428e7b_11120/image_thumb_4.png&quot; width=&quot;244&quot; height=&quot;157&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Dort m&#252;ssen folgende vier Zeilen eingetippt werden. Wobei recht m&#252;hsam die GUID aus dem oberen Men&#252;bereich abgetippt werden muss (2x).&lt;/p&gt;  &lt;div style=&quot;background-color: white; color: black&quot;&gt;   &lt;pre&gt;sudo mount -o bind /dev /media/GUID/dev
sudo chroot /media/GUID/ /bin/bash
mount -t proc none /proc
nano /etc/&lt;span style=&quot;color: blue&quot;&gt;default&lt;/span&gt;/grub&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/5a91f8428e7b_11120/image_12.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/5a91f8428e7b_11120/image_thumb_5.png&quot; width=&quot;244&quot; height=&quot;199&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dort wird dann im Editor die &#228;nderung durchgef&#252;hrt &amp;quot;quiet splash&amp;quot; zu VGA=788. Gespeichert wird mit STRG –X. Best&#228;tigen mit Ja und Dateinamen best&#228;tigen.&lt;/p&gt;

&lt;p&gt;Als n&#228;chstes folgende Datei editieren per Kommando&lt;/p&gt;

&lt;div style=&quot;background-color: white; color: black&quot;&gt;
  &lt;pre&gt;nano /etc/grub.d/10_linux &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/5a91f8428e7b_11120/image_16.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/5a91f8428e7b_11120/image_thumb_7.png&quot; width=&quot;244&quot; height=&quot;214&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Auch hier mit STR X speichern. &lt;/p&gt;

&lt;p&gt;Neustart mit roten Button i rechten oberen Eck. Im Command Fenster Fehlermeldung mit Casper mit ESC ignorieren&lt;/p&gt;

&lt;p&gt;W&#228;hrend ich mir in mehren Blogs diesen Weg zusammengesucht habe, bin ich, nachdem schon fast fertig &#252;ber&amp;#160; Scott Hanselman’s Blog gestolpert.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.hanselman.com/blog/InstallingUbuntu104LTSOnWindowsVirtualPCOnWindows7.aspx?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+ScottHanselman+%28Scott+Hanselman+-+ComputerZen.com%29&quot;&gt;http://www.hanselman.com/blog/InstallingUbuntu104LTSOnWindowsVirtualPCOnWindows7.aspx?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+ScottHanselman+%28Scott+Hanselman+-+ComputerZen.com%29&lt;/a&gt;&lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Unbutu-auf-Virtual-PC-installieren</link>
			<author>Hannes Preishuber</author>
			<pubDate>Mon, 20 Sep 2010 21:45:51 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			
			</category>
			
		</item>
	
		<item>
			<title>
			    [Hannes Preishuber]
			    Cross Domain und die drei tapferen Network Stacks
			</title>
			<description>&lt;p&gt;Folgende Zeichnung zeige ich immer in meinen Silverlight Kurs. (Tablet PC sei Dank)&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/CrossDomainunddiedreiNetworkStacks_EDE6/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/CrossDomainunddiedreiNetworkStacks_EDE6/image_thumb.png&quot; width=&quot;244&quot; height=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Damit soll der Silverlight Schulung Teilnehmer lernen, das es per Definition verboten ist, auf einen zweiten Webserver zuzugreifen (Stichwort crossdomain.xml und clientaccesspolicy.xml). Diese Grundlagen werde ich vielleicht wann anders beschreiben. Wer es nachschlagen m&#246;chte “Crossdomain”. &lt;/p&gt;  &lt;p&gt;Das folgende Szenario ist nicht ganz trivial. L&#228;uft die Anwendung OOB ( Out of Browser) mit elevated Priviliges werden crossdomain limitierungen ignoriert. Wenn die Anwendung im Browser l&#228;uft wird erstens per default ein anderer Network Stack verwendet und es gibt eine Fehlermeldung. Au&#223;er der Web Server hat im Root Directory eine der beiden vorher erw&#228;hnten XML Dateien liegen. &lt;/p&gt;  &lt;p&gt;Das bedeutet das eine Silverlight Anwendung ,abh&#228;ngig wo sie l&#228;uft, unterschiedlichen Code ausf&#252;hrt. Also folgenden Zeilen Code benutzen effektiv zwei unterschiedliche Network Stacks.&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; 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.DownloadStringCompleted, &lt;span style=&quot;color: blue&quot;&gt;AddressOf&lt;/span&gt; fertig
wc.DownloadStringAsync(...&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Der eine Stack wird Network Stack genannt, weil er echte Netzwerk Funktion implementiert. Der andere Stack hei&#223;t Browser Stack weil er das XMLHTTP Objekt des Browser kapselt.&lt;/p&gt;

&lt;p&gt;Nun gibt es die Anforderung das ein solcher Cross Domain Zugriff (zb auf die Twitter API) durchgef&#252;hrt werden soll&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;aus dem Browser&lt;/li&gt;

  &lt;li&gt;unter Ignoranz der crossdomain policys&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Das geht mit dem “dritten Netzwerk” Stack. Dem XMLHttp Objekt direkt z.B. aus JScript. Silverlight bietet daf&#252;r eine HTMLPage Helper Klasse mit der man ziemlich einfach direkt im Browser arbeiten kann. So l&#228;sst sich per &lt;em&gt;eval&lt;/em&gt; beliebig dynamisch generierter JScript Code ausf&#252;hren oder mit &lt;em&gt;Invoke&lt;/em&gt; eine Jscript Funktion aufrufen. Noch besser ist aber das Silverlight ScriptObject. Damit lassen sich unter Semi Intellisense Unterst&#252;tzung JScript Objekte instanzieren. Mit Invoke werden dann die Methoden aufgerufen.&lt;/p&gt;

&lt;p&gt;Ausgehend von folgendem Jscript Beispiel&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;var&lt;/span&gt; w = &lt;span style=&quot;color: blue&quot;&gt;new&lt;/span&gt; XMLHttpRequest();
w.onreadystatechange = &lt;span style=&quot;color: blue&quot;&gt;function&lt;/span&gt; () 
{
&lt;span style=&quot;color: blue&quot;&gt;if&lt;/span&gt; (w.readyState == 4) {
    alert(w.responseText);
 }}
w.open(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;http://...&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: blue&quot;&gt;true&lt;/span&gt;);
w.send(&lt;span style=&quot;color: blue&quot;&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;L&#228;sst sich so mit managed Code in VB.NET die Silverlight Anwendung ausprogrammieren.&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; url &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;http://...&amp;quot;&lt;/span&gt;
&lt;span style=&quot;color: blue&quot;&gt;Dim&lt;/span&gt; req &lt;span style=&quot;color: blue&quot;&gt;As&lt;/span&gt; ScriptObject
req = HtmlPage.Window.CreateInstance(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;XMLHttpRequest&amp;quot;&lt;/span&gt;)
req.Invoke(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;open&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;, url, &lt;span style=&quot;color: blue&quot;&gt;False&lt;/span&gt;)
req.Invoke(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;send&amp;quot;&lt;/span&gt;)
TextBlock1.Text = req.GetProperty(&lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;responseText&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Ein erster Test mit Chrome und Firefox funktioniert ohne Probleme. Mit Internet Explorer 9 kommt eine Sicherheitsabfrage die der Benutzer best&#228;tigen muss.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://blogs.ppedv.de/data/CrossDomainunddiedreiNetworkStacks_EDE6/image_4.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; margin: ; 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/CrossDomainunddiedreiNetworkStacks_EDE6/image_thumb_1.png&quot; width=&quot;244&quot; height=&quot;112&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Abgesehen von dieser kleinen H&#252;rde kann so die Crossdomain Limitierung von Silverlight mit wenigen Code Zeilen umgangen werden. Dar&#252;ber hinaus bietet der XMLHTTP JScript Network Stack auch mehr Funktionen, da der Silverlight Wrapper nur das n&#246;tigste implementiert hat. &lt;/p&gt;</description>
			<link>http://blogs.ppedv.de/hannesp/archive/Cross-Domain-und-die-drei-tapferen-Network-Stacks</link>
			<author>Hannes Preishuber</author>
			<pubDate>Sun, 19 Sep 2010 18:27:36 GMT</pubDate>
			<category domain="http://blogs.ppedv.de?tag=">
			.Net</category><category>VB</category><category>Silverlight</category><category>JScript</category><category>
			</category>
			
		</item>
	
		<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>
	
	        </channel>
		</rss>
	
    
    

