如何做幻灯片在WPF。更改Windows的内容就像幻灯片 [英] How to do slide show in wpf. Changing windows content like slide show

查看:177
本文介绍了如何做幻灯片在WPF。更改Windows的内容就像幻灯片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要显示窗口,当用户点击一个按钮,然后显示在同一窗口他下一个内容。而且我想也做动画。可能吗?动画并不重要。 我只想更改内容dynamicaly 。我不能在任何地方找到它...

I want to display window and when user will click a button then show for him next content in the same window. And I want also to do a animation. Is it possible? Animation is not important. I only want to change content dynamicaly. I cant find it anywhere...

请给我simplier这个解决方案没有任何框架。

Please give me simplier solution for this without any frameworks.

的内容不只是图片。会有很多控制。

Content is not only images. There will be many controls.

我用 WPF 使用.NET框架4.0

I'm using WPF with .NET Framework 4.0

推荐答案

接近这一点没有大量的开销将是prepare幻灯片,用户控件的所有幻灯片,让主窗口的一个方法有一个

One way to approach this without a lot of overhead would be to prepare all slides of the slideshow as UserControls, let the main window have a

<ContentPresenter x:Name="CurrentSlidePresenter" />

和使用

UserControl currentSlide = GetCurrentSlide(); // implement this to your liking
CurrentSlidePresenter.Content = currentSlide;

在按钮单击处理程序。

此方法可以扩展使用用动画 FluidKit

This approach can be expanded to use animation using FluidKit.

这篇关于如何做幻灯片在WPF。更改Windows的内容就像幻灯片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆