Click here to Skip to main content
12,623,511 members (30,115 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

2.6K views
Posted

C# equivalent of VB's With keyword

, 15 Feb 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
It's not realy an alternate - but I think it should be mentioned. Most time you have this kind of code during initialization. So why not use this:StatusProgressBar spb = new StatusProgressBar() { IsIndeterminate = false, Visibility = Visibility.Visible, ...
It's not realy an alternate - but I think it should be mentioned. Most time you have this kind of code during initialization. So why not use this:

StatusProgressBar spb = new StatusProgressBar() {
                 IsIndeterminate = false,
                 Visibility = Visibility.Visible,
                 Minimum = 0,
                 Maximum = 100,
                 Value = 50
            };
So if you only want to save typing during object creatio, this is the way to go. No performance penalty (no delegate, or extra variable instance needed).

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

johannesnestler
Austria Austria
No Biography provided

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161128.1 | Last Updated 15 Feb 2012
Article Copyright 2012 by johannesnestler
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid