Question

how to get a popin effect in silverlight on fly (in c# and not in XAML). by popin effect effect I mean:

Lets suppose I have two containers (a container could be a grid, pane etc) aligned vertically and theres a button on top on. On pressing the button an another container would emerge (which was invisible till now) from the top container and would slide down the already existing below container slowly.

I need the code syntax and not any already existing custom or standard component for this.

Thanks...

Was it helpful?

Solution

The scenario you described look like job for 'DataState behavior'. I usually create 2 'States' under 'Default states' such as: NormalState (the 'default ' state) and 'WorkingState' (that's include 'Busy' icon and my be fade-out screen a little bit) or even use FluidMove or Styoryline as in your example. Then create a simple public bool IsWorking {get;set;} property and attach 'DateState' behavior to it's boolean answer. So in case when IsWorking is 'true' show/run 'WorkingState' and in case of 'false' show 'NormalState'. It's very easy to set automatically in GUI/Blend. It follows principles of MVVM pattern and testable. The state change mechanism has 'TransitState' property - most of them build-in but very flexible. You can create a StoryLine as starting point of 'WorkingState' and slide the Components there (It's different state so you can set 'Visible' and other properties without changing it globally or managing state in code logic). You also can create independent Storyline and run it on some event rising from code but again - the preferred way it's to use DateState behavior.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top