Commit Graph

209 Commits

Author SHA1 Message Date
Antony Male 8a6f010fbb Add support for namespace transformations to ViewManager 2015-09-25 10:57:46 +01:00
Antony Male 3dd1ec2bfe Ensure that ViewManagerConfig properties cannot be null 2015-09-25 10:43:17 +01:00
Antony Male 7bc6a6b863 Update NuGet packages 2015-09-24 17:55:38 +01:00
Antony Male 1731f2388a Change how ViewManager is configured
Instead of taking a reference to the Bootstrapper, it takes a configuration
object which is populated by the Bootrapper. This will pave the way for
easier views-in-multiple-assemblies handling in the near future...

This also involved some work to remove registering Stylet's assembly with
the IoC container and the ViewManager. It wasn't really necessary
anyway and just slowed things down.
2015-09-24 17:48:40 +01:00
Antony Male b378027018 Introduce proper testing 2015-09-24 13:02:54 +01:00
Antony Male a703659095 Playing around with BindingProxy 2015-09-24 12:12:34 +01:00
Antony Male fc7f164c53 Remove unnecessary usings in unit tests 2015-09-23 21:46:36 +01:00
Antony Male a321c6f94a Start screens in Deactivated, not Initial
This means there's no further confusion around screens being deactivated
without first being activated. This is also closer to the Caliburn.Micro
model.

The Initial state used to be useful for determining the first transition
to Activated, but that turned out not to work, see recent commits.
2015-09-23 21:45:13 +01:00
Kai Eichinger 0089029ea8 Fixed broken tests for Systems that don't use "." as decimal separator 2015-09-22 20:53:56 +02:00
Antony Male 477d30ab4e Remove 'Task.Delay(1)' from unit tests 2015-09-22 09:18:42 +01:00
Antony Male 44cff93967 Update NuGet packages 2015-09-09 12:43:31 +01:00
Antony Male 786438dc50 Fix unit test which could crash
We were trying to close a window on a non-STA thread after the test had
finished executing, which was evil.

Threading is hard.
2015-09-09 12:43:26 +01:00
Antony Male 0bf916691f Change my mind on whether Deactivated can be entered before Active
It was getting too convoluted: if something sets the state, the Screen should
enter that state
2015-09-09 12:27:21 +01:00
Antony Male c1b842342b Add NUnit VS test runner NuGet package 2015-09-08 22:03:33 +01:00
Antony Male af5d2f0273 Do not allow Initial -> Deactivated transition
This caused a regression when screen states were added. Childre of
conductors are deactivated initially, then activated when the parent is
activated. This caused the Initial -> Deactivated transition. Then when
the child was activated, the 'from' state was not Initial, and so the
OnInitialActivate method was not called.

The choice to remain in Initial in this case makes sense: we don't want
to go to Deactivated (and come up with another mechanism for firing
OnInitialActivate), as that would fire OnDeactivate without there being
a corresponding OnActivate, which might mess things up.
2015-09-08 22:03:12 +01:00
Antony Male 5e412af659 Behave better if s:View.Model used on a bad container
Fixes #6
2015-06-02 16:01:12 +01:00
Antony Male 97192899eb Eliminate View.ViewManager
I think that's the last step towards supporting multiple Applications
(if anyone every actually wants to do that). It's good architecture,
anyway
2015-06-02 15:51:27 +01:00
Antony Male 8479672028 Remove dependency on Application.Current from WindowManager
This means that the WindowManager is entirely self-sufficient, and does
not rely on anything static
2015-03-30 15:02:07 +01:00
Antony Male e222af3c84 Throw if the user tries to show a Window using s:View.Model
Fixes #5
2015-03-24 09:23:35 +00:00
Antony Male 56395d8a8a Give StyletIoCBuilder a default list of assemblies
This is used by ToAllImplementations and Autobind, which means we
don't need to pass the correct assemblies into each.

Fixes #4
2015-03-17 12:27:52 +00:00
Antony Male 12e1fd344f Add InverseInstance property to BoolToVisibilityConverter 2015-02-28 18:35:09 +00:00
Antony Male 2a6350ad73 WindowManager sets window title if it's the same as the window name 2015-02-28 17:57:29 +00:00
Antony Male b11a9dabff Make the MessageBox display properly with multi-line content 2015-02-28 13:25:35 +00:00
Antony Male 48ee25ba29 Add OnStateChanged hook to Screen 2015-02-27 16:48:04 +00:00
Antony Male 21e6441a2f Re-jig ViewManager slightly to make it easier to override 2015-02-27 09:19:36 +00:00
Antony Male 51007f4a22 Add support for DependencyPropertyChangedEventHandler to EventAction 2015-02-24 15:38:50 +00:00
Antony Male 9552cbeeee Add extra 'operators after collection' test to EventAction 2015-02-24 12:40:39 +00:00
Antony Male b98226b29f Use a DependencyProperty in CommandAction/EventAction to watch ActionTarget for changes
Seems to work much better. Could probably remove quite a bit of code though
a sensible base class
2015-02-24 12:38:53 +00:00
Antony Male 52b8da8ab6 Register IContainer with the builder 2015-02-23 10:47:56 +00:00
Antony Male c024a2dfd8 Write unit tests for DependencyPropertyChangeNotifier 2015-02-22 22:06:40 +00:00
Antony Male cc4de1c852 CommandAction and EventAction no longer retain the View forever
Still needs a level of unit testing for PropertyChangeNotifier
2015-02-22 18:47:33 +00:00
Antony Male d2efcf48cb WindowManager avoids creating a new View if ViewModel already has a View attached 2015-02-22 16:47:34 +00:00
Antony Male 9ab3655c5f Improve test coverage slightly 2015-02-19 22:17:30 +00:00
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