eclipsed4utoo's Profile
Reputation: 1511
Grandmaster
- Group:
- Moderators
- Active Posts:
- 6,019 (3.19 per day)
- Joined:
- 21-March 08
- Profile Views:
- 68,214
- Last Active:
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
-
Michael26 
20 May 2013 - 14:50 -
darek9576 
03 May 2013 - 09:27 -
geohhot 
04 Apr 2013 - 11:56 -
ThrowsException 
29 Mar 2013 - 10:44 -
sacdeli 
17 Mar 2013 - 17:42
Posts I've Made
-
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. -
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. -
In Topic: Read Line XML File
Posted 11 Feb 2013
-
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. -
In Topic: How to free the unused occupied memory?
Posted 8 Feb 2013
triangulator, 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:
-
http://www.eclipsed4utoo.com/blog/
- LinkedIn:
- http://www.linkedin.com/in/eclipsed4utoo
- Facebook:
- http://www.facebook.com/eclipsed4utoo
- Twitter:
- eclipsed4utoo
Friends
-

PsychoCoder
-

marcells23
-

skyhawk133
-

Martyr2
-

Jayman
-

rocky_upad...
-

kenny2000
-

Core
-

williamgeo...
-

FlashM
-

MentalFloss
-

macosxnerd101
-

hamidkhl
-

GhoSt1090
-

xikky
-

megglz
-

JITHU
-

Frinavale
-

Elcric
-

plejer_adam
-

programmer...
-

dotnetlogesh
-

Imdsm
-

RandomlyKn...
-

Chevon
-

jimdandy75
-

Skaggles
-

m-e-g-a-z
-

Neetu sharma
-

AdamSpeigh...
-

Curtis Rut...
-

Harvey Meale
-

Nakor
-

eaglex
-

Macjohn
-

Macjohn
-

scolty
-

Justin3085
-

sithius92
-

RexGrammer
-

nK0de
-

trevster344
-

Zaraki=Death
-

tsackey
-

raghav.nag...
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
atholon
23 Aug 2012 - 09:36Just 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.
trevster344
07 Feb 2012 - 09:33MATTtheSEAHAWK
21 Apr 2011 - 16:13http://gyazo.com/76ba9e1a382483093f2deac2173309de.png
I made this:
http://gyazo.com/9cefc500a3f96c441b8610ebcd60d760.png
Congratulations Grand Master :)
Dogstopper
24 Jan 2011 - 21:00heyoman1
28 Nov 2010 - 20:49khan96
31 Oct 2010 - 05:19khan96
31 Oct 2010 - 05:19eclipsed4utoo
16 Sep 2010 - 04:40macosxnerd101
16 Sep 2010 - 04:36eclipsed4utoo
27 Aug 2010 - 04:37I have no clue.
programmerjiwa
26 Aug 2010 - 20:14eclipsed4utoo
25 Aug 2010 - 13:43I think I know which one you are talking about...
http://www.dreamincode.net/forums/topic/187628-redirect-website-in-content-holder/
Frinavale
25 Aug 2010 - 13:17eclipsed4utoo
25 Aug 2010 - 13:04Thanks...though not sure which thread you are talking about.
Frinavale
25 Aug 2010 - 12:49