If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Stopping a Window from loading twice.

Just wondering... What stops you from simply using a boolean status variable for keeping track of the window's state - instead of testing IsDisposed()?

Well for one I thought about that but then I would have very messy code because I would need a status bool for every window.

Second, it doesn't work anyway because when Window1 loads Window2 with the Show() method there is no way to know that Window2 has been closed. Unlike ShowDialog() Window1 is not notified when Wndow2 calls its Close() method.

I would have to do it manually with public global variables that work between Windows and its too messy.

Re: Stopping a Window from loading twice.

Originally Posted by Tealc

Second, it doesn't work anyway because when Window1 loads Window2 with the Show() method there is no way to know that Window2 has been closed. Unlike ShowDialog() Window1 is not notified when Wndow2 calls its Close() method.

Hm... But I still don't understand why you wouldn't simply handle the window's Closed event? That way, you can easily keep track of any window's state.

Re: Stopping a Window from loading twice.

Idk how to do that. I think I might just go back to Windows Forms it seems like WPF has a very long way to go yet. Designing a window is 10x harded then designing a form and I've found more little bugs in WPF then I care to comment about.

Almost all of the usefull Form controls like DataGridView and several others that I use are missing from WPF and the ones like ListView that are included are severly limited in how they can be customized.

Re: Stopping a Window from loading twice.

Originally Posted by Tealc

Idk how to do that. I think I might just go back to Windows Forms it seems like WPF has a very long way to go yet. Designing a window is 10x harded then designing a form and I've found more little bugs in WPF then I care to comment about.

Almost all of the usefull Form controls like DataGridView and several others that I use are missing from WPF and the ones like ListView that are included are severly limited in how they can be customized.

I think I will try again when WPF has had time to mature.

You are facing problems because you are new to WPF, once you attain a confort level, you would love to code in WPF. It has awesome features and is very powerful. I am also new to this environment and struggling to achieve what i could easily do in Winforms.

Re: Stopping a Window from loading twice.

Yes I am new and that probably is the cause of some of it but I'm also not stupid. I've been writing sofrware for years and WPF has so many bugs I'm suprised it was even released. It is so limited it so many ways its funny.

1. There is no version of DataGridView that can be easily used.

2. Many of the avaliable controls cannot be customized in a similar way that Windows Forms version can.

3. There is no easy way to even get the ProductVersion. Application.ProductVersion has been removed. I mean seriously, common.

4. The designer is completely messed up controls on the designer don't appear the same at runtime. I placed several labels on the window and alligned them. I ran the program and they were completely strewn all over the window in random places at runtime. To fix it I had to use the designer and resize the window just a tad and then the screen flashed and went black. After a few seconds it came back. I ran the program and every aligned correctly.

Many times I moved controls around on the designer and at runtime the changes were not reflected. I had to completely close the IDE and restart it. I ran the program again and the changes were magically reflected correctly now.

I could go on but I don't have time right now. I'm just not too impressed. Why should they expect people to migrate from powerfull and customizable Windows Forms to something lacking in every area and buggier then hell? I don't know.

Re: Stopping a Window from loading twice.

Sorry but you are completely wrong. There is nothing wrong with WPF. It has a few bugs but nothing like what you are saying.

If you get this many issues you probably need to do a clean install of Visual Studio.

MS is working on a DataGridView control its just not ready yet. For now you can use any of the Windows Forms controls you need by using the Host control. Until the WPF versions are finished.

Designing a WPF window is different then Forms. Make sure you are correctly using the tools like Grid and Dock Panel, etc...

I wrote the software that runs my businesses and am having a lot of fun redesigning the UI portion with WPF I have a slick seemless UI in the works that Forms could have never done. My software is huge and pushing WPF to the limits. Still I have yet to run into a issue as you are describing.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.