<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6246305827217941183</id><updated>2024-09-14T10:20:07.950-07:00</updated><category term="csharp"/><category term="dotnet"/><category term="wpf"/><category term="xaml"/><category term="xml"/><title type='text'>Between APIs</title><subtitle type='html'>Blog about the day to day life of a programmer traveling around languages, APIs, forums and new technologies.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://betweenapis.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://betweenapis.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12166770673606802152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6246305827217941183.post-9043866109259486894</id><published>2010-06-08T17:44:00.000-07:00</published><updated>2010-06-08T17:44:48.602-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="wpf"/><title type='text'>WPF #7 - Several Tips</title><content type='html'>Some tips right from my day by day issues.&lt;br /&gt;
Hope you enjoy it.&lt;br /&gt;
&lt;br /&gt;
1 - &lt;a href=&quot;http://askernest.com/archive/2008/01/23/how-to-programmatically-change-the-selecteditem-in-a-wpf-treeview.aspx&quot;&gt;How to programmatically change the SelectedItem in a WPF TreeView&lt;/a&gt;&lt;br /&gt;
2 - &lt;a href=&quot;http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/27950e73-0007-4e0b-9f00-568d2db1d979&quot;&gt;Popup tracking position of PlacementTarget&lt;/a&gt;&lt;br /&gt;
3 - &lt;a href=&quot;http://www.switchonthecode.com/tutorials/wpf-tutorial-resizeable-popup&quot;&gt;WPF Tutorial - Resizeable Popup | Switch on the Code&lt;/a&gt;&lt;br /&gt;
4 - &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms753224.aspx&quot;&gt;How to: Position a Popup&lt;/a&gt;&lt;br /&gt;
5 - &lt;a href=&quot;http://stackoverflow.com/questions/1442165/wpf-usercontrol-in-datatemplate-within-itemscontrol-how-to-bind-to-parent-of-it&quot;&gt;WPF UserControl in DataTemplate within ItemsControl - how to bind to parent&lt;/a&gt;&lt;br /&gt;
6 - &lt;a href=&quot;http://decav.com/blogs/andre/archive/2007/05/27/wpf-binding-to-properties-in-your-usercontrol-or-window.aspx&quot;&gt;WPF: Binding to Properties in your UserControl or Window&lt;/a&gt;&lt;br /&gt;
7 - &lt;a href=&quot;http://stackoverflow.com/questions/2650576/how-do-you-override-the-opacity-of-a-parent-control-in-wpf&quot;&gt;How do you override the opacity of a parent control in WPF?&lt;/a&gt;&lt;br /&gt;
8 - &lt;a href=&quot;http://stackoverflow.com/questions/371879/wpf-button-isenabled-based-on-combobox-selection-overwriting-default-style&quot;&gt;WPF Button IsEnabled Based on ComboBox Selection Overwriting default style&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s pretty much it.&lt;br /&gt;
See ya!</content><link rel='replies' type='application/atom+xml' href='http://betweenapis.blogspot.com/feeds/9043866109259486894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://betweenapis.blogspot.com/2010/06/wpf-7-several-tips.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/9043866109259486894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/9043866109259486894'/><link rel='alternate' type='text/html' href='http://betweenapis.blogspot.com/2010/06/wpf-7-several-tips.html' title='WPF #7 - Several Tips'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12166770673606802152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6246305827217941183.post-6387095406342676153</id><published>2009-10-05T09:58:00.001-07:00</published><updated>2009-10-05T09:58:29.349-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="wpf"/><title type='text'>WPF #6 - Creating a RoutedEvent</title><content type='html'>&lt;p style=&quot;clear: both&quot;&gt;Just to keep &lt;s&gt;my posting average&lt;/s&gt; posting new tips, this is an easy one with an example on how to make a Routed event.&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;A routed event is just like a regular event, but it has one other great functionality, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms742806.aspx&quot; title=&quot;MSDN RoutedEvent page&quot;&gt;it can invoke handlers on multiple listeners in an element tree, rather than just on the object that raised the event (via MSDN)&lt;/a&gt;.&lt;/p&gt;&lt;pre style=&quot;clear: both&quot;&gt;&lt;code&gt;public class MyButtonSimple: Button&lt;br /&gt;{&lt;br /&gt;    // Create a custom routed event by first registering a RoutedEventID&lt;br /&gt;    // This event uses the bubbling routing strategy&lt;br /&gt;    public static readonly RoutedEvent TapEvent = EventManager.RegisterRoutedEvent(&lt;br /&gt;        &quot;Tap&quot;, RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MyButtonSimple));&lt;br /&gt;&lt;br /&gt;    // Provide CLR accessors for the event&lt;br /&gt;    public event RoutedEventHandler Tap&lt;br /&gt;    {&lt;br /&gt;            add { AddHandler(TapEvent, value); } &lt;br /&gt;            remove { RemoveHandler(TapEvent, value); }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // This method raises the Tap event&lt;br /&gt;    void RaiseTapEvent()&lt;br /&gt;    {&lt;br /&gt;            RoutedEventArgs newEventArgs = new RoutedEventArgs(MyButtonSimple.TapEvent);&lt;br /&gt;            RaiseEvent(newEventArgs);&lt;br /&gt;    }&lt;br /&gt;    // For demonstration purposes we raise the event when the MyButtonSimple is clicked&lt;br /&gt;    protected override void OnClick()&lt;br /&gt;    {&lt;br /&gt;        RaiseTapEvent();&lt;br /&gt;    }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;clear: both&quot;&gt;Source: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.routedeventargs.aspx&quot;&gt;MSDN RoutedEventArgs examples&lt;/a&gt;&lt;/p&gt;&lt;br class=&#39;final-break&#39; style=&#39;clear: both&#39; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://betweenapis.blogspot.com/feeds/6387095406342676153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://betweenapis.blogspot.com/2009/10/wpf-6-creating-routedevent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/6387095406342676153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/6387095406342676153'/><link rel='alternate' type='text/html' href='http://betweenapis.blogspot.com/2009/10/wpf-6-creating-routedevent.html' title='WPF #6 - Creating a RoutedEvent'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12166770673606802152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6246305827217941183.post-1620686025810069524</id><published>2009-10-02T05:29:00.001-07:00</published><updated>2009-10-02T05:29:38.096-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="wpf"/><category scheme="http://www.blogger.com/atom/ns#" term="xaml"/><title type='text'>WPF #5 - Styling using MultiTrigger (MultiCondition setter)</title><content type='html'>&lt;p style=&quot;clear: both&quot;&gt;Hi again, I noticed that I&#39;m not explaining my tips that much, I wonder if this is happening due to the fact that I&#39;ve only posted quick tips or if it is an actual issue. &lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Well, I&#39;m more an example guy than a theory guy, for me is always easy to understand using examples than any other way. So if anyone read one of the tips and didn&#39;t understand it, please leave a comment so I can try to explain it better.&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Now, this post tip, how to use MultiTrigger (or MultiConditions setters) in WPF, the following example pretty much explains itself:&lt;/p&gt;&lt;pre style=&quot;clear: both&quot;&gt;&lt;code&gt;&amp;lt;Style targettype=&quot;{x:Type Button}&quot;&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;  &amp;lt;Style.Triggers&amp;gt;&lt;br /&gt;    &amp;lt;MultiTrigger&amp;gt;&lt;br /&gt;      &amp;lt;MultiTrigger.Conditions&amp;gt;&lt;br /&gt;        &amp;lt;Condition Property=&quot;IsMouseOver&quot; Value=&quot;True&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;Condition Property=&quot;Content&quot; Value=&quot;{x:Null}&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;/MultiTrigger.Conditions&amp;gt;&lt;br /&gt;      &amp;lt;Setter Property=&quot;Background&quot; Value=&quot;Yellow&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/MultiTrigger&amp;gt;&lt;br /&gt;  &amp;lt;/Style.Triggers&amp;gt;&lt;br /&gt;&amp;lt;/Style&amp;gt; &lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;clear: both&quot;&gt;In this code I&#39;m setting the background of a Button only when the mouse is over and the Content is not filled, don&#39;t ask me why I&#39;m doing that, it&#39;s just an example, probably taken by the source url and used for something else!&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Source: &lt;a href=&quot;http://en.csharp-online.net/WPF_Styles_and_Control_Templates%E2%80%94Multi-Condition_Property_Trigger&quot;&gt;WPF Styles and Control Templates&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Leave a comment if you guys have any questions.&lt;/p&gt;&lt;br class=&#39;final-break&#39; style=&#39;clear: both&#39; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://betweenapis.blogspot.com/feeds/1620686025810069524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://betweenapis.blogspot.com/2009/10/wpf-5-styling-using-multitrigger.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/1620686025810069524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/1620686025810069524'/><link rel='alternate' type='text/html' href='http://betweenapis.blogspot.com/2009/10/wpf-5-styling-using-multitrigger.html' title='WPF #5 - Styling using MultiTrigger (MultiCondition setter)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12166770673606802152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6246305827217941183.post-5769442458478453879</id><published>2009-10-01T12:35:00.001-07:00</published><updated>2009-10-01T12:35:38.175-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="xml"/><title type='text'>DOT.NET - Make invalid UTF8 charatcters available in XML</title><content type='html'>&lt;p style=&quot;clear: both&quot;&gt;To change my posts a little lets talk about .NET, not WPF, a .NET little trick I discovered when creating UTF8 enabled XML files.&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;If you want to enable UTF8 files through an editor you would have to do the following:&lt;/p&gt;&lt;pre style=&quot;clear: both&quot;&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;clear: both&quot;&gt;And to do the same when you use a XmlWriter (that&#39;s the trick), you first have to set the Encoding of the XmlWriter and then you just have to force it to write the start document element.&lt;/p&gt;&lt;pre style=&quot;clear: both&quot;&gt;&lt;code&gt;XmlTextWriter objWriter = new XmlTextWriter(sPath, Encoding.UTF8);&lt;br /&gt;objWriter.WriteStartDocument();&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;clear: both&quot;&gt;Hope it helps!&lt;/p&gt;&lt;br class=&#39;final-break&#39; style=&#39;clear: both&#39; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://betweenapis.blogspot.com/feeds/5769442458478453879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://betweenapis.blogspot.com/2009/10/dotnet-make-invalid-utf8-charatcters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/5769442458478453879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/5769442458478453879'/><link rel='alternate' type='text/html' href='http://betweenapis.blogspot.com/2009/10/dotnet-make-invalid-utf8-charatcters.html' title='DOT.NET - Make invalid UTF8 charatcters available in XML'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12166770673606802152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6246305827217941183.post-1626301915837993305</id><published>2009-09-29T06:18:00.001-07:00</published><updated>2009-09-29T06:18:34.681-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="wpf"/><title type='text'>WPF #4 - Scroll to a ListViewItem programatically</title><content type='html'>&lt;p style=&quot;clear: both&quot;&gt;Hi guys, now you have to be tired of WPF tips. Aren&#39;t you?&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Well, after playing around a little bit with ListView I&#39;ve bumped into a problem, how to select an item programatically?&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Couldn&#39;t be easier:&lt;/p&gt;&lt;pre style=&quot;clear: both&quot;&gt;&lt;code&gt;this.listView.ScrollIntoView(this.listView.Items[index]);&lt;/code&gt;&lt;/pre&gt;&lt;p style=&quot;clear: both&quot;&gt;Pretty neat right?&lt;br /&gt;&lt;br /&gt;See ya next time!&lt;/p&gt;&lt;br class=&#39;final-break&#39; style=&#39;clear: both&#39; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://betweenapis.blogspot.com/feeds/1626301915837993305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://betweenapis.blogspot.com/2009/09/wpf-4-scroll-to-listviewitem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/1626301915837993305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/1626301915837993305'/><link rel='alternate' type='text/html' href='http://betweenapis.blogspot.com/2009/09/wpf-4-scroll-to-listviewitem.html' title='WPF #4 - Scroll to a ListViewItem programatically'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12166770673606802152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6246305827217941183.post-7983609115032864109</id><published>2009-09-25T07:57:00.001-07:00</published><updated>2009-09-25T07:57:58.347-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="wpf"/><title type='text'>WPF #3 - Get ListViewItem from its data bound</title><content type='html'>&lt;p style=&quot;clear: both&quot;&gt;Another WPF tip, aren&#39;t you guys tired of them yet?&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Well, this is another quick one, how to get an ListBoxItem or ListViewItem when you have the item that was bound to it.&lt;/p&gt;&lt;pre style=&quot;clear: both&quot;&gt;ListViewItem objItem = myListView.ItemContainerGenerator.ContainerFromItem(objMyData);&lt;br /&gt;&lt;/pre&gt;&lt;p style=&quot;clear: both&quot;&gt; Pretty easy right? Or as we brazilians say: fácil!&lt;/p&gt;&lt;br class=&#39;final-break&#39; style=&#39;clear: both&#39; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://betweenapis.blogspot.com/feeds/7983609115032864109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://betweenapis.blogspot.com/2009/09/wpf-3-get-listviewitem-from-its-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/7983609115032864109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/7983609115032864109'/><link rel='alternate' type='text/html' href='http://betweenapis.blogspot.com/2009/09/wpf-3-get-listviewitem-from-its-data.html' title='WPF #3 - Get ListViewItem from its data bound'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12166770673606802152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6246305827217941183.post-4022669768090832828</id><published>2009-09-24T13:04:00.001-07:00</published><updated>2009-09-25T15:41:32.036-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="wpf"/><title type='text'>WPF #2 - How to set focus and bring windows to front</title><content type='html'>&lt;div style=&quot;clear: both;&quot;&gt;Hi guys,&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;clear: both;&quot;&gt;I was developing a &lt;b&gt;WPF application&lt;/b&gt; that should open a window after clicking tray icon and bumped with a problem when focusing, The same method would be called whether the window was open or not, so the easiest way I&#39;ve found to do that is the following: &lt;br /&gt;
&lt;/div&gt;&lt;pre style=&quot;clear: both;&quot;&gt;&lt;code&gt;[DllImport(&quot;User32.dll&quot;)]
public static extern Int32 SetForegroundWindow(int hWnd);
private void BringToFront()
{
    if (!IsVisible)
        Visibility = Visibility.Visible;
    SetForegroundWindow((new System.Windows.Interop.WindowInteropHelper(this)).Handle);
}&lt;/code&gt;&lt;/pre&gt;&lt;div style=&quot;clear: both;&quot;&gt;&lt;br /&gt;
Hope this helps!&lt;br /&gt;
&lt;br /&gt;
Source:&lt;br /&gt;
&lt;a href=&quot;http://www.dotnetspider.com/resources/5772-Bring-e-window-Front-set-It-Active-window.aspx&quot; title=&quot;Bring window to front&quot;&gt;http://www.dotnetspider.com/resources/5772-Bring-e-window-Front-set-It-Active-window.aspx&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://betweenapis.blogspot.com/feeds/4022669768090832828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://betweenapis.blogspot.com/2009/09/wpf-2-how-to-set-focus-and-bring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/4022669768090832828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/4022669768090832828'/><link rel='alternate' type='text/html' href='http://betweenapis.blogspot.com/2009/09/wpf-2-how-to-set-focus-and-bring.html' title='WPF #2 - How to set focus and bring windows to front'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12166770673606802152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6246305827217941183.post-6237090203781983852</id><published>2009-09-22T14:16:00.001-07:00</published><updated>2009-09-24T12:37:58.416-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="csharp"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="wpf"/><title type='text'>WPF #1 - How to get windows handle</title><content type='html'>&lt;p style=&quot;clear: both&quot;&gt;Hi guys,&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;My first post at my &lt;s&gt;not so&lt;/s&gt; recently created blog, Between APIs!&lt;br /&gt;Here I intend to discuss and talk only about my programming daily issues, tips, problems, solutions. If it matter for a developer than its posted here!&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;My first one is all about starting WPF. &lt;br /&gt;I&#39;ve stumbled with this problem when starting a new WPF library that would be used by a WindowsForm application. How to get the current WF window handle to use as owner?&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Very simple:&lt;br /&gt;MyWpfWindow myWindow = new MyWpfWindow();&lt;br /&gt;WindowInteropHelper windowHelper = new WindowInteropHelper(myWindow).Handle;&lt;br /&gt;windowHelper.Owner = myOldWfForm.Handle;&lt;br /&gt;myWindow.ShowDialog();&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Source: &lt;br /&gt;&lt;a href=&quot;http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a62f912f-a28e-416b-b0f1-065ae9d6cc01&quot; title=&quot;Solution source&quot;&gt;http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a62f912f-a28e-416b-b0f1-065ae9d6cc01&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;clear: both&quot;&gt;Hope you guys enjoy the blog!&lt;/p&gt;&lt;br class=&#39;final-break&#39; style=&#39;clear: both&#39; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://betweenapis.blogspot.com/feeds/6237090203781983852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://betweenapis.blogspot.com/2009/09/wpf-1-how-to-get-windows-handle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/6237090203781983852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6246305827217941183/posts/default/6237090203781983852'/><link rel='alternate' type='text/html' href='http://betweenapis.blogspot.com/2009/09/wpf-1-how-to-get-windows-handle.html' title='WPF #1 - How to get windows handle'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/12166770673606802152</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>