|
Project Information
Featured
Downloads
Links
|
IntroductionSlideControl is a .NET container control that manages presentation slides and offers a pleasing slide-effect when switching between slides. SlideControl has a built-in backtracking-stack that remembers slides visited and unrolls these actions on demand. What SlideControl Looks LikeHere is a demonstration of SlideControl being used in Parsley
Using SlideControlSlideControl is built with simplicity in mind: SlickInterface.SlideControl is a container control that is placed on your Form and allows the addition of slides. A slide is a class that inherits from SlickInterface.Slide. Since SlickInterface.Slide itself is a UserControl you can use the designer to change its appearance. Once the SlickInterface.SlideControl is in place and slides have been designed, they are added to the control _a = new SlideA(); _b = new SlideB(); _c = new SlideC(); _slide_control.AddSlide(_a); _slide_control.AddSlide(_b); _slide_control.AddSlide(_c); By default, the last added slide is the selected one shown. This can changed at any time by invoking _slide_control.Selected = _a; Setting the SlickInterface.SlideControl.Selected property will not animate your slides. To switch between slides with animation use the ForwardTo and Backward methods. _slide_control.ForwardTo<SlideB>(); This will slide out the currently selected slide and set the new selected slide to the first instance of SlideB found in the container. Additionally the previously selected slide is added to the backtracking-stack. To move backward to the previous slide, simply call _slide_control.Backward(); The SlickInterface.SlideControl is accessible from within SlickInterface.Slide instances through the SlickInterface.Slide.SlideControl property. this.SlideControl.ForwardTo<SlideC>(); To pass data between a slide transition simple add your userdata as a parameter string str = "hello world"; this.SlideControl.ForwardTo<SlideC>(str); Each transition causes callbacks to be invoked on the affected slides (the one that is moved out of the screen (slide-out) and the upcoming slide (slide-in)). Slides may therefore override the following callbacks invoked by SlickInterface.SlideControl /// True when slide event can occur, false to disable event protected virtual bool SlideOutRequested(); /// True when slide event can occur, false to disable event protected virtual bool SlideInRequested(); Additionally the callbacks protected virtual void OnSlidingIn(SlidingEventArgs e); protected virtual void OnSlidingOut(SlidingEventArgs e); enable a custom slide to fetch userdata and slide directions from the event parameters. protected override void OnSlidingIn(SlickInterface.SlidingEventArgs e) {
string str = e.UserData as string
if (str != null) {
// ...
}
base.OnSlidingIn(e);
}Whenever a slide change occurred, SlickInterface.SlideControl provides you with the SlideChanged event. _slide_control.SlideChanged += new EventHandler<SlickInterface.SlideChangedArgs>(Callback);
void Callback(object sender, SlickInterface.SlideChangedArgs e) {
Console.WriteLine("Slide changed from {0} to {1}", e.Previous, e.Now);
}RequirementsSlideControl currently requires the .NET framework 3.5 to run. |