• 13
  • Mar
  • WPF doubts
  • Decided to try out WPF a couple of days ago, and since information regarding it is still quite rare, and I hardly have some spare time I'm quite lost regarding the develop of big applications...

    - How can I open another window? they don't have any Show() method like forms :?.

    - How can I make a MDI container? I haven't seen any method or property either...

    - When adding a form buttons and other controls have their Win32 look, anyone knows if this is normal? and if so, how can I change the behaviour?

    - What are the new 3.0 project types for? I refer to those like the WPF pages...

    Thanks in advance for your replies.


  • Hi Neverbirth,
    I'll take a shot at answering them:
    How can I make a MDI container? I haven't seen any method or property either...
    I do not know, for I have never used (don't remember) MDIs.

    When adding a form buttons and other controls have their Win32 look, anyone knows if this is normal? and if so, how can I change the behaviour?
    Yes, that is normal. By default, all controls are displayed in the style of their OS theme such as Vista's Aero or XP's Luna and Royale. You can create custom controls that override this behavior, and while you can do that directly writing XAML, it is much easier using a visual editor like Expression Blend.

    The namespaces you mention are used to primarily to integrate WinForms controls into a WPF application. Either way, you will still see OS-specific versions of the controls unless you create your own or modify an existing control.

    What are the new 3.0 project types for? I refer to those like the WPF pages...
    The new project types specify a XAML file for the UI and a code-behind file for the application logic. This is very similar to ASP.NET pages where your ASPX file consists of the HTML front-end and a back-end file written in C# or VB for creating interactivity. Even WinForms application used this idea with the .cs and .designer.cs files, but the separation between UI and logic is more obvious in WPF.

    Hope that helped!

    :bu:


  • For learning about specific controls and functionality in WPF, this is a good place to start: http://msdn2.microsoft.com/en-us/library/ms754130.aspx Beyond just browsing, I cover two books that I really liked for learning WPF here: http://blog.kirupa.com/?p=80

    Briefly, Flow Documents are controls that allow you to store text and other related information. Depending on the space available, you can specify how the control behaves such as adding an extra column, etc.

    ResourceDictionaries are like containers where styles and related information are stored. You can change your application's theme, for example, by adjusting which ResourceDictionary is used.

    A PageFunction is a class that derives from Page and is used primarily for returning data. For example, let's say you have a series of pages and want to pass data from one page to a previous page. Creating that functionality manually could be tricky, so you can use PageFunctions instead.

    While we are at it, a Page, like you mention, is used for making it easier to navigate between sections of an application. Beyond that, I am not sure why you are unable to navigate more than two pages at once. It would require me fiddling around with your application's source code. Basically, navigation should be pretty automatic when you use this.NavigationService.Navigate(new content)

    Concering the different style of your WinForms form inside your WPF file, can you attach a sample project that I can open in VS and test out? WinForms has a VisualStyle property, but I've never used it nor modified it, for it worked pretty well by default. It seems like it doesn't when hosted inside a WPF project, so looking at an example can help me out a bit more.

    Cheers!
    Kirupa :)


  • - How can I open another window? they don't have any Show() method like forms :?.

    Just realized that windows do have a Show() and ShowDialog() methods, although, unlike Windows Forms, you are forced to make an instance of the window to show.

    - When adding a form buttons and other controls have their Win32 look, anyone knows if this is normal? and if so, how can I change the behaviour?

    I've read about a couple of classes called ElemenHost and WindowsFormsHost that I don't know if have any relation with this, but I can't seem to be able to use them :S, according to the MSDN they are in the System.Windows.Forms.Integration namespace, and haven't find any Integration package.

    Still no luck with the other questions.


  • I would suggest you to download and use VS 2008 so that you get a feel of it. I am running VS 2005 and VS 2008 in the same machine (Vista Ultimate). I was previously running Beta 1 in the same way. There is nothing to fear ;)

    There are some issues when uninstalling VS 2008 if you have VS 2005, that's why I've downloaded the Express edition (one of the things the it lacks is the framework choice tho, it's a shame). The issues are nothing serious, you just have to reinstall some things, but since I'm so busy and trying to work with VS most time decided not to try it. There is a list of all known issues on MS site.


  • There are some issues when uninstalling VS 2008 if you have VS 2005, that's why I've downloaded the Express edition (one of the things the it lacks is the framework choice tho, it's a shame). The issues are nothing serious, you just have to reinstall some things, but since I'm so busy and trying to work with VS most time decided not to try it. There is a list of all known issues on MS site.

    If you feel its not safe to try it in a production machine, install a virtual machine and install VS on that. Dude, unless we tryout the new things, its hard to tell ;) and moreover you just cant get moved by the posts here, you have to use VS to see whether it fits your need


  • Well... I already tried using google and didn't find a good list... and actually... decided to download VB 2008 Express edition yesterday, and it turned out that it comes with a list of the new things it has ^^U... also, according to the Wikipedia VB 2008 it has a true ternary operator in order to replace the Iif function, but I haven't seen anything regarding this :?.

    I would suggest you to download and use VS 2008 so that you get a feel of it. I am running VS 2005 and VS 2008 in the same machine (Vista Ultimate). I was previously running Beta 1 in the same way. There is nothing to fear ;)


  • I do not know, for I have never used (don't remember) MDIs.

    Really? Well, guess you've never had to use them.

    Yes, that is normal. By default, all controls are displayed in the style of their OS theme such as Vista's Aero or XP's Luna and Royale. You can create custom controls that override this behavior, and while you can do that directly writing XAML, it is much easier using a visual editor like Expression Blend.

    The namespaces you mention are used to primarily to integrate WinForms controls into a WPF application. Either way, you will still see OS-specific versions of the controls unless you create your own or modify an existing control.

    I think you've misunderstood me, I'm not talking about WPF controls themselves, what I meant is that when using a Windows Form inside a WPF project the buttons on the form looks like the Win32 (well, pre-WinXP) ones.

    The new project types specify a XAML file for the UI and a code-behind file for the application logic. This is very similar to ASP.NET pages where your ASPX file consists of the HTML front-end and a back-end file written in C# or VB for creating interactivity. Even WinForms application used this idea with the .cs and .designer.cs files, but the separation between UI and logic is more obvious in WPF.

    I guess I haven't been too clear with my question, I was refering to the new 3.0 items that can be added to a project.

    I realized yesterday that for example WPF Pages are for making some navigation among different project parts, but I haven't had any time to look at them in depth... I just know they habe to be contained by either a window or a frame, and haven't been able to make it navigate more than two pages...

    I still don't know what Flow Documents, ResourceDictionaries and PageFunctions offer.

    Hope that helped!

    Of course, any reply if always appreciated. Thanks.


  • Have a look at this blog (http://www.danielmoth.com/Blog/) regarding new features included in VS 2008 and also if you do a google search you may end up many results :D

    The most important difference one can tell is,

    Well... I already tried using google and didn't find a good list... and actually... decided to download VB 2008 Express edition yesterday, and it turned out that it comes with a list of the new things it has ^^U... also, according to the Wikipedia VB 2008 it has a true ternary operator in order to replace the Iif function, but I haven't seen anything regarding this :?.


  • Thanks for the information, although I'm currently so busy that I haven't had any time to look deeper into it. Also, thanks for the references, I think I may gonna try to get the WPF Unleashed book some time in the future... I'm already trying to finish reading other books.

    About the windows form controls... I guess I'm making something in the wrong way... when creating a WPF project just add a Windows Form with a normal button. Then just show the form (either making an instance of it or not, doesn't matter), and the button will have it's old look instead the XP one... I was just curious for trying this out, there was not legitimate reason of doing it.

    EDIT: BTW... I know this is a bit off-topic regarding the thread subject... but seeing you are more up-to-date than I, and you have more/better knowledge and access to books, I was wondering if you happen to know if there is already some book out there, or in the works regarding VS 2008, and where to find some of the differences with VS 2005, specially oriented to VB.Net, since it's my main framework.


  • If you feel its not safe to try it in a production machine, install a virtual machine and install VS on that. Dude, unless we tryout the new things, its hard to tell ;) and moreover you just cant get moved by the posts here, you have to use VS to see whether it fits your need

    Well, I'm not gonna miss anything important because of using the Express version, it has all the new things added to VB 2008, like LINQ, type inference, etc, which is my main interest of using it already.


  • Have a look here (http://channel9.msdn.com/Showpost.aspx?postid=333940) to get overview of .net 3.5


  • regarding VS 2008, and where to find some of the differences with VS 2005, specially oriented to VB.Net, since it's my main framework.

    Have a look at this blog (http://www.danielmoth.com/Blog/) regarding new features included in VS 2008 and also if you do a google search you may end up many results :D

    The most important difference one can tell is,

    1) Inclusion for support for .NET framework 2.0,3.0,3.5. You could actually create a solution in any of these frameworks when creating a new project :)

    2) Integration of Form Controls in WPF. The WPF Editor is good and also good changes in the Add Service Reference (for WCF Services and ASMX Web Services)

    3) Good integrated support for LINQ (iow, C# 3.0)

    Regards,
    Chaks (http://chakkaradeep.wordpress.com)







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about WPF doubts , Please add it free.