Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

Zhou Yong footballism Another Paradigm Shift!
  • WPF: Find elements of specific type in FlowDocument

    spivonious said:

    If the current Block is a Paragraph, you could check it's Inlines property for any Hyperlink objects.

     

    I don't think FlowDocument is designed to be that interactive.

    If I remember correctly, HyperLinks will be part of the logical tree of FlowDocument, so a simple pre-order traversal over the logical tree starting from the FlowDocument down to the reaf element should do the trick.

     

    Yong

  • Why can't MS create a new browser based on .Net?

    staceyw said:
    figuerres said:
    *snip*

    "that does not mean that the browser is not there..."

    I did not say otherwise.  The browser (in terms of SL) is really only used for the display canvas and a bridge for clicking back into legacy html pages (IE should feel so used Smiley)  However the browser proper (e.g. IE) is not required for SL.  So SL/xaml is, in effect, a new .net based browser - that parses xaml instead of html and has its own display processor.  This is shown clearly with SL hosted outside the browser using its own host.  My point has only been that .net tech in browser senerios works today and has value, unlike what others are saying.  I have only pointed out SL as a prime example.

    -> So SL/xaml is, in effect, a new .net based browser - that parses xaml instead of html and has its own display processor.  This is shown clearly with SL hosted outside the browser using its own host.  My point has only been that .net tech in browser senerios works today and has value, unlike what others are saying.  I have only pointed out SL as a prime example.

    Nope, the parsing of XAML and rendering of SL visual tree are all done in unmanaged code, core CLR is only used to expose those features to managed code, since in V1, people still needs to use Javascript which desktop developers doesn't enjoy writing and web developers are tired of writing in it too, so core CLR is just very thin wrapper around the underlying unmanaged SL runtime.

    Actually, the existing WebBrowser control could be retrofitted to workaround the infamous airspace issue by rendering HTML in HWNDless mode, no need to rewrite it from scratch.

    Zhou Yong

  • Why aren't there more WinForms talks?

    harumscarum said:

    Hey thanks I'll have to watch this. I work with software that we can integerate with asp.net, winform, ect. I always prefer to use winforms first because they are the easiest to work with. ASP.net to me after 1.1 seemed to be the most over engineered platform in .net.

    ->I always prefer to use winforms first because they are the easiest to work with. ASP.net to me after 1.1 seemed to be the most over engineered platform in .net.

    Nope, from my personal experience, WCF is the most over-architectured, then comes CAS, then comes WPF, I never use Entity Framework, but lots of guy also complain about it too:

    http://efvote.wufoo.com/forms/ado-net-entity-framework-vote-of-no-confidence/

    Zhou Yong

     

     

  • Why aren't there more WinForms talks?

    JohnAskew said:

    With the adoption of WPF often coming as an interop -piece-by-piece- substitution across existing WinForms applications, this perspective would be a good one to focus upon. What are best practices for migrating a WinForms suite to WPF incrementally, mixed, interoperational?

    footballism just contributed a tidbit of knowledge regarding use of BindingListCollectionView in ViewModels to help with interop situations, ViewModels, and DataSets...

    Other than this, WinForms is going the way of the DoDo bird, imho.

    -> What are best practices for migrating a WinForms suite to WPF incrementally, mixed, interoperational?

    ElementHost and WindowsFormsHost are the things which you could plug into WPF visual tree or Windows Forms' hwnd parenting tree to enable Windows Forms & WPF interop, but there are many issues when mixing heterogeous content, such as airspace issue, focus interop issue, and Windows Forms/WPF message pump interop issue etc etc.

    I've dealt with many such issues, so probably I just look at this from a very buggy mindset:)

    Zhou Yong

  • MVVM

    JohnAskew said:
    footballism said:
    *snip*

    BindingListCollectionView -- good information to have, thanks Zhou.

    You don't have issues with ADO Entity Framework and WPF data binding, do you?

    ->You don't have issues with ADO Entity Framework and WPF data binding, do you?

    Well, to be honest, I've never used Entity Framework myself, there are just two many new technologies or even old technologies I need to learn about, Entity Framework is not on the top of my to-learn list:)

    But as long as you are working with POCO, and directly obey INotifyCollectionChanged/INotifyPropertyChanged contract instead of going through BindingListCollectionView adaptation layer, you must be fine with, I think the deep issue right here is that IBindingList notification contract is heavily tested against Windows Forms data binding engine I guess, and when WPF team tried to adapt it into WPF world, better things happen:), I've debugged a weird bug deep inside the ADO.NET DataTable code which misses a critical notification chance to notify the WPF UI as clearly illustrated in those MSDN WPF forum threads:

    http://social.microsoft.com/Forums/en-US/wpf/thread/e9ddd299-4182-4760-9ec8-68f49e8a59ba

    I am the guy who called Marco Zhou, I know I got two many names over the web I know it:)

    Zhou Yong

  • You expect this to happen in China, not the UK...

    ManipUni said:
    footballism said:
    *snip*

    Because people like to use China as an example of "one of those bad states." Which is fairly hypocritical given how the UK has arguably a greater surveillance society and our own great firewall. We also cannot take photos in undisclosed locations, can be arrest for nothing, and certain information (or collections of information) are illegal to own. Like for example Science books if you happen to be from the Middle East.

     

    Then your country should take the lion's share of the "one of those bad states" honor as while.

    Zhou Yong

  • MVVM

    aL_ said:
    vesuvius said:
    *snip*

    well even if you use stored procedures you still need to call them from somewhere in your code, thats where the repository comes in, so that you can just swap out those calls for mocked versions.. imo mvvm has very little to do with using stored procedures or not, thats part of the model, not the viewmodel..

    who says you have to ignore the dataset change tracking? just stick datasets in your viewmodel and use INotifyPropertyChanged Smiley you dont have to use ObservableCollection at all (although it may be faster to do so) you could even implement your own thin generic wrapper based on INotifyCollectionChanged around datasets and raise the appropriate events as they are raised by the dataset..

    remember, the viewmodel is just the glue that binds the ui to the model implementation, in this case the dataset [or poco or EF or linq2sql or whatever]

    -> who says you have to ignore the dataset change tracking? just stick datasets in your viewmodel and use INotifyPropertyChanged Smiley you dont have to use ObservableCollection at all (although it may be faster to do so) you could even implement your own thin generic wrapper based on INotifyCollectionChanged around datasets and raise the appropriate events as they are raised by the dataset..

    You don't need to do that yourself, you could simply use BindingListCollectionView to wrap the DataView, and expose it as a property on the ViewModel, BindingListCollectionView will help adapting the Windows Forms' IBindingList contract into WPF's INotifyCollectionChanged contract.

    Disclaimer, binding to ADO.NET data is the buggiest piece of feature inside WPF' data binding subsystem, please take my words serious, since I've done a lot of debugging on ADO.NET binding in WPF:)

    Zhou Yong

  • Perhaps SQL isn't interesting? But it sure is !

    JoshRoss said:
    Sabot said:
    *snip*

    I haven't looked through the training material. However, I find most training docs rather drab.  Have you solved any of Itzik Ben-gan's puzzles? He publishes some good ones! 

    -> Is SQL interesting to learn?

    Probably not, since I favour the object or model driven approach:

    http://odetocode.com/Blogs/scott/archive/2008/07/14/12185.aspx

    BTW, I  am a networking (WCF), GUI (WPF) guy, I hate Database and Silverlight:)

    Zhou Yong

  • You expect this to happen in China, not the UK...

    blowdart said:
    ManipUni said:
    *snip*

    Investigative reporting

    As w3bbo said this has nothing to do with the government at all, the news paper's interest was piqued for whatever reason, and they wanted to reveal his name. He sued to stop them. And lost.

    Government didn't drive it, government didn't care, and the ruling does make sense. If you start pinning up manifestos on church doors you have no expectation to privacy, why is blogging different?

    I am just glad to know how the incident which happens in UK relates to China?

    Zhou Yong

  • https but ​request.is​Secure​Connection returns false

    W3bbo said:
    footballism said:
    *snip*

    Hey, you're back. I last saw you in... 2005 was it?

    Yup, I am back for fun. Good to see you here again:)

    Zhou Yong