Closed fralken closed 8 years ago
This is a good question. I am also having a hard time finding out how to dispose of everything when closing the app.
@fralken and @dvitonis I'm working on a major upgrade to FsXaml - please see https://github.com/fsprojects/FsXaml/issues/29#issuecomment-218262194
I think this is more inline with how C# works, and would be nicer moving forward than trying to support the ViewController concept. Thoughts?
Thanks @ReedCopsey, it looks very promising! I'm looking forward to testing it soon. Access to named elements is very useful.
As a side note, I noticed that when I open MainWindow.xaml in VS editor, the application starts, and I see the effects in the application window inside the editor (it uses the Kinect so I see the ouput of the Kinect inside the editor). Why does it behave like so?
@fralken Beta of 2.0 is just released. See #33 Can you please try migrating your projects and make sure you don't have any issues?
Re: Application window running - that's normal - the VS Designer actually creates an instance of your window. You can check for this, and not create the logic, by checking https://msdn.microsoft.com/en-us/library/system.componentmodel.designerproperties.getisindesignmode.aspx?f=255&MSPPError=-2147217396
Note that with the new 2.0 mechanisms, this should never be an issue. Code behind will actually occur in a subclass, not in the designed type, which should make the issue just go away.
Hello, maybe I'm misunderstanding something, but it seems that the OnUnloaded callback is never called in ViewControllerBase.
I'm using FsXaml.Wpf 0.9.9.
I have a XAML like so (MainWindow.xaml):
and a ViewController like so:
OnInitialized and OnLoaded are called when the window is created, but OnUnloaded is not called on exit, which means that disposeble objects added to DisposeOnUnload are never disposed. In which case should OnUnloaded be called? Thanks