Commit Graph

176 Commits

Author SHA1 Message Date
Antony Male 0b088b04fd Get coverage up slightly 2015-02-09 12:48:18 +00:00
Antony Male 386b7cb035 Bring more sanity to the Bootstrapper 2015-02-09 12:39:21 +00:00
Antony Male 68a826e66f WindowManager does not set Title binding if Title has a value already 2015-01-20 10:24:12 +00:00
Antony Male 64e83c526b Set WindowStartupLocation appropriately if the user hasn't set it themselves 2015-01-20 10:18:25 +00: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 3785fbf2af Add test to ensure guard method is propagated 2015-01-18 22:05:59 +00:00
Antony Male b3601e6f81 Actions throw on execute of ActionTarget hasn't changed from the default 2015-01-18 22:02:06 +00:00
Antony Male 1fd12fd54b Keep ReSharper happy 2015-01-15 10:35:27 +00:00
Antony Male 3418fda5a2 Handle null/empty property name in ValidatingModelBase.ValidatePropertyAsync
In this case, we call ValidateAllProperties instead
2015-01-15 10:12:37 +00:00
Antony Male 07160aa4fe Make BootstrapperBase non-generic
Instead, it has an abstract RootViewModel property, which bootstrapper
overrides to return an instance of TRootViewModel from the container.

This means that the root ViewModel is treated a singleton by the bootstrapper,
regardless of whether it's singleton in the container
2015-01-15 10:06:00 +00:00
Antony Male 46dc485eee Add tests for new conductor Dispose behaviour 2015-01-15 09:54:05 +00:00
Antony Male 20c708ddbe Conductor optionally disposes children, and WindowConductor never does 2015-01-15 09:28:24 +00:00
Antony Male dca24b4d5e Get unit test coverage back up 2015-01-14 20:30:51 +00:00
Antony Male b4b24441aa Rename TryClose to RequestClose, and put in IRequestClose 2015-01-14 20:25:01 +00:00
Antony Male 06b1d6f632 Improve coverage 2015-01-14 15:27:57 +00:00
Antony Male 66e6f9a925 Squash 'unused' warning in unit tests 2015-01-14 15:10:59 +00:00
Antony Male c777d295af ActionExtension: Handle attached events 2015-01-14 13:39:09 +00:00
Antony Male 185c49ad3d Improve bootstapper's container disposing 2015-01-14 10:21:04 +00:00
Antony Male a3d15cd958 Unwrap TargetInvocationException for EventAction 2015-01-14 10:10:49 +00:00
Antony Male 49f851e384 Accent any (reasonable) event signature for EventAction, not just RoutedEventHandler 2015-01-14 09:59:36 +00:00
Antony Male 68a60b0aee CommandAction unwraps TargetInvocationException, preserving stack trace 2015-01-14 08:30:08 +00:00
Antony Male 0b8c22fc08 Fix Resharper warnings, and downgrade unnecessary ones to Hint 2015-01-12 10:24:26 +00:00
Antony Male 0a169e6b69 Add unit tests for BindableCollection modifications 2015-01-06 14:06:14 +00:00
Antony Male f26413f5a7 Catch corner-case with ConductorAllActive where AddRange / RemoveRange wouldn't handle added/removed items 2015-01-06 13:43:31 +00:00
Antony Male 0a541c769c Modify BindableCollection to carry out all operations on the UI thread
This means the concept of a dispatcher for it is now out of date - remove
these
2015-01-05 17:27:39 +00:00
Antony Male a9e541c1a1 Get test coverage back up 2015-01-05 13:04:29 +00:00
Antony Male 3f2d298ba2 Add more descriptive exceptions to Action error cases 2015-01-05 12:28:26 +00:00
Antony Male d62ea7a22d Allow setting of Execute.InDesignMode, for obscure unit testing ONLY 2015-01-05 12:22:00 +00:00
Antony Male b538f11453 Fix up previous commit 2015-01-05 12:21:46 +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 27b80717ea Make View name resolution a bit smarter 2015-01-04 17:05:16 +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 9765f6c3fe Fix up BindableCollection collection dispatcher, and add tests 2015-01-04 12:37:33 +00:00
Antony Male 2ed54c4acd Refactor BootstrapperBase slightly, to call OnStartup at a better point in time 2015-01-04 12:28:02 +00:00
Antony Male 6d72032f8c Allow IModelValidator to return IEnumerable<string> rather than string[]
Closes #1
2014-12-26 22:55:41 +00:00
Antony Male 4a2c345bec Have different default PropertyChanged and CollectionChanged despatchers
This is because PropertyChanged events can be async - WPF handles the
marshalling. However if CollectionChanged events are async, then the
thing listening to the event can still be iterating the collection while
the user's editing it, leading to irritating little exceptions
2014-12-05 10:59:22 +00:00
Antony Male 94d4a31b85 Be draconian about using readonly where appropriate 2014-12-04 17:06:12 +00:00
Antony Male a48eda896f Remove LambdaComparer and LambdaEqualityComparer - they have no business in an MVVM framework 2014-12-04 13:29:08 +00:00
Antony Male 509d428dc8 Move back to lots of separate arguments for ShowMessageBox - consistent with MessageBox.Show 2014-12-02 16:16:32 +00:00
Antony Male f47db1cbec Change some Bootstrapper methods to public, to avoid explicit interface implementation 2014-12-02 15:20:16 +00:00
Antony Male 743961ec68 ViewManager now accepts an IViewManagerConfig, which makes the IoC container setup neater 2014-12-02 12:52:58 +00:00
Antony Male 77c6d347a5 Add overridable CanClose() method to Screen - meaning they don't have to use Tasks 2014-12-02 12:13:26 +00:00
Antony Male a421fc6922 Remove AssemblySource, relying instead on a List<Assembly> on BootstrapperBase 2014-11-30 15:19:13 +00:00
Antony Male 0f93eb1832 Remove the IoC class in its entirety - it's not needed any more, and it's a bad idea 2014-11-30 14:23:56 +00:00
Antony Male e36179098e ViewManager no longer depends on IoC 2014-11-30 14:05:08 +00:00
Antony Male 83557fa29b Move ShowMessageBox onto the IWindowManager
Having it as an extension method is good architecturally, but make it harder
to change its behaviour. This way, users can override it easily if they wish.

This also means that the WindowManager does not depend on the IoC service
locator, insteady accepting a Func<IMessageBoxViewModel>
2014-11-29 20:50:21 +00:00
Antony Male 17a3799811 Push unit test coverage up to 99.6% 2014-11-27 11:06:12 +00:00
Antony Male 44a6fa67f4 Get rid of funcs with key. Keep those without a key 2014-10-22 20:35:02 +01:00
Antony Male d6452c6517 Strip out child container stuff
I've forked the IoC container to SlimIoC, so this is going to be simplified a bit
2014-10-22 20:33:47 +01:00
Antony Male be22da44d0 Add Modules to StyletIoC 2014-09-14 12:19:48 +01:00