eclipsed4utoo's Profile User Rating: *****

Reputation: 1511 Grandmaster
Group:
Moderators
Active Posts:
6,019 (3.19 per day)
Joined:
21-March 08
Profile Views:
68,214
Last Active:
User is offline May 15 2013 07:48 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Playstation
Your Car:
Mitsubishi
Dream Kudos:
1775
Expert In:
.NET

Latest Visitors

Icon   eclipsed4utoo says, don't take downvotes personal. You gave information/code that was either wrong or should have been better. Get over it.

Posts I've Made

  1. In Topic: Binding a list<string> to ListBox

    Posted 16 Apr 2013

    For your previous code to work, you should change how you are binding. First, you are binding to the property, but calling the .Add method on a list doesn't actually call the 'setter' of that property, which means it's not calling the NotifyPropertyChanged method. So you could change it to this...

    <ListBox 
             x:Name="MyListBox"
             Grid.Column="0"
             Grid.Row="10"
             Grid.ColumnSpan="2" 
             Background="Transparent"
             ItemsSource="{Binding}"/>
    
    


    public partial class MainWindow : Window, INotifyPropertyChanged
        {
            public event PropertyChangedEventHandler PropertyChanged;
    
            protected void NotifyPropertyChanged(String info)
            {
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(info));
                }
            }
    
            ObservableCollection<string> _oListStars = new ObservableCollection<string>();
    
            private void Window_Loaded(object sender, EventArgs e)
            {
                _oListStars.Add("fruit");
                _oListStars.Add("chicken");
                _oListStars.Add("meat");
                MyListBox.ItemsSource = _oListStars;
            }
    
            private void Button_Click_2(object sender, RoutedEventArgs e)
            {
                _oListStars.Add("test");
            }
        }
    
    


    The ObservableCollection implements the INotifyPropertyChanged interface, which will notify any control that it's bound to that it's items list has changed.
  2. In Topic: why does my program update more than once?

    Posted 11 Feb 2013

    Post more code. Preferrably, post the code that around this code.
  3. In Topic: Read Line XML File

    Posted 11 Feb 2013

    You could also use the XDocument class which is great for reading XML documents to use with LINQ-To-XML.

    I agree with Martyr2 that you don't normally read an XML file the same way as a standard text file.
  4. In Topic: question on automapping between entityobjects

    Posted 8 Feb 2013

    If you are wanting to map properties, why aren't your Business Objects inheriting from your Data Layer objects? If you want them to have essentially the same properties, make your Business Objects inherit from their Data Layer counterparts.
  5. In Topic: How to free the unused occupied memory?

    Posted 8 Feb 2013

    View Posttriangulator, on 07 February 2013 - 08:38 AM, said:

    The long and sort of that means that your memory is going up because you are continuing to create objects that are remaining in scope (remaining alive).
    
    Then when I don't need these objects anymore how to tell the garbage collector that they aren't being used anymore and are to be destroyed? I suspect not telling it might be the reason.


    Using this code upon pressing the close button the current TabPage is closed and this is due to tab.Dispose(); - when I remove tab.Dispose(); the tabpage is not closed, so I thought tab.Dispose(); is also calling destructors and stuff, which delete all the objects belonging to the tab page, but apparently it isn't. How do I do that? I suppose that the tabpage is still kept in the memory even though it's not shown in the tabcontrol anymore.

    Should I finalize the variables or set them to null or both or what?


    You don't need to manually tell the GC to collect. You can, but it's frowned upon. The GC will collect when it gets ready to. There is no schedule. If you are removing all references and handling everything correctly in your Dispose, then the objects are getting disposed of correctly. However, the memory won't be reclaimed until the GC collects. That could be 2 minutes from the time you call Dispose, or 2 hours, or longer.

    Don't worry about the size of the memory your application is using until you notice a problem like an OutOfMemoryException is thrown. Your app will consume a lot of memory. That memory will be reclaimed eventually if you are killing all of the references correctly.

    As Adam states, one of the main "memory leaks" that occurs in .Net is when we do not unsubscribe from events. Anytime you manually do a "+=" to subscribe, you also need to unsubscribe("-="). Without the unsubscription, the object will remain in memory as it will still have a reference for the event handler.

My Information

Member Title:
Not Your Ordinary Programmer
Age:
31 years old
Birthday:
December 16, 1981
Gender:
Location:
Florence, SC
Full Name:
Ryan Alford
Years Programming:
4
Programming Languages:
C#, VB.Net, ASP.Net, Silverlight, WP7, Android, some JavaScript

Contact Information

E-mail:
Private
Website URL:
Website URL  http://www.eclipsed4utoo.com/blog/
LinkedIn:
http://www.linkedin.com/in/eclipsed4utoo
Facebook:
http://www.facebook.com/eclipsed4utoo
Twitter:
eclipsed4utoo

Comments

  • (2 Pages)
  • +
  • 1
  • 2
  1. Photo

    atholon Icon

    23 Aug 2012 - 09:36
    Hey Ryan,
    Just wanted to thank you for your post in this thread: http://www.dreamincode.net/forums/topic/161952-textwriter-help/
    I'd been looking for a while about how to use the TextWriter with StreamWriter to append text.
  2. Photo

    trevster344 Icon

    07 Feb 2012 - 09:33
    I happen to agree with your personal message there, too many people take it personal.
  3. Photo

    MATTtheSEAHAWK Icon

    21 Apr 2011 - 16:13
    I saw this:
    http://gyazo.com/76ba9e1a382483093f2deac2173309de.png
    I made this:
    http://gyazo.com/9cefc500a3f96c441b8610ebcd60d760.png
    Congratulations Grand Master :)
  4. Photo

    Dogstopper Icon

    24 Jan 2011 - 21:00
    Totally didn't mean for that down vote. My finger slipped.
  5. Photo

    heyoman1 Icon

    28 Nov 2010 - 20:49
    Which site did you use to make your sig?
  6. Photo

    khan96 Icon

    31 Oct 2010 - 05:19
    i m using Import dll in c# and gave an aceess viloation error
  7. Photo

    khan96 Icon

    31 Oct 2010 - 05:19
    shuaib here
  8. Photo

    eclipsed4utoo Icon

    16 Sep 2010 - 04:40
    feeling very lucky today.
  9. Photo

    macosxnerd101 Icon

    16 Sep 2010 - 04:36
    W00t! 666 reputation. Aren't you feeling lucky, today?
  10. Photo

    eclipsed4utoo Icon

    27 Aug 2010 - 04:37
    @programmerjiwa
    I have no clue.
  11. Photo

    programmerjiwa Icon

    26 Aug 2010 - 20:14
    hi, how to change username in dreamincode...?
  12. Photo

    eclipsed4utoo Icon

    25 Aug 2010 - 13:43
    @Frinavale
    I think I know which one you are talking about...
    http://www.dreamincode.net/forums/topic/187628-redirect-website-in-content-holder/
  13. Photo

    Frinavale Icon

    25 Aug 2010 - 13:17
    :) thought about posting a link to it at the time...probably should have because now I can't find the thread. It doesn't matter anyways :)
  14. Photo

    eclipsed4utoo Icon

    25 Aug 2010 - 13:04
    @Finavale
    Thanks...though not sure which thread you are talking about.
  15. Photo

    Frinavale Icon

    25 Aug 2010 - 12:49
    I am really impressed with your ability to understand questions that are incomprehensible :)
  • (2 Pages)
  • +
  • 1
  • 2