<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>vladeck&#039;s junkyard</title>
	<atom:link href="http://vladeck.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://vladeck.wordpress.com</link>
	<description>designer wannabe</description>
	<lastBuildDate>Fri, 20 Jan 2012 00:32:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='vladeck.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>vladeck&#039;s junkyard</title>
		<link>http://vladeck.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://vladeck.wordpress.com/osd.xml" title="vladeck&#039;s junkyard" />
	<atom:link rel='hub' href='http://vladeck.wordpress.com/?pushpress=hub'/>
		<item>
		<title>SearchTextBox Behavior</title>
		<link>http://vladeck.wordpress.com/2010/12/22/searchtextbox-behavior/</link>
		<comments>http://vladeck.wordpress.com/2010/12/22/searchtextbox-behavior/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 12:22:59 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=184</guid>
		<description><![CDATA[Damn, this was a tricky one &#8211; a bit of coding, a sprinkle of XAML and here it is. And it works. You can set this Behavior to any TextBox and turn it into Windows 7 search box like thingy. You can define your own Search and Clear icons (ImageSource) and (if you don&#8217;t want [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=184&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Damn, this was a tricky one &#8211; a bit of coding, a sprinkle of XAML and here it is. And it works. You can set this Behavior to any TextBox and turn it into Windows 7 search box like thingy. You can define your own Search and Clear icons (ImageSource) and (if you don&#8217;t want search-as-you-type) Search command (ICommand). The good thing is that it doesn&#8217;t affect the style/template you set for the TextBox, as it is implemented as Adorner.</p>
<span style="text-align:center; display: block;"><a href="http://vladeck.wordpress.com/2010/12/22/searchtextbox-behavior/"><img src="http://img.youtube.com/vi/NVh5IvdYhec/2.jpg" alt="" /></a></span>
<p>Download <a href="http://vladeck.files.wordpress.com/2010/12/junkyard-examples.doc">here</a> (rename .DOC to .RAR – wordpress limitation).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=184&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2010/12/22/searchtextbox-behavior/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>
	</item>
		<item>
		<title>Button Popup Behavior</title>
		<link>http://vladeck.wordpress.com/2010/11/21/button-popup-behavior/</link>
		<comments>http://vladeck.wordpress.com/2010/11/21/button-popup-behavior/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 23:39:40 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=174</guid>
		<description><![CDATA[Another behavior that I wrote for my project. The code is simple and there aren&#8217;t many things to configure, but it is a good starting point for a nice button popup (many other examples I&#8217;ve seen are coded as custom controls; the same can be accomplished using this behavior):<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=174&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Another behavior that I wrote for my project. The code is simple and there aren&#8217;t many things to configure, but it is a good starting point for a nice button popup (many other examples I&#8217;ve seen are coded as custom controls; the same can be accomplished using this behavior):</p>
<p><a href="http://vladeck.files.wordpress.com/2010/11/buttonpopup.png"><img class="alignnone size-full wp-image-175" title="ButtonPopup" src="http://vladeck.files.wordpress.com/2010/11/buttonpopup.png?w=630" alt=""   /></a></p>
<p><pre class="brush: csharp;">
namespace Foo
{
    public class ButtonPopupBehavior : Behavior&lt;Button&gt;
    {
        private readonly Popup popup_;

        public static DependencyProperty PopupProperty =
            DependencyProperty.Register(
                &quot;Popup&quot;,
                typeof(UIElement),
                typeof(ButtonPopupBehavior),
                null
            );

        public ButtonPopupBehavior()
        {
            popup_ = new Popup() { StaysOpen = false };
        }

        public UIElement Popup
        {
            get { return (UIElement)GetValue(PopupProperty); }
            set { SetValue(PopupProperty, value); }
        }

        protected override void OnAttached()
        {
            base.OnAttached();
            
            AssociatedObject.Click += OnClick;
            AssociatedObject.IsVisibleChanged += OnIsVisibleChanged;

            popup_.PlacementTarget = AssociatedObject;
            popup_.Child = Popup;
        }

        protected override void OnDetaching()
        {
            AssociatedObject.Click -= OnClick;
            AssociatedObject.IsVisibleChanged -= OnIsVisibleChanged;
            
            base.OnDetaching();
        }

        private void OnClick(object sender, RoutedEventArgs e)
        {
            popup_.IsOpen = true;
        }

        private void OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (!(bool)e.NewValue)
                popup_.IsOpen = false;
        }
    }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/174/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/174/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/174/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=174&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2010/11/21/button-popup-behavior/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>

		<media:content url="http://vladeck.files.wordpress.com/2010/11/buttonpopup.png" medium="image">
			<media:title type="html">ButtonPopup</media:title>
		</media:content>
	</item>
		<item>
		<title>Conditional referencing in .NET</title>
		<link>http://vladeck.wordpress.com/2010/11/17/conditional-referencing-in-net/</link>
		<comments>http://vladeck.wordpress.com/2010/11/17/conditional-referencing-in-net/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 13:36:52 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=142</guid>
		<description><![CDATA[If you ever happen to stumble upon a problem of having the need to support multiple versions of the same assembly in your .NET project, read on&#8230; Take these two assemblies for example: Foo.dll (v1.0) Foo.dll (v2.0) So, now we have two Foo.dll assemblies that are of different version and we want to use them [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=142&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you ever happen to stumble upon a problem of having the need to support multiple versions of the same assembly in your .NET project, read on&#8230; Take these two assemblies for example:</p>
<p><strong>Foo.dll</strong> (v1.0)</p>
<p><pre class="brush: csharp;">
namespace Foo
{
    class Bar
    {
        public void Do()
        {
            Console.WriteLine(&quot;Hello, from v1.0 of Bar&quot;);
        }
    }
}
</pre></p>
<p><strong>Foo.dll</strong> (v2.0)</p>
<p><pre class="brush: csharp;">
namespace Foo
{
    class Bar
    {
        public void Do(string parameter)
        {
            Console.WriteLine(&quot;Hello, from v2.0 of Bar with parameter: {0}&quot;, parameter);
        }
    }
}
</pre></p>
<p>So, now we have two <strong>Foo.dll</strong> assemblies that are of different version and we want to use them in our project. First, copy these assemblies to project directory and put them under <em>v1</em> and v2 directories (at the same level as the <strong>.csproj</strong> file); then, open the <strong>.csproj</strong> file and add the following configurations (I&#8217;ll do this for <em>DEBUG</em> versions &#8211; just copy <em>DEBUG</em> that is already there and modify it; the <em>RELEASE</em> is similar):</p>
<p><pre class="brush: xml;">
&lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Debug - v1|AnyCPU' &quot;&gt;
    &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
    &lt;OutputPath&gt;bin\Debug\v1\&lt;/OutputPath&gt;
    &lt;DefineConstants&gt;TRACE;DEBUG;V_ONE&lt;/DefineConstants&gt;
    &lt;DebugType&gt;full&lt;/DebugType&gt;
    &lt;PlatformTarget&gt;AnyCPU&lt;/PlatformTarget&gt;
    &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
&lt;/PropertyGroup&gt;
&lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Debug - v2|AnyCPU' &quot;&gt;
    &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
    &lt;OutputPath&gt;bin\Debug\v2\&lt;/OutputPath&gt;
    &lt;DefineConstants&gt;TRACE;DEBUG;V_TWO&lt;/DefineConstants&gt;
    &lt;DebugType&gt;full&lt;/DebugType&gt;
    &lt;PlatformTarget&gt;AnyCPU&lt;/PlatformTarget&gt;
    &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
&lt;/PropertyGroup&gt;
</pre></p>
<p>And here comes the good part, just below previous modification:</p>
<p><pre class="brush: xml;">
&lt;Choose&gt;
    &lt;When Condition=&quot; '$(Configuration)' == 'Debug - v1'&quot;&gt;
      &lt;ItemGroup&gt;
        &lt;Reference Include=&quot;Foo&quot;&gt;
          &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
          &lt;HintPath&gt;v1\Foo.dll&lt;/HintPath&gt;
        &lt;/Reference&gt;
      &lt;/ItemGroup&gt;
    &lt;/When&gt;
    &lt;When Condition=&quot; '$(Configuration)' == 'Debug - v2'&quot;&gt;
      &lt;ItemGroup&gt;
        &lt;Reference Include=&quot;Foo&quot;&gt;
          &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
          &lt;HintPath&gt;v2\Foo.dll&lt;/HintPath&gt;
        &lt;/Reference&gt;
      &lt;/ItemGroup&gt;
    &lt;/When&gt;
&lt;/Choose&gt;
</pre></p>
<p>Now you are ready to choose your build configuration, and have code support multiple version of the same assembly:</p>
<p><pre class="brush: csharp;">
var b = new Foo.Bar();

#if (V_ONE)
   b.Do();
#elif (V_TWO)
   b.Do(&quot;Hello&quot;);
#endif
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=142&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2010/11/17/conditional-referencing-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>
	</item>
		<item>
		<title>Animated ErrorInfo Behavior</title>
		<link>http://vladeck.wordpress.com/2010/09/24/animated-errorinfo-behavior/</link>
		<comments>http://vladeck.wordpress.com/2010/09/24/animated-errorinfo-behavior/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 14:19:45 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=121</guid>
		<description><![CDATA[Ever since I wrote Animated Height Behavior, I wanted to create Behavior that will give me nice eye-candy for all my IDataErrorInfo validation needs. You can see the result in the video below, as well as the code of the Behavior. Please note that the image I&#8217;m using here is from the Resources (just add [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=121&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever since I wrote <a href="http://vladeck.wordpress.com/2010/09/22/animated-height-behavior/">Animated Height Behavior</a>, I wanted to create Behavior that will give me nice eye-candy for all my IDataErrorInfo validation needs. You can see the result in the video below, as well as the code of the Behavior. Please note that the image I&#8217;m using here is from the Resources (just add 16&#215;16 png image to Resources and name it Error16). GetBitmapSource() is Extension that I wrote for converting System.Drawing.Bitmap to BitmapSource.</p>
<span style="text-align:center; display: block;"><a href="http://vladeck.wordpress.com/2010/09/24/animated-errorinfo-behavior/"><img src="http://img.youtube.com/vi/ZPxWo4eSOF8/2.jpg" alt="" /></a></span>
<p><pre class="brush: csharp;">
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interactivity;
using System.Windows.Media;
using System.Windows.Media.Animation;

namespace Foo
{
    public class AnimatedErrorInfoBehavior : Behavior&lt;FrameworkElement&gt;
    {
        private readonly TextBlock textBlock_;
        private Grid errorGrid_;

        private readonly DoubleAnimation increaseHeightAnimation_;
        private readonly Storyboard increaseHeightStoryboard_;

        private readonly DoubleAnimation showAnimation_;
        private readonly Storyboard showStoryboard_;

        private readonly DoubleAnimation decreaseHeightAnimation_;
        private readonly Storyboard descreaseHeightStoryboard_;

        private readonly DoubleAnimation hideAnimation_;
        private readonly Storyboard hideStoryboard_;

        private readonly Dictionary&lt;string, int&gt; errors_;

        public AnimatedErrorInfoBehavior()
        {
            errors_ = new Dictionary&lt;string, int&gt;();
            textBlock_ = new TextBlock();

            increaseHeightAnimation_ = new DoubleAnimation(
                0.0,
                23.0,
                TimeSpan.FromMilliseconds(200)
            );

            increaseHeightAnimation_.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut };
            increaseHeightStoryboard_ = new Storyboard();

            Storyboard.SetTarget(increaseHeightAnimation_, errorGrid_);
            Storyboard.SetTargetProperty(increaseHeightAnimation_, new PropertyPath(FrameworkElement.HeightProperty));
            increaseHeightStoryboard_.Children.Add(increaseHeightAnimation_);

            showAnimation_ = new DoubleAnimation(0.0, 1.0, TimeSpan.FromMilliseconds(200));
            showAnimation_.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn };
            showStoryboard_ = new Storyboard();

            Storyboard.SetTarget(showAnimation_, textBlock_);
            Storyboard.SetTargetProperty(showAnimation_, new PropertyPath(UIElement.OpacityProperty));
            showStoryboard_.Children.Add(showAnimation_);

            decreaseHeightAnimation_ = new DoubleAnimation(
                23.0,
                0.0,
                TimeSpan.FromMilliseconds(100)
            );

            descreaseHeightStoryboard_ = new Storyboard();

            Storyboard.SetTarget(decreaseHeightAnimation_, errorGrid_);
            Storyboard.SetTargetProperty(decreaseHeightAnimation_, new PropertyPath(FrameworkElement.HeightProperty));
            descreaseHeightStoryboard_.Children.Add(decreaseHeightAnimation_);

            hideAnimation_ = new DoubleAnimation(1.0, 0.0, TimeSpan.FromMilliseconds(100));
            hideAnimation_.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut };

            hideStoryboard_ = new Storyboard();

            Storyboard.SetTarget(hideAnimation_, textBlock_);
            Storyboard.SetTargetProperty(hideAnimation_, new PropertyPath(UIElement.OpacityProperty));
            hideStoryboard_.Children.Add(hideAnimation_);
        }

        protected override void OnAttached()
        {
            var parent = VisualTreeHelper.GetParent(AssociatedObject) as Grid;

            if (parent == null)
                return;

            var row_index = Grid.GetRow(AssociatedObject);
            var row_span = Grid.GetRowSpan(AssociatedObject);

            var column_index = Grid.GetColumn(AssociatedObject);
            var column_span = Grid.GetColumnSpan(AssociatedObject);

            parent.Children.Remove(AssociatedObject);

            var grid = new Grid();
            grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            Grid.SetRow(grid, row_index);
            Grid.SetRowSpan(grid, row_span);

            Grid.SetColumn(grid, column_index);
            Grid.SetColumnSpan(grid, column_span);

            grid.Children.Add(AssociatedObject);
            Grid.SetRow(AssociatedObject, 0);

            errorGrid_ = new Grid();
            errorGrid_.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            errorGrid_.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });

            errorGrid_.Height = 0;

            var image = new Image();
            image.Source = Resources.Error16.GetBitmapSource();
            image.Margin = new Thickness(0,0,2,7);

            errorGrid_.Children.Add(image);
            Grid.SetColumn(image, 0);

            textBlock_.Foreground = Brushes.Red;

            errorGrid_.Children.Add(textBlock_);
            Grid.SetColumn(textBlock_, 1);

            grid.Children.Add(errorGrid_);
            Grid.SetRow(errorGrid_, 1);

            parent.Children.Add(grid);

            Validation.AddErrorHandler(AssociatedObject, OnError);
            Validation.SetErrorTemplate(AssociatedObject, null);

            base.OnAttached();
        }

        private void OnError(object sender, ValidationErrorEventArgs e)
        {
            var error_msg = e.Error.ErrorContent.ToString();

            if (e.Action == ValidationErrorEventAction.Added)
            {
                if (errors_.ContainsKey(error_msg))
                    errors_[error_msg]++;
                else
                    errors_.Add(error_msg, 1);

                if (errors_[error_msg] == 1)
                {
                    textBlock_.Text = e.Error.ErrorContent.ToString();

                    increaseHeightStoryboard_.Begin(errorGrid_);
                    showStoryboard_.Begin(textBlock_);
                }
            }

            if (e.Action == ValidationErrorEventAction.Removed)
            {
                errors_[error_msg]--;

                if (errors_[error_msg] == 0)
                {
                    descreaseHeightStoryboard_.Begin(errorGrid_);
                    hideStoryboard_.Begin(textBlock_);
                }
            }
        }
    }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=121&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2010/09/24/animated-errorinfo-behavior/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>
	</item>
		<item>
		<title>System.Drawing.Bitmap GetBitmapSource() Extension &#8211; Convert System.Drawing.Bitmap to BitmapSource</title>
		<link>http://vladeck.wordpress.com/2010/09/24/system-drawing-bitmap-getbitmapsource-extension-convert-system-drawing-bitmap-to-bitmapsource/</link>
		<comments>http://vladeck.wordpress.com/2010/09/24/system-drawing-bitmap-getbitmapsource-extension-convert-system-drawing-bitmap-to-bitmapsource/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 14:10:02 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=125</guid>
		<description><![CDATA[If you are like me, you probably keep bitmaps (png files) of your WPF project in Resources. Since Resources uses System.Drawing.Bitmap for storing bitmaps, I wrote (some code modifications were done by Bojan) this little extension that will convert bitmap resource to BitmapSource.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=125&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are like me, you probably keep bitmaps (png files) of your WPF project in Resources. Since Resources uses System.Drawing.Bitmap for storing bitmaps, I wrote (some code modifications were done by <a href="http://resnikb.wordpress.com/">Bojan</a>) this little extension that will convert bitmap resource to BitmapSource.</p>
<p><pre class="brush: csharp;">
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace Foo
{
    public static class BitmapExtension
    {
        public static BitmapSource GetBitmapSource(this Bitmap image)
        {
            var rect = new Rectangle(0, 0, image.Width, image.Height);
            var bitmap_data = image.LockBits(rect, ImageLockMode.ReadOnly, image.PixelFormat);

            try
            {
                BitmapPalette palette = null;
                
                if (image.Palette.Entries.Length &gt; 0)
                {
                    var palette_colors = image.Palette.Entries.Select(entry =&gt; System.Windows.Media.Color.FromArgb(entry.A, entry.R, entry.G, entry.B)).ToList();
                    palette = new BitmapPalette(palette_colors);
                }

                return BitmapSource.Create(
                    image.Width,
                    image.Height,
                    image.HorizontalResolution,
                    image.VerticalResolution,
                    ConvertPixelFormat(image.PixelFormat),
                    palette,
                    bitmap_data.Scan0,
                    bitmap_data.Stride * image.Height,
                    bitmap_data.Stride
                );
            }
            finally
            {
                image.UnlockBits(bitmap_data);
            }
        }

        private static System.Windows.Media.PixelFormat ConvertPixelFormat(System.Drawing.Imaging.PixelFormat sourceFormat)
        {
            switch (sourceFormat)
            {
                case System.Drawing.Imaging.PixelFormat.Format24bppRgb:
                    return PixelFormats.Bgr24;

                case System.Drawing.Imaging.PixelFormat.Format32bppArgb:
                    return PixelFormats.Bgra32;

                case System.Drawing.Imaging.PixelFormat.Format32bppRgb:
                    return PixelFormats.Bgr32;
            }

            return new System.Windows.Media.PixelFormat();
        }
    }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/125/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=125&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2010/09/24/system-drawing-bitmap-getbitmapsource-extension-convert-system-drawing-bitmap-to-bitmapsource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>
	</item>
		<item>
		<title>Animated Height Behavior</title>
		<link>http://vladeck.wordpress.com/2010/09/22/animated-height-behavior/</link>
		<comments>http://vladeck.wordpress.com/2010/09/22/animated-height-behavior/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 18:19:23 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=111</guid>
		<description><![CDATA[On one project that I&#8217;m working on, I had a need to animate height (simulating Visible/Not Visible state of &#8216;overlay&#8217; and edit dialogs) of FrameworkElement. So I wrote this little behavior that does just that. You can use IsVisible to control (using binding) &#8216;Visibility&#8217;, as well as ShowDuration and HideDuration to control duration of animation.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=111&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>On one project that I&#8217;m working on, I had a need to animate height (simulating Visible/Not Visible state of &#8216;overlay&#8217; and edit dialogs) of FrameworkElement. So I wrote this little behavior that does just that. You can use <em>IsVisible</em> to control (using binding) &#8216;Visibility&#8217;, as well as <em>ShowDuration</em> and <em>HideDuration</em> to control duration of animation.</p>
<span style="text-align:center; display: block;"><a href="http://vladeck.wordpress.com/2010/09/22/animated-height-behavior/"><img src="http://img.youtube.com/vi/OFsbNZEdhSg/2.jpg" alt="" /></a></span>
<p><pre class="brush: csharp;">
using System;
using System.Windows;
using System.Windows.Interactivity;
using System.Windows.Media.Animation;

namespace Foo
{
    public class AnimatedHeightBehavior : Behavior&lt;FrameworkElement&gt;
    {
        private static DoubleAnimation showAnimation_;
        private static readonly Storyboard showStoryboard_ = new Storyboard();

        private static DoubleAnimation hideAnimation_;
        private static readonly Storyboard hideStoryboard_ = new Storyboard();

        public static DependencyProperty IsVisibleProperty =
            DependencyProperty.Register(
                &quot;IsVisible&quot;,
                typeof(bool),
                typeof(AnimatedHeightBehavior),
                new PropertyMetadata(false, OnShowChanged)
            );

        public static DependencyProperty ShowDurationProperty =
            DependencyProperty.Register(
                &quot;ShowDuration&quot;,
                typeof(int),
                typeof(AnimatedHeightBehavior),
                new PropertyMetadata(200)
        );

        public static DependencyProperty HideDurationProperty =
            DependencyProperty.Register(
                &quot;HideDuration&quot;,
                typeof(int),
                typeof(AnimatedHeightBehavior),
                new PropertyMetadata(50)
        );

        public bool IsVisible
        {
            get { return (bool)GetValue(IsVisibleProperty); }
            set { SetValue(IsVisibleProperty, value); }
        }

        public int ShowDuration
        {
            get { return (int)GetValue(HideDurationProperty); }
            set { SetValue(HideDurationProperty, value); }
        }

        public int HideDuration
        {
            get { return (int)GetValue(ShowDurationProperty); }
            set { SetValue(ShowDurationProperty, value); }
        }

        protected override void OnAttached()
        {
            base.OnAttached();
            AssociatedObject.Loaded += OnLoaded;
        }

        protected override void OnDetaching()
        {
            AssociatedObject.Loaded -= OnLoaded;
            base.OnDetaching();
        }

        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (!IsVisible)
                AssociatedObject.Height = 0.0;

            showAnimation_ = new DoubleAnimation(
                0.0,
                AssociatedObject.ActualHeight,
                TimeSpan.FromMilliseconds((int)GetValue(ShowDurationProperty))
            );

            showAnimation_.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut };

            Storyboard.SetTarget(showAnimation_, AssociatedObject);
            Storyboard.SetTargetProperty(showAnimation_, new PropertyPath(FrameworkElement.HeightProperty));
            showStoryboard_.Children.Add(showAnimation_);

            hideAnimation_ = new DoubleAnimation(
                AssociatedObject.ActualHeight,
                0.0,
                TimeSpan.FromMilliseconds((int)GetValue(HideDurationProperty))
            );

            Storyboard.SetTarget(hideAnimation_, AssociatedObject);
            Storyboard.SetTargetProperty(hideAnimation_, new PropertyPath(FrameworkElement.HeightProperty));
            hideStoryboard_.Children.Add(hideAnimation_);
        }

        private static void OnShowChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var element = ((AnimatedHeightBehavior)d).AssociatedObject;

            if ((bool)e.NewValue)
                showStoryboard_.Begin(element);
            else
                hideStoryboard_.Begin(element);
        }
    }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=111&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2010/09/22/animated-height-behavior/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>
	</item>
		<item>
		<title>GymDo TextBox (WPF Style)</title>
		<link>http://vladeck.wordpress.com/2010/08/29/gymdo-textbox-wpf-style/</link>
		<comments>http://vladeck.wordpress.com/2010/08/29/gymdo-textbox-wpf-style/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 09:47:26 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=105</guid>
		<description><![CDATA[TextBox style that you can use in WPF 3.5 and WPF 4. Do note that the provided Resource Dicitionary has SelectedBrush defined which must be removed if you intend to use this style in WPF 3.5 (WPF 4 only property). Download here (rename .DOC to .RAR – wordpress limitation).<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=105&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>TextBox style that you can use in WPF 3.5 and WPF 4. Do note that the provided Resource Dicitionary has <em>SelectedBrush</em> defined which must be removed if you intend to use this style in WPF 3.5 (WPF 4 only property).</p>
<p><a href="http://vladeck.files.wordpress.com/2010/08/gymdotextbox.png"><img class="alignnone size-full wp-image-106" title="GymDoTextBox" src="http://vladeck.files.wordpress.com/2010/08/gymdotextbox.png?w=630" alt=""   /></a></p>
<p>Download <a href="http://vladeck.files.wordpress.com/2010/08/gymdotextbox.doc">here</a> (rename .DOC to .RAR – wordpress limitation).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=105&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2010/08/29/gymdo-textbox-wpf-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>

		<media:content url="http://vladeck.files.wordpress.com/2010/08/gymdotextbox.png" medium="image">
			<media:title type="html">GymDoTextBox</media:title>
		</media:content>
	</item>
		<item>
		<title>GymDo Button (WPF Style)</title>
		<link>http://vladeck.wordpress.com/2010/08/29/gymdo-button-wpf-style/</link>
		<comments>http://vladeck.wordpress.com/2010/08/29/gymdo-button-wpf-style/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 05:16:40 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=96</guid>
		<description><![CDATA[Here are some button styles I&#8217;ve been working on for one of my personal projects. Styles are compatible with both WPF 3.5 and WPF 4 &#8211; I used only triggers. There are blue, green and red styles, as you can see in the screenshot below: Download here (rename .DOC to .RAR – wordpress limitation).<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=96&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here are some button styles I&#8217;ve been working on for one of my personal projects. Styles are compatible with both WPF 3.5 and WPF 4 &#8211; I used only triggers. There are blue, green and red styles, as you can see in the screenshot below:</p>
<p><a href="http://vladeck.files.wordpress.com/2010/08/gymdobuttons.png"><img class="alignnone size-full wp-image-97" title="GymDoButtons" src="http://vladeck.files.wordpress.com/2010/08/gymdobuttons.png?w=630" alt=""   /></a></p>
<p>Download <a href="http://vladeck.files.wordpress.com/2010/08/gymdobuttons.doc">here</a> (rename .DOC to .RAR – wordpress limitation).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=96&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2010/08/29/gymdo-button-wpf-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>

		<media:content url="http://vladeck.files.wordpress.com/2010/08/gymdobuttons.png" medium="image">
			<media:title type="html">GymDoButtons</media:title>
		</media:content>
	</item>
		<item>
		<title>Publishing Multi-Page DWF from Mechanical Desktop (MDT) using ACAD API</title>
		<link>http://vladeck.wordpress.com/2010/08/29/publishing-multi-page-dwf-from-mechanical-desktop-mdt-using-acad-api/</link>
		<comments>http://vladeck.wordpress.com/2010/08/29/publishing-multi-page-dwf-from-mechanical-desktop-mdt-using-acad-api/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 04:38:37 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[MDT]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=81</guid>
		<description><![CDATA[This is one of those problems that I couldn&#8217;t solve for so long&#8230; I&#8217;m posting a small code example of how it can be done without the need for user interaction &#8211; great for batch type of Addin. In the following example, adoc is AcadDocument, path is absolute path to where you want your DWF [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=81&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is one of those problems that I couldn&#8217;t solve for so long&#8230; I&#8217;m posting a small code example of how it can be done without the need for user interaction &#8211; great for batch type of Addin. In the following example, <strong>adoc</strong> is <em>AcadDocument</em>, <strong>path</strong> is absolute path to where you want your DWF to be published.</p>
<p><pre class="brush: vb;">
Dim dsd_path = path + &quot;.dsd&quot;
Dim dwf_path = path + &quot;.dwf&quot;

Dim dsd_stream = File.Open(dsd_path, FileMode.Create)
Dim dsd_writer As New StreamWriter(dsd_stream)

dsd_writer.WriteLine(&quot;[DWF6Version]&quot;)
dsd_writer.WriteLine(&quot;Ver=1&quot;)

For Each layout As Object In adoc.Layouts

    Dim sheet_line As String = &quot;[DWF6Sheet:&quot; + layout.Name + &quot;]&quot;
    dsd_writer.WriteLine(sheet_line)

    Dim dwg_line As String = &quot;DWG=&quot; + adoc.Path
    dsd_writer.WriteLine(dwg_line)

    Dim layout_line As String = &quot;Layout=&quot; + layout.Name
    dsd_writer.WriteLine(layout_line)

Next

    dsd_writer.WriteLine(&quot;[Target]&quot;)
    dsd_writer.WriteLine(&quot;Type=1&quot;)

    Dim dwf_line As String = &quot;DWF=&quot; + dwf_path
    dsd_writer.WriteLine(dwf_line)

    dsd_writer.WriteLine(&quot;PWD=&quot;)
    dsd_writer.Close()
                
    Dim dsd_data As New DsdData()
    dsd_data.ReadDsd(dsd_path)

    dsd_data.ProjectPath = Path.GetDirectoryName(path)
    dsd_data.LogFilePath = path + &quot;.log&quot;
    dsd_data.NoOfCopies = 1
    dsd_data.SheetType = SheetType.MultiDwf
    dsd_data.SheetSetName = &quot;PublisherSet&quot;
    dsd_data.WriteDsd(dsd_path)

    Dim reader As New StreamReader(dsd_path)
    Dim content = reader.ReadToEnd()

    reader.Close()
    content = content.Replace(&quot;PromptForDwfName=TRUE&quot;, &quot;PromptForDwfName=FALSE&quot;)
    
    Dim writer As New StreamWriter(dsd_path)
    writer.Write(content)
    writer.Close()

    Dim final_dsd As New DsdData()
    final_dsd.ReadDsd(dsd_path)

    Dim plot_cfg As PlotConfig

    For Each cfg_info As PlotConfigManager.Devices

        If cfg_info.DeviceName.Contains(&quot;DWF&quot;) Then
            plot_cfg = PlotConfigManager.SetCurrentConfig(cfg_info.DeviceName)
            Exit For
        End If
    Next

    Dim publisher = Application.Publisher
    publisher.PublishExecute(final_dsd, plot_cfg)
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=81&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2010/08/29/publishing-multi-page-dwf-from-mechanical-desktop-mdt-using-acad-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>
	</item>
		<item>
		<title>GraySky ToggleButton (WPF Style)</title>
		<link>http://vladeck.wordpress.com/2009/11/14/graysky-togglebutton-wpf-style/</link>
		<comments>http://vladeck.wordpress.com/2009/11/14/graysky-togglebutton-wpf-style/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 19:31:31 +0000</pubDate>
		<dc:creator>vladeck</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://vladeck.wordpress.com/?p=59</guid>
		<description><![CDATA[Here is the style for the ToggleButton. Download here (rename .DOC to .RAR – wordpress limitation).<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=59&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is the style for the ToggleButton.</p>
<p><a href="http://vladeck.files.wordpress.com/2009/11/graysky_togglebutton_preview.png"><img class="alignnone size-full wp-image-60" title="GraySky_ToggleButton_Preview" src="http://vladeck.files.wordpress.com/2009/11/graysky_togglebutton_preview.png?w=630" alt="GraySky_ToggleButton_Preview"   /></a></p>
<p>Download <a href="http://vladeck.files.wordpress.com/2009/11/grayskytogglebutton.doc">here</a> (rename .DOC to .RAR – wordpress limitation).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vladeck.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vladeck.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vladeck.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vladeck.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vladeck.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vladeck.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vladeck.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vladeck.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vladeck.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vladeck.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vladeck.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vladeck.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vladeck.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vladeck.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vladeck.wordpress.com&amp;blog=783437&amp;post=59&amp;subd=vladeck&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vladeck.wordpress.com/2009/11/14/graysky-togglebutton-wpf-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e82c84eb656c25d0d16ca844e0f0b792?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vladeck</media:title>
		</media:content>

		<media:content url="http://vladeck.files.wordpress.com/2009/11/graysky_togglebutton_preview.png" medium="image">
			<media:title type="html">GraySky_ToggleButton_Preview</media:title>
		</media:content>
	</item>
	</channel>
</rss>
