About


I have been writing software since I was a kid. My dad got me started with QBASIC, and I never stopped telling computers what to do since then.

In addition to being a software geek, I’m also a music geek. I’ve been playing classical piano since I was five, and studied music composition in college. I’m a firm believer that the thought processes involved with writing & performing music are very similar to the processes of designing & writing software.

I worked at Infragistics for a couple of years, and learned a lot about user interface programming from the masters at the WinForms Dev Lab in Long Island. When I saw WPF for the first time in late 2005, I knew that it was the future of UI development on Windows. I’ve been exploring WPF ever since, and love it more every day.

I post articles to the CodeProject in my spare time. You can view my list of articles here.

104 Responses to About

  1. Tim Sneath says:

    So Josh, I just wanted to find out if you’ve ever thought about interviewing for Microsoft? We’ve got open positions for WPF and WPF/E evangelists right now. Let me know if this is something you’re interested in, and we can chat further…

    Tim

  2. Tor Langlo says:

    Hi Josh,

    I just read about your resignment from your prior company. You and I had a couple of “cyber-exchanges” a while ago in these two threads (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1025073&SiteID=1 and http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1000523&SiteID=1).

    In case you are looking for job/work opportunities, plase take a look at our website (http://www.kodasoftware.com). I am trying to assemble a small team of WPF developers for current and future projects.

    Obviously, I can’t compete with Microsoft , but you never know, bigger isn’t always better… :-)

    Tor.

  3. Rafael Munoz says:

    Regarding the Microsoft MVP Award Program

    Dear Josh,

    My name is Rafael M. Munoz. I’m a member of the Microsoft® Most Valuable Professional (MVP) team as a Community MVP relationship liaison (also known as “MVP Lead”) for Visual C#, Visual J#, Developer Security, Client Application Development and Windows Networking. I would love to talk to you about the MVP Program and your contributions to the Client Application Development technical communities (WinFX, Windows Forms, WPF) over the past year.

    MVPs are recognized by Microsoft for their voluntary participation in offline and online technical communities. If you are not familiar with the MVP program you can learn more by visiting our web site at: http://mvp.support.microsoft.com. Our web site includes a Frequently Asked Questions (FAQ) section, http://mvp.support.microsoft.com/mvpfaqs, which provides answers to questions commonly asked about the MVP program and also provides a lot of good information describing the program.

    Please contact me directly at [removed] and I look forward to talking to you further about the program.

    Rafael M. Munoz
    [removed]

  4. SteveD says:

    Hi Josh,

    I’d like to talk to you about what you are doing with WPF. Please send me an email with your current address.

    All the best,
    Steve

  5. Guru says:

    Hi Josh,

    I liked your DragCanvas sample very much.

    I want your help. :)
    Do you have any document on Custom conrol that will explain How to Write custom control along with their properties,Methods and Events.If possible can u share this with me. :)

    Thanks in advanced… :)

  6. Matthew Lebo says:

    Hey josh, 3 things…

    First its nice to meet you, and thanks for posting help to me on the Avalon MSDN forums.

    Second I have another question about that example of a nested listview in a listview as treeview items and couldn’t find any better way to get a hold of you directly. Basically I’m happy with the workaround you came up with but I would like to make it so that there is a listview for every item in the MAIN table but only 1 listview that holds all the data for the details table. I can’t get this to work because the listview is created for every single detail item since its part of a DataTemplate, any suggestions?

    Third, you have inspired me to start a blog as well and I have linked to you. I will be uploading some of my own WPF stuff soon and you can be sure i’ll be joining that XBAP contest. (matthewlebo.wordpress.com)

    Thanks
    Matt

  7. Jason Beres says:

    Hi Josh,

    Awesome idea on the WPF contest!

    I want to up the ante even more for the winners … Infragistics will donate some killer WPF software if you’ll accept. We have 6 great controls coming out in V1 – you can get the skinny on each one of them here:

    http://www.infragistics.com/hot/wpf.aspx#NetAdvantageforWPFBeta

    Shoot me an email on jasonb@infragistics.com and let’s try to make this happen,

    Great to see how things are going so awesome on your end,

    Jason

  8. Gideon says:

    Hi, I found the project you made about the draggable canvas on code project.
    Few questions if you don’t mind?
    1. I placed your code inside a Usercontrol created in VS 2005
    Then I used the custom control inside another project. But once I tried to place
    controls such as a rectangle inside the custom control like this:

    Only the rectangle would display and not the dragcanvas.

    2. Lastly, attributes like the background color couldn’t be set in tne custom control such as:

    I guess it’s obvious that it would recognise this as a an attribute since it’s a custom control, but I don’t know how to create these attributes either?

    So, I’d appreciate if you could give some help on this:)

  9. vRITHNER says:

    Hi Josh,

    I would love to send you a question by mail but I can’t find your email address:
    Can you give me one ?

    Thxs
    Regards

    -Vince

  10. Josh Smith says:

    Vince,

    You should post your WPF questions to the WPF Forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=119&SiteID=1

    Thanks,
    Josh

  11. Kevin says:

    Hi Josh,

    I saw a post of yours in the MSDN forums, and wanted to ask you about the NYTimes reader. I really like the network/treeview control used in the topic explorer. Is that something you guys built, or is it an available control. I also see a similar one used in the Wikipedia Explorer.

    Thanks,

    k

  12. Josh Smith says:

    Kevin,

    That control is available in Kevin Moore’s Bag-o-Tricks. It is called the Graph. Here’s the link: http://wpf.netfx3.com/files/folders/controls/entry8196.aspx

    Josh

  13. Kevin says:

    Thanks very much Josh!

    Aloha,

    Kevin

  14. Josh Smith says:

    *** NOTE ***

    Please do NOT post programming questions here. They will be DELETED.

    If you have a question about WPF, post it to the WPF Forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=119&SiteID=1

    Thanks,
    Josh

  15. Katie Meenan says:

    Hey Josh,

    Is there any way we can post jobs on your site for your readers? (I guess that’s what I’m doing here anyway.) We’re a software consulting company in Manhattan looking for smart WPF developers.

    Check it out here: http://www.lab49.com/careers

    Thanks,
    Katie

  16. Alex Nesterov says:

    Dear Josh,

    We are starting a russian developer community and want to provide our members with russian translations of the articles from your blog and CodeProject. Could you be so kind to give the permission to us? All copyright notes and links are preserved. Thanks!

    Best Regards,
    Alex Nesterov

  17. Josh Smith says:

    Alex,

    Yes, feel free to translate my articles and blog posts if you want to. I appreciate the interest in my work. Please notify me when you have posted some translations of my material online. I would like to see what they look like in Russian.

    Thanks,
    Josh

  18. Patrick says:

    Hey Josh,

    Wow, I didn’t know you worked at Infragistics. I’m using that library from 2005 so you probably wrote some of the controls I’m using! That’s cool!

    Anyway – I actually had a question for you. I found a reference on another webpage to a blog post you wrote at your old blog in August 2006, called ‘”Specializing the Selected Item’s Data Template.” I am trying to do exactly that, but the blog now comes up 404. Any chance of you reposting that here so I can figure out how you did that? I can’t seem to get this to work for the life of me.

    Thanks again for all your help!! I don’t know where I’d be without your work.. stumbling around in the dark, I’d guess..

  19. Josh Smith says:

    Patrick,

    I dug up that demo app and wrote a quick post about it: http://joshsmithonwpf.wordpress.com/2007/07/30/customizing-the-selected-item-in-a-listbox/

    The reason why my old blog posts no longer exist is because my previous employer deleted my blog when I left. I still can’t understand why they did that, but such is life.

    Josh

  20. Hello Josh!

    How are you doing? My name is Becky Cohen and I manage the Northern NJ .NET User Group which takes place every 2nd Tuesday of every month at SetFocus in Parsippany, NJ (about 30 minutes outside of NYC). I am constantly on the look out for potential speakers and presenters for our User Group and I noticed that you are scheduled to speak at the NYC User Group this month.

    I was wondering if you would be interested in speaking for our User Group sometime in the near future? We usually have a great turnout – about 50 attendees – to each meeting and it is a great way to network and meet other people interested in the programming industry. Please get back in touch with me at rcohen@setfocus.com and let me know. I would love to speak with you further about a possible speaking opportunity!

    Thank you very much!

  21. marlon says:

    Hi Josh,

    you post great article and good posts of the wpf msdn forum… keep it up….

    why don’t we open a google group together….

    if you want send me on marlongrech@gmail.com

  22. Chris Hambleton says:

    Hi Josh – great blog – I’m learning a lot from it!

    I have a question about cascading selection controls – what’s the best/preferred way to do this in WPF? The example is a user makes a selection in a combobox, which causes another combobox to be automatically re-populated based upon the previous selection.

    Thanks!

    Chris

  23. Chris Hambleton says:

    Oops – sorry about the programming question – I didn’t see the “don’t post programming questions here!” until after i had already posted the msg. I found the solution quickly in the WPF forums… :)

    Chris

  24. Ron Tomich says:

    Josh,

    We’re looking to get the word out about our upcoming title, “WPF in Action” (by Arlen Feldman and Maxx Daymon) and your name came up. If you are interested, we’d like to make available to you a free copy of the Early Access version of this book for your review. Please let me know if you would like to receive this free PDF download and I’ll set it up. Currently chapters 1-8 are available.

    Also, if you would like to receive a free copy of the paper book when it ships (Dec-Jan est.) please reply with your shipping address and I’ll get that in place as well.

    Thanks,

    — Ron Tomich
    Director, Sales & Marketing
    Manning Publications
    http://www.manning.com
    303-570-7711

  25. neeraj says:

    hi this is neeraj here.can u have ur mail address.i want to talk to u regarding a win application.plz help

  26. ian kujawa says:

    Hello Josh, your work is great and would like any help you can give:

    Wanted to know if anyone knew of a way to edit xml files from within blend…

    Basically I created a blend project and databinded a treeview item with a string from an xml file, made the template a textbox, so the user can edit, but I need to know how those changes in the blend project (text edit) can be saved to the xml file? basically save the changes and validate the xml file.

    Brennon from expressionsblend.com responded to my prevoius post from: http://msdn2.microsoft.com/en-us/library/ms754356.aspx

    which was great, but I am having trouble updating my xml file,

    Basically the situation is, I have an xml file that controls a separate app and you edit the xml file and the xml settings control the app and the apps UI.

    I am trying to build an xml editor within blend. I want to import the xml file (+xml) then data bind a tree view item and define the template (each xml string) as a textbox so the user can edit that specific xml value. Then when they are done editing they can save the blend project and the settings will overwrite the xml file on their machine.

    any help would be great…thanks again

  27. Josh Smith says:

    Ian,

    I don’t answer tech questions on this messageboard. You should post that question to the WPF Forum instead. Thanks

    Josh

  28. [...] in client app development, with a focus on WPF.  As well as being an MVP, Josh is a big blogger on WPF, speaks regularly about WPF at conferences and community events, and he’s published a ton of [...]

  29. Lauren Milan says:

    Josh,
    We are seeing an increasing number of requests for Silverlight and WPF candidates. I’d love to connect with you regarding your contacts, and perhaps discuss the various opportunities we have available. FILTER, located in Seattle WA, is one of the primary providers of digital talent (from graphic design to development) to Microsoft and hundreds of companies along the west coast. I’ve had great luck connecting with experts like yourself, and look forward to hearing from you soon.

    Warm regards,

    —————————————————————————————————-
    LAUREN MILAN TALENT MANAGER / FILTER STUDIOS
    D 206.709.4934
    T 206.568.8000
    F 206.568.8001

    FILTER PURE TALENT.
    CREATIVE RESOURCES FOR BUSINESS
    WE’RE MOVING! AFTER DECEMBER 21ST YOU’LL FIND US AT
    1505 5TH AVE, SUITE 600, SEATTLE, WA 98101. MORE INFO TO COME…

    “Recognizing the need is the primary condition of design.”

  30. Richard Mintz says:

    Hi Josh,

    I am new to WPF and have created a custom control that takes forever to render when many of them are added to a wrap panel. I would very much appreciate your help if you could spare a moment.

    Thanks,

    Richard Mintz
    rmintz@tgo.ca

  31. Gary Bennion says:

    Hi Josh,
    I am a PHP developer working with JS and AJAX. I have recently been offered a job working as a WPF designer. This is quite a big career change for me so I have started looking into your industry more and have been suprised at the lack of WPF jobs out there (UK based)… is this because the technology is still relatively new so not all companies have started using it? Basically I was hoping you could tell me what your opinion of where WPF is heading?

    Thanks
    Gary Bennion

  32. Josh Smith says:

    Gary,

    I think WPF is taking a long time to gain traction, but I have definitely seen it being adopted more and more. Considering the large impact Silverlight will have on the industry once it becomes more feature-complete, I think WPF will be boosted in popularity because of the close parody between the two platforms.

    Josh

  33. Gary Bennion says:

    Thanks Josh – definate food for thought

  34. Matt says:

    http://forums.infragistics.com/forums/p/1154/11722.aspx#11722

    Any chance you ask your employers to fix this blatant bug? Seems a very low response community in comparison to Xceed etc..

  35. bendewey says:

    Josh,

    I’m just starting up my blog. I’d love you support http://bendewey.wordpress.com. Please stay tuned for more.

  36. Jan Swenson says:

    Josh,
    Thank you for providing a quick overview of your passion for advanced GUI development concepts with WPF. I tracked your profile down through searching my network in Linked IN. I was wondering if you could help. I have a client that is looking for a WPF expert to help them create there next generation algorithmic Portfolio trading application. all development will be done in WPF. As I saw your distaste of mundane financial services clients. This is a very exciting company working on the bleeding edge of technology. they see themselves as a Software development company that builds financial software for trading.

    I was hoping to see if you or someone you know would be interested in this type of role. it is very long term and extremely stable. please shoot me an email if you would like to speak about this, or if you know someone, I can pay very large referral fees if you are not interested, but one of your colleagues are :)
    thanks
    Jan Swenson
    SilverSearch Inc

  37. Josh Smith says:

    Jan,

    I know Rich Altamura. He and I already went down this path.

    Josh

  38. A.V.Ebrahimi says:

    Josh,

    Is there anyway to set a font (or any other style) to all children of a panel (e.g. StackPanel) at once?

    Thanks

  39. Tim Dawson says:

    Josh, please contact me. I’d be happy to have my company donate a couple of licenses for our WPF controls as prizes to the competition you’re running.

  40. Josh Smith says:

    Sorry Tim. Your company is a competitor with Infragstics, my employer. That would be a bad move on my part. Thanks anyways, though!

    Josh

  41. Tim Dawson says:

    Ah, I had not realised that all your community contributions were paid for by Infragistics. Competition aside, it’s rather sad that because of this, other WPF control vendors are not able to donate prizes to any community competitions you run.

    Again I’d encourage you to contact me to discuss issues like this further; it’s rather irritating there’s no means to contact you on this website other than a public forum.

  42. Josh Smith says:

    Tim,

    I’m not going to risk putting myself in an undesirable situation at work so that you can advertise your product in my competition.

    Josh

  43. Tim Dawson says:

    Josh,

    I know; we established that three messages ago and my offer of prizes for your competition is withdrawn. Still, as a fellow MVP and expert in WPF it would be good to get in touch with you, so this is why I am urging you to contact me, or provide a means of contact better than this ridiculous public forum.

    Tim

  44. Jason R says:

    Josh,

    We’re working on various in-vehicle projects with a US auto maker and are seeking your expertise. Our entire solution is .NET based and we’re looking to take it to the next level with WPF.

    Please contact me when you have a moment.

    J

  45. mitra says:

    Hi,
    I must write a program with WWF, I have some problems,
    can you help me please?
    Warm regards

  46. Abdolhosein V. Ebrahimi says:

    Hi Josh:

    Is there anyway to customize application at runtime, for example change colors and font…
    example:

    Hi

    I would like to retrieve style name of control, via code.
    Then I would like to change the retrived style in code again and save style to disk for later runs.

    I need this to give customization feature to my end users.

    Thanks and Regards

  47. Nicholas says:

    Hi Josh,

    I read your article “Customize Data Display with Data Binding and WPF” on published on July on msdn magazine but we cannot diplay some figures. (Figure 1, Figure 2…)

    Thanks and Regards,
    Nicholas

  48. Josh Smith says:

    Hi Nicholas,

    Thanks for the heads up. Unfortunately, I am not able to adjust that article, since it is owned by MSDN Mag. I’ll check in with them.

    Thanks,
    Josh

  49. Patrick Lindsey says:

    Josh,

    Just a quick note on your Stretch a Expander Header (way back in Feb 2006). A xaml only solution to change the HorizontalAlignment of the ContentPresenter from Left to Stretch is listed below. The key to the solution is the Binding in the DockPanel which uses Mode=OneWayToSource. And Bea Costa said she couldn’t think of any use for OenWayToSource, sheesh, hehehe :) BTW, I really enjoy your blogs…

    Best Regards
    Patrick Lindsey

  50. Andre says:

    Hi Josh,
    If you create part in your blog like question/answer you can make its more popular.
    And I have first question for this part :)
    There are many troubles with dictionaryresources if you want to use them not only in straight forward maneer. For example try to make generic.xaml theme with 2 merged dictionaries “Global.xaml” and “Control.xaml” and try to use resource from first dictionary in second one. Can you explain what I’m doing wrong and how can I solve this problem?
    Thanks

  51. Lloyd says:

    Josh,

    As I was wondering about posting or not my 1st article to CodePoject I posted a preview link to my blog in the Lounge:

    http://www.galador.net/codeblog/

    As it’s about WPF Marc (Clifton) had a few comments:
    – it’s interesting :-D
    – maybe you should ask Josh if you really need to do what you did in this project?

    So could you give some feedback?
    Basically I’m trying to replace zillion of IValueConverter class with a single ScriptConverter.
    What do you think of my post?

    Thanks!

  52. Josh Smith says:

    Lloyd,

    Cool idea, though it’s been done before, or at least something equivalent has been done. Here’s some links:

    http://www.fikrimvar.net/lestirelim/?p=15

    http://11011.net/archives/000668.html

    I think you should still write the article, though. It is always good to see another approach.

    Josh

  53. Lloyd says:

    Josh….
    I so love WPFIX…. I have to try it tomorrow night (it’s past bed time, I just got up to add some touch to my blog..)

    In fact I have to try both…

    Now I’m a bit disheartened for my article, but I guess I could use my (future, ahum) article as an occasion to mention them

    the good thing is, now I know about those projects, thanks! :D

  54. Lloyd says:

    Hi Josh,

    I studied those articles, particularly the one with Lambda expression as it was the one most appealing to me.

    1st it is a very interesting extension and I would add it in my tool box.

    2nd it would not solve my problem, in fact you will get a token undefined “Brushes”, and I don’t see how to fix it as those Dynamic class from MS are all so complex and I don’t really want to extends them.

    Hower, building on this markup extension idea to generate converters, I made my own with the ScriptConverter.
    In the end you can use an expression such as:

    I’m going to update my blog and CodeProject article with this new information (later this week).

    Do you have any idea on how to modify the article?
    I am thinking of adding a few section at the bottom, but I fear people might miss out on these very interesting development…

  55. Lloyd says:

    I mean an expression such as (< > escaped):
    <TextBlock Text=”{Binding}”
    Background=”{Binding Converter={local:Script ‘if(value%2==0) Brushes.Red; else Brushes.Green;’, {x:Type Brushes}}}”/>

  56. Josh Smith says:

    Unless the article has been edited by CP, if you’re logged in, there should be a Modify link at the top of the article. Click that and you can edit the article.

  57. Lloyd says:

    Hi Josh,
    Here is a more interesting / up to date version:

    http://www.galador.net/codeblog/post/2008/09/23/My-Last-IValueConverter.aspx

    Which include a comparison with the LambdaExtension (and some other idea from it).

    I cannot modify my article page anymore (on codeproject) but I submitted an updated HTML to them as they said in their welcoming article.

    I hope you’ll enjoy the updated article!
    And thanks for your input as well.

    Cheers, Lloyd

  58. Brandi says:

    Josh,

    I have a position coming open in Raleigh NC for someone with programming and analysis skills on WPF. Do you think you might be interested or know of anyone who might be?

    I’d love to chat more.

    Brandi

  59. Kaveh says:

    Dear Mr.Smith,

    I am a fan of your WPF and ViewModel blogs, specially the ones related to the TreeView control … I’va been able to develop a nice looking Organization Chart for our corporation thanks to your advices and blog posts and I’d be more than happy to send you some of the snapshots I’ve taken.

    Also, now that I’ve finished this aforementioned project, I’ve been assigned a much more adventurous one demanding an even more complicated TreeView layout with multiple levels of horizontal and vertical child nodes for each parent node in a way that I’m really hesitant if it is possible at all to do it via TreeView. So I was wondering if I could possibly contact you somehow and share the snapshots as well as a draft of my problematic TreeView layout to see if you could kindly impart me with your advices :)

    Thanks,

    Kaveh

  60. BW says:

    Your writings have been invaluable in helping me get introduced to WPF (among other things). Your MV-ViewModel based approach is something we’re starting to use with real success in our projects. Thank you for this great service you provide to so many of us geeks!

  61. Josh Smith says:

    Thanks a lot, BW. I really appreciate that!!

  62. Sal Tenorio says:

    Hey Josh,

    First of all thanks for all the work you are doing here and on your iJoshSmith blog (your turning into the dark side got me thinking about looking into it myself but without giving up to my truthful roots).

    Anyway, I wanted to ask a quick question. I am planning on using your MVVM Foundation classes for a silverlight project (and perhaps even on Windows phone 7) and wanted to ask if you would have any comments about it. I have not taken a deep look at the implementation yet so was hoping you could tell me if there are any caveats or something to beware of.

    Thank you and please keep it up, and remember, it is never late to come back to the Jedi order. :)

    Sal.

  63. Maybe you can give me some suggestions. We were seeing a memory leak in our WPF 3.5 app on XP. We found two updates that addressed the issue, one being KB967634. But (a) i’m not sure KB967634 can be distributed legally in our installer and (b) KB967634 causes XP’s Windows Updates to get stuck in a loop.

    What I am looking for is sanctioned updates that include the fixes in KB967634, KB981107, etc.

    The details on KB967634 refer to:
    presentationcore.dll v3.0.6920.4000
    wpfgfx_v0300.dll v3.0.6920.4000
    Can I assume that any versions of the DLLs that are greater will also contain the needed fix, or no?

    I tried searching for KB967634 and for presentationcore.dll, but have not found the needed information.

    Greg

  64. navid says:

    hello sir
    i had a question about your wpf canvas control.
    i used some code to load my user controls dynamically but when i add it to the your canvas it gets error. and i searched a found it reason , it is an error because i have two or more object with one property. the error is :
    “Specified Visual is already a child of another Visual or the root of a CompositionTarget”

    please help me about solve it.
    thanks alot navid

  65. jojo says:

    Hi dear Josh
    I have an urgent question , I’m a biginner at Dot.net and I’m working on a wPF project using the MvvM light toolkit , I don’t seem to unserstand how to make my data base manipulable, I used to work on J2ee so I still got that idea of transforming my relational data base mapped to objects where each table becomes a class ( a .cs file) ( all into the model folder because it’s an mvvm design pattern ) so i tried Ado.net entity framework but all the classes were in one file as partial classes , so I don’t know what to do , actually i start to lose my stratgy of thinking so please help me am totally clueless !

  66. ml says:

    Josh,

    Just looking for a quick answer (if possible) here…I am developing a line-of-business risk analysis app which will also be accessed via an extranet by external clients. I am debating between a Silverlight/WCF-RIA app and an HTML4/JQuery/Knockout.js app. My current skill set is definitely around Silverlight/wPF. Performance is a concern. Any quick thoughts on this?

  67. rafeie says:

    Dear Josh

    I read your amazing article about ‘Custom TreeView Layout in WPF’ at the CodeProject. You mentioned there that:

    “Unfortunately there is no supported way to programmatically set the selected item in a TreeView. The TreeView’s SelectedItem property does not have a setter. As a result, I could not customize the keyboard navigation for the TreeView…”

    I worked around this problem and fortunately succeeded. As an appreciation, I’d like to give it to you. Please e-mail me if you want it.

    Thanks

  68. Ali says:

    Hi josh
    I have question about some windows API techniques, it seems this place only for WPF question, can i have you’r email or other place to ask my question?

    Sincerely
    Ali

  69. mrvishrut says:

    Hi Josh, I have a question.

    My task is to create custom panel based canvas that will interact in design time (possible using PlacementAdapter and ParentAdapter abstract classes) and handle size/position of standard controls like TextBox or Label when such a control become child of the custom panel.

    I am looking for looking into PlacementAdapter and ParentAdapter classes examples.

    Any help is welcome in advance.

  70. Daniel Wiebe says:

    Josh,

    I was wondering if it was ok to use your code samples that you have on this site in a commercial application. I don’t see any license mentioned on your site for the code samples in your blog, so I have to ask. (my understanding, which could be flawed, is that if you don’t put a license on your code, then it is copyrighted by default and cannot be used without permission)

    Thanks!

  71. Josh Smith says:

    Daniel,

    Feel free to use the code, but if anything goes wrong and the code needs to be fixed or damage is done, I claim no responsibility. Use the code as-is.

    Josh

  72. Daniel Wiebe says:

    Josh,

    Thank you! Much appreciated.

    Daniel

  73. Meg says:

    Hello,
    How do I get the treeview selecteditem to be displayed in another form?
    Fx. from your sample on customer/orders/orderdetails…
    is it possible to click one item from the ordetails, and display it on another form or grid etc. Let’s say if I want to click on “Glue” only and want to get the details on quantity on another form/grid displayed along “Glue”. Would you please help me?

    Thank you

  74. Valeria says:

    Hi Josh!
    I’m an italian .net developer.
    I’d like to ask you a technical question about drag&drop with listbox. Which is the best way, if it is not a problem, to contact you? Thank you so much

    Valeria

  75. Andreas says:

    thank you so much for all the effort you put into your articles

  76. Jared says:

    Hi Josh,

    For quite a number of years, I have been developing desktop applications using Winforms/MVP. When I switched to WPF/MVVM, I did find it a total turn around as far as development perspective is concerned. Perhaps one of the current hurdles I’m working on right now is the correct implementation of Modal Forms in WPF while maintaining pure MVVM implementation. I have seen a couple of articles online – most are using the code behind on the view/form – which should not be in MVVM. I appreciate you pointing me to the right direction here.

    you can email me

  77. lynda spiegel says:

    Josh – do you know any .NET developers with at least a year’s experience with iOS? I have a full time opening. Please contact Lynda Spiegel spiegwrite@gmail.com. Thanks

  78. MJ says:

    Josh,

    I have some C#/VB/Powerbuilder background and am wanting to move into WPF/Silverlight development. From your point of view, how is the market and future need for these technologies ? You seem to be doing okay. Thanks!

  79. Josh Smith says:

    MJ,

    That’s a tough question. It’s pretty widely known that Microsoft doesn’t consider WPF or Silverlight to be platforms worthy of much support and new features, and are on the retirement track. With that said, WPF and SL aren’t going anywhere anytime soon, and a lot of companies have systems that rely on those platforms for the presentation layer. So, you be the judge. Really…the whole Microsoft development world is topsy turvy these days, no one really knows what to expect. Windows 8 and WinRT with JavaScript and HTML5 support is a massive curveball for most front end MSFT devs. That’s part of the reason why I am now an iOS developer. ;)

    Josh

  80. WPF Developer says:

    I would appreciate getting your feedback on what you think of this? Perhaps, it could help make WPF programming easier or more approachable for those who still may be resisting?:

    http://wpfantidatabinding.codeplex.com/

  81. Abdulaziz says:

    Dear Josh
    our company are going its design pattern to MVVM

    we want to have some courses and get better knowledge related to mvvm and prism

    so please provide us with training courses that you better know
    or if you can provide training for us.

    regards and many thanks

  82. Abdulaziz says:

    Dear Josh
    our company are going to move its design pattern to MVVM

    we want to have some courses and get better knowledge related to mvvm and prism

    so please provide us with training courses that you better know
    or if you can provide us with a training session.

    let me know your answer.

    regards and many thanks

  83. Josh Smith says:

    Sorry Abdulaziz, I don’t do training. I’m not sure which companies provide good MVVM training, but I assume PluralSight would be a place to start.

  84. aaa says:

    http://joshsmithonwpf.wordpress.com/2007/03/29/tips-on-how-to-debug-and-learn-about-wpf/

    Debug WPF like normal .NET application – it possible it? I mean, automatically jump to the offending code line. Why doesn’t this work with WPF? Answer would be greatly appreciated!

  85. AbdulAziz says:

    Dear Josh
    I would like to ask, I am using Linq to SQl in DAL, so is it possible to use auto-generated methods provided automatically by .dbml class in MVVM?

    also, can you provide me the a complete example of CRUD operations in MVVM using linq-to-sql , C#

    regards and many thanks

  86. Rafat Sarosh says:

    Just want to say thank you! I am greatly benefited by your contribution to blogs/codeproject.com etc. Keep it up.

  87. Andy Evans says:

    Josh,

    Thanks for the great samples you have provided. I have seen that you have said on the page to individuals that it’s OK for them to use the code samples that you have on this site in a commercial application with no restriction other than that the code is as-is and you have no responsibility if anything goes wrong. I have been asked to inquire specifically about confirming the same permission for use by my company, Philips (officially Koninklijke Philips Electronics N.V.).

    Thanks.

  88. Josh Smith says:

    Andy, yes the same applies to your company.

    Josh

  89. vjbk says:

    Josh,

    Can I provide a link to this site in one of my blogs that I am planning to post pretty soon?

    Thanks,
    Vijay

  90. Josh Smith says:

    Sure thing, vjbk.

  91. Fred Zimmerman says:

    Josh,

    I tried to send you email on running source code (project) generating error message from 2009 MSDN article on MVVM.
    It got bounced back to me with invalid email address (from article).

    Fred Zimmerman (Reston, VA)
    FredZimmerman@gmail.com

  92. Nik says:

    Hi Josh,

    I came across one of your articles on CodeProject.com, specifically the one entitled “Creating an Internationalized Wizard in WPF”. It has given me a good understanding for the ideas behind a wizard, however I have hit a stumbling block. I can’t seem to grasp how I can take the sample you provided and modify it. What I am trying to build is a wizard to entering default configuration information. One screen that requests username/password and the second step that asks for some default file locations. How can I utilise the ideas of your Wizard approach for fields that require user input rather than selecting of options?

    Many thanks for any help you can provide,

    Nik

  93. Adam says:

    Hi Josh. I’m reviewing WPF using MVVM and found your article about it. Wondering if you know of any link to a conversion from this 2008 to 2010. It seems a chore to convert this while I am unable to find a copy of VB 2008 Express and I try to build this from your code in VB 2010 Express. Please. Some help? Thanks man. ~ Adam

  94. Steven says:

    Hi Josh… I came across your article “WPF Apps With The Model-View-ViewModel Design Pattern”. I’ve been struggling to get my application written using WPF, SQLite in the MVVM pattern. I found your article very useful, but am stuck on the
    “// In a real application, the data would come from an external source,
    // but for this demo let’s keep things simple and use a resource file.”

    … I’m looking to interface it to an SQLite database. Could you give me some pointers on what to change?
    Regards Steven

  95. Nice work bro. I love cracking. Pls upload installer.

  96. […] clearly seems to be an unwanted behavior, probably an issue. Josh Smith in his blog, explained a solution for this problem. But it is not so straightforward. Instead of […]

  97. Doug says:

    Josh. Hi. I’m a recruiter with a question. I need to test some candidates on their skill level with Winforms. We subscribe to Brainbench, but Brainbench doesn’t have a test for Winforms (or WPF and WCF either). Do you know if any testing services out there that provide tests on these subjects?

    Thanks,
    Doug Balch
    dbalch@aquinasconsulting.com

  98. Steve Newbery says:

    Hi Josh, I’m learning WPF and found your legendary article ‘WPF Apps With The Model-View-ViewModel Design Pattern’ in the Feb 2009 edition of MSDN Mag, but the link to the source code no longer works … would you happen to know where I can get it? I’ve scoured the internet with no luck so far. Many thanks Steve

  99. Hi Josh, I’m writing an article for MSDN Magazine that’s about Commands and WPF (with an interesting twist) – it has been accepted – would you be able to act as a reviewer?
    Thanks
    Tarquin

  100. Josh Smith says:

    Congrats Tarquin! Thanks for asking, but I’m no longer a viable tech reviewer for WPF articles. It’s been years since I last cracked open Visual Studio or wrote XAML.

  101. What!!! I thought you were coding guru supreme. No doubt you’ve moved on to bigger and better things. Thanks anyway.

  102. Manoharan says:

    How to open and close popup window from parent in WPF using MVVM?

    Please see my below code,tell me the solution for issue.

    I create separate model,view,viewmodel for child usercontrol and parent usercontrol.

    I try to open the popup window from parent window.I create separate view,viewmodel for child usercontrol and used inside the popup control of parent usercontrol.

    I am getting issue and also how to close the popup window from the button click of child usercontrol.

    I am getting this below issue:
    —————————–
    A first chance exception of type ‘System.Windows.Markup.XamlParseException’ occurred in PresentationFramework.dll

    Additional information: ‘No matching constructor found on type ‘parentchild.View. ParentView.’. You can use the Arguments or FactoryMethod directives to construct this type.’ Line number ‘9’ and line position ’10’.

    If there is a handler for this exception, the program may be safely continued.

    Here I am using WPF using MVVM pattern with Prism Framework.

    MainWindow.xaml:
    —————-

    parentView.xaml:
    ————

    parentView.xaml.cs:
    —————-
    public partial class parentView : UserControl
    {
    public parentView(ParentViewModel parentViewModel)
    {
    InitializeComponent();
    this.DataContext = parentViewModel;
    }
    }

    ParentViewModel.cs:
    —————-

    public class ParentViewModel : INotifyPropertyChanged
    {
    private readonly IEventAggregator eventAggregator;

    private RumModel currenrumModel;

    private string resultMessage;

    private bool _popupIsOpen;

    public RumViewModel(IEventAggregator eventAggregator)
    {
    currenrumModel = new RumModel();

    this.tosscardCommand = new DelegateCommand(this.Execute, this.CanExecute);

    if (eventAggregator == null) throw new ArgumentNullException(“eventAggregator”);
    this.eventAggregator = eventAggregator;

    }
    public bool IsPopupIsOpen
    {
    get { return _popupIsOpen; }
    set
    {
    _popupIsOpen = value;
    NotifyPropertyChanged(“IsPopupIsOpen”);
    }
    }
    public RumModel currentRum
    {
    get
    {
    return currenrumModel;
    }
    set
    {
    currenrumModel = value;
    }
    }
    public bool tossButtonEnabled
    {
    get { return this.currenrumModel.tossButtonIsEnabled; }
    set
    {
    this.currenrumModel.tossButtonIsEnabled = value;
    this.NotifyPropertyChanged(“tossButtonEnabled”);
    }
    }
    public Visibility popupVisibility
    {
    get { return this.currenrumModel.popupVisibility; }
    set
    {
    this.currenrumModel.popupVisibility = value;
    this.NotifyPropertyChanged(“popupVisibility”);
    }
    }
    #region commands
    public ICommand tosscardCommand { get; private set; }
    public ICommand cancelGameCommand { get; private set; }
    #endregion

    private bool CanExecute(object arg)
    {
    return true;

    }

    private void Execute(object arg)
    {
    popupVisibility = Visibility.Visible;
    IsPopupIsOpen = true;
    eventAggregator.GetEvent().Subscribe(PopupAction, ThreadOption.UIThread);
    }

    private void PopupAction(bool popup)
    {
    IsPopupIsOpen = popup;
    }
    private void RaiseCanExecuteChanged()
    {
    DelegateCommand tosscommand = tosscardCommand as DelegateCommand;
    tosscommand.RaiseCanExecuteChanged();

    }
    #region INotifyPropertyChanged Members

    public event PropertyChangedEventHandler PropertyChanged;

    private void NotifyPropertyChanged(string propertyName)
    {
    if (this.PropertyChanged != null)
    {
    this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
    }

    #endregion
    }

    ChildWindowView.xaml:
    ——————–

    ChildWindowView.xaml.cs:
    ——————–
    public partial class ChildWindowView : UserControl
    {
    public ChildWindowView(ChildWindowView child)
    {
    InitializeComponent();

    this.DataContext = child;
    }
    }

    ChildWindowViewModel.cs:
    ————————

    public class ChildWindowViewModel : INotifyPropertyChanged, IInteractionRequestAware
    {
    private ChildWindowModel currentChildWindow;
    private readonly IEventAggregator eventAggregator;
    private IService service;

    public ChildWindowViewModel(IEventAggregator eventAggregator,IService service)
    {
    currentChildWindow = new ChildWindowModel();
    this.eventAggregator = eventAggregator;
    this.service = service;

    this.SubmitCommand = new DelegateCommand(this.OnSubmit, this.CanSubmit);
    }
    private void RaiseCanExecuteChanged()
    {
    DelegateCommand command = SubmitCommand as DelegateCommand;
    command.RaiseCanExecuteChanged();
    }

    public ChildWindowModel currentTimer
    {
    get
    {
    return currentTimer;
    }
    set
    {
    currentTimer = value;
    }
    }

    public string setTimer
    {
    get { return this.currentChildWindow.setTimer; }
    set
    {
    if (this.currentChildWindow.setTimer != value)
    {
    this.currentChildWindow.setTimer = value;
    NotifyPropertyChanged(“setTimer”);
    RaiseCanExecuteChanged();
    }
    }
    }
    public string errMessage
    {
    get { return this.currentChildWindow.errMessage; }
    set
    {
    if (this.currentChildWindow.errMessage != value)
    {
    this.currentChildWindow.errMessage = value;
    NotifyPropertyChanged(“errMessage”);
    RaiseCanExecuteChanged();
    }
    }
    }
    public ICommand SubmitCommand { get; private set; }

    private bool CanSubmit(object arg)
    {
    return true;
    }

    private void OnSubmit(object arg)
    {

    try
    {

    if (string.IsNullOrEmpty(setTimer))
    {
    this.errMessage = “Please enter Rescheduler Timer value”;
    }

    if (this.FinishInteraction != null)
    this.FinishInteraction();

    }
    catch (Exception ex)
    {
    throw ex;
    }
    }
    public Action FinishInteraction { get; set; }
    public INotification Notification { get; set; }

    #region INotifyPropertyChanged Members

    public event PropertyChangedEventHandler PropertyChanged;

    private void NotifyPropertyChanged(string propertyName)
    {
    if (this.PropertyChanged != null)
    {
    this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
    }

    #endregion
    }

  103. Vijay says:

    The constructor of the view (child and parent in your case) needs to have a default empty constructor with InitializeComponent in it. In your case both the views don’t have the default constructor and hence the issue.

    There are other ways to assign the DataContext of the view to the view model. If you use the Dependency Injection it will be easier to create these view models on the fly and assign the data context of the view to the view model.

    Looking at your code, looks like you are using Prism’s IEventAggregator, isn’t that right? If so, then you can use Export attributes on your view model and inject them into the Views by using the overridden constructor with the ImportingConstructor attribute on your view.

    Hope this helps. Let me know if you need anything.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 289 other followers

%d bloggers like this: