Commit Graph

23 Commits

Author SHA1 Message Date
Antony Male f7ec7a255a WIP towards getting unit tests working 2019-09-22 17:12:53 +01:00
Antony Male e01e6e41f3 If a ConductorOneActive item is closed, don't dispose it twice
Fixes #28
2017-05-18 10:09:21 +01:00
Antony Male e4941c1c66 When removing ConductorOneActive's ActiveItem, don't Close then Deactivate
Closing and then Deactivating causes the ActiveItem to be reactivated, in order
to deactivate it. Not good.

Fixes #27
2017-05-15 13:04:44 +01:00
Antony Male 151371f9f6 Conductor.OneActive should close children removed with items.Clear()
Conductor.AllActive reacts appropriately to the Reset event on its items
collection. Conductor.OneActive doesn't, and should.

Fixes #18
2016-12-03 13:15:14 +00:00
Antony Male 5a5cfc5cfb Fix ConductorOneActive to not deactivate activate item twice when closing
It closed each of its children individually, then cleared 'this.items',
which caused of all its children to be deactivated again,.

Fixes #14
2016-11-17 12:50:08 +00:00
Antony Male 6cd4546a80 Deprecate CanClose
There's no nice way to make it work alongside CanCloseAsync when you're
in a conductor hierarchy. There will always be difference between how
CanClose and CanCloseAsync behave when there are children which need
to be interrogated as well, and that's confusing.
2016-08-26 11:44:34 +01:00
Antony Male b6b9811ab0 Conductors, which override CanCloseAsync, must call CanClose
Otherwise subclasses which override CanClose but not CanCloseAsync won't
work as expected.

Fixes #10
2016-07-09 12:50:51 +01:00
Antony Male fc7f164c53 Remove unnecessary usings in unit tests 2015-09-23 21:46:36 +01:00
Antony Male 4468740338 Implement proper state management in Screen
This takes the old flag-based state management in Screen, and replaces it
with one based on a ScreenState enum. This also gives a way for
interested parties to query the current state, and for an event which
notifies of any state transition.

This meant combining IActivate, IDeactivate, and IClose. This is a sensible
move: these interfaces were inextricably linked anyway, and separating
them had no advantages and a few disadvantages. If external parties are
using these interfaces directly, then migration is necessary, but these
are usually only used by Conductors
2015-01-19 13:08:10 +00:00
Antony Male 1fd12fd54b Keep ReSharper happy 2015-01-15 10:35:27 +00:00
Antony Male 46dc485eee Add tests for new conductor Dispose behaviour 2015-01-15 09:54:05 +00:00
Antony Male f36de34bb2 Execute.Dispatcher can never be null, and dispatches synchronously by default
The previous behaviour was to raise an exception unless Execute.Dispatcher
had been explicitly defined. This was to detect cases where the user hadn't
set up Execute correctly, and treat them as errors rather than simply going
ahead with some possibly-unexpected behaviour.

However, since BootstrapperBase sets Execute.Dispatcher automatically, it's
highly unlikely that itwould ever not be set when it needed to be. Exceptions
are design mode and unit tests, both of which want (or can cope with) a
synchronous dispatcher.

Hence the behaviour change. Execute.Dispatcher is a synchronous dispatcher
by default, but is overridden to one that uses Application.Current.Dispatcher
by the bootstrapper if we're in a real application.
2015-01-04 21:30:34 +00:00
Antony Male 9ee23f1469 Remove Execute.TestExecuteSynchronously, in favour of a synchronous IDispatcher implementation 2015-01-04 13:10:37 +00:00
Antony Male 5596ba272d Conductors will also Dispose their children if the're IDisposable 2014-08-04 17:35:16 +01:00
Antony Male 4fa4133248 Improve unit test code coverage some more 2014-05-06 17:42:55 +01:00
Antony Male 3ecb0c38c8 Improve test coverage slightly 2014-05-06 13:11:51 +01:00
Antony Male 4711e3fefa Fix tests involving changes to Execute 2014-04-24 12:58:09 +01:00
Antony Male 9e96e8c052 Rename Conductor<T>.Collections to Conductor<T>.Collection, and move Conductor<T>.Collections.Nagivation to Conductor<T>.StackNavigation 2014-04-24 08:11:21 +01:00
Antony Male 6a1e8e688e Finish off having conductors with collections respond property to that collection being manipulated 2014-04-15 12:22:05 +01:00
Antony Male 3e102ea274 Work on screens: tidying, bug-fixing 2014-03-26 13:16:26 +00:00
Antony Male 0f6994721a Attempt to change Deactivate(true) to Close()
Probably needs a bit more testing and verifying, but the tests pass
2014-03-26 08:36:19 +00:00
Antony Male 31c9844c47 Add more conductor tests, and tests for Execute, PropertyChangedBase 2014-03-25 13:20:31 +00:00
Antony Male 0aef92ac49 Add some tests for Conductor.Collections.OneActive, but still needs some more 2014-03-15 14:51:52 +00:00