230 likes | 510 Views
Eyal Vardi CEO E4D Solutions LTD Microsoft MVP Visual C# blog: www.eVardi.com. Composite Applications with WPF and PRISM 4.0. About. Consulting Mentoring Projects. Agenda. Security. Communication. Productivity. How to build Composite application?. Modularity. Deployment.
E N D
Eyal Vardi CEO E4D Solutions LTDMicrosoft MVP Visual C#blog: www.eVardi.com Composite Applications with WPF and PRISM 4.0
About • Consulting • Mentoring • Projects
Agenda Security Communication Productivity How to build Composite application? Modularity Deployment Extensibility Multi-Language
Shell & Region == Master Page Ribbon App Nav Body Pane Calendar Contacts App’s Status Bar
DEMO Shell & Region
View-Based Navigation _container.RegisterType<Object, ViewName>("ViewName"); _regionManager.RequestNavigate( "RegionName", newUri( "ViewName",UriKind.Relative) ); publicinterfaceINavigationAware {voidOnNavigatedTo(NavigationContextnavigationContext); boolIsNavigationTarget(NavigationContextnavigationContext); voidOnNavigatedFrom(NavigationContextnavigationContext); }
DEMO Navigation
Publisher / Subscriber Publisher Event Aggregator Publisher Subscriber Subscriber Subscriber Publisher
DEMO Event Aggregator
Visual State Manager (VSM) Data States Security States Communication States
Visual State Manager (VSM) State Transition State Groups
DEMO Visual State Manager
State-Based Navigation <DataStateBehavior Binding="{BindingIsChecked,ElementName= ShowAsListButton}" TrueState="ShowAsList"FalseState="ShowAsIcons"/>
Initiating State Changes • The authors is responsible for telling VisualStateManager when a visual state change should occur. [TemplateVisualState(Name="Normal" , GroupName="CommonStates")] [TemplateVisualState(Name="MouseOver", GroupName="CommonStates")] [TemplateVisualState(Name="Pressed" , GroupName="CommonStates")] publicclassNumericUpDown : Control } { privatevoidGoToState(booluseTransitions) } if (isPressed) VisualStateManager.GoToState(this, "Pressed" , useTransitions); elseif (isMouseOver) VisualStateManager.GoToState(this, "MouseOver", useTransitions); else VisualStateManager.GoToState(this, "Normal“ , useTransitions); {
Behaviors & Actions are Everywhere Conditional Data Motion Animation
Behavior is a… Attached property • <ButtonContent="Click Me"> • </Button> • <i:Interaction.Triggers> • </i:Interaction.Triggers> • <i:EventTriggerEventName="Click"> • </i:EventTrigger> • <E4D:MyActionTargetName="lbTrace" /> XAML Add-on Drag & Drop
DEMO Behaviors & Actions
Communication Module WCF Interfaces P P Communication SH Event Aggregator
Summary • Keep the client thin. • Defined your visual state with VSM. • Use Behaviors & Actions for RAD. • Use the Prism for modularity.
Eyal Vardi CEO E4D Solutions LTDMicrosoft MVP Visual C#blog: www.eVardi.com