Upload
dennis-loktionov
View
1.235
Download
1
Tags:
Embed Size (px)
Citation preview
Caliburn.MicroOpinionated MVVM Framework
Brief History of Caliburn.Micro
Created by Rob EisenbergBased on mature Caliburn projectOpens sourceAround 2,700 lines of codeSingle dependency - System.Windows.InteractivityEnterprise team is having fun learning it right now
Caliburn.Micro Elevator Pitch
A better version of what nearly every WPF veteran has attempted to home-growReduces the drudgery of property binding and commands Simplifies building a deeply composed UIHelps unify the programming models of WPF, Silverlight and Windows Phone 7Asynchronous programming supportSmall footprint & highly customizable
Core Concepts
MVVM (Model-View-ViewModel)
Convention over Configuration
Actions
Event Aggregator (pub-sub)
Bootstrapper
Conductors and Screens
Coroutines
Demo
WE WANT THE DEMO!
WE WANT THE DEMO!
WE WANT THE … CUP!
Lifecycle
• Application start up• Bootstrapper code is executed• ViewLocator.LocateForModel()• ViewModelBinder.Bind()• The rest of stuff happens
Conventions = Magic
Convention Over Configuration
Convention = Do More With Less Code
View Location & CompositionProperty Binding
Content controlsItems controls
Action BindingConfigurable Conventions (Convention Manager)
Troubleshooting Magic
Common Issues With Conventions:MisspellingsData Templates
Troubleshooting Techniques:LoggingRefactoring with R#
Data Binding
PropertyChangedBaseNo strings when notifying about property change!Lambda-based notificationsNotifyOfPropertyChange(() => PropertyName);
BindableCollection
ObservableCollection extensionRaises events on the UI thread
Actions
Allows to bind UI triggers to ViewModel methodsAllows for passing parametersParameters are type converted to method’s signatureCanExecute guard is supportedFull design-time support in BlendSupport Coroutines
Event Aggregator
Pub/SubCommunication between ViewModelsHighly decoupled
Screens & Conductors
State machine for UI compositionScreen has a lifecycle associated with it
ActivationDeactivation
Screen ConductorOrchestrates screensEnforces screen lifecycleGraceful shutdown
Coroutines
Asynchronous programming supportUtilizes iterators to yield results
FIN