Displaying Videos in a WPF window - wpf

I need to ask you some questions. I'm new in developing with C# and WPF applications and i don't know what to do.
I have a list of links (videos) that are stocked in a data base and i need to display them in wpf window. I have searched in the internet but I didn't found something interesting
Would you please help me with some tutorials or the steps that I need to follow.
This is an example of what i have to do:

Bind an ItemsControl to a list of your video objects, then apply a template to those objects to render them in a MediaElement, you can then customise how the ItemsControl is layed out by customising the ItemsControl.ItemsPanel
Update for swf:
To play swf files, as long as you are happy that you can't control the playback, you can use a WebBrowser, setting the Source property to the .swf file.
<WebBrowser Source="myvideo.swf" />

Related

Building a presentation display for big screen using Silverlight

Our company wants to replace the powerpoint presentation (company info, etc) displayed on the big screen TV in the lobby with something more professional. I can do that easily using ASP.NET/HTML and JQuery (use JQuery to cycle through the DIVs), but I want to develop it in Silverlight - basically a web-based Silverlight application that fades in/out through the different "slides". It'll be tied to a SQL server database.
I'm new to Silverlight (my 1st project) and am not sure how to proceed (I'm pretty conversant with ASP.NET). I'm not sure which container (stackpanel, grid, canvas) to use in building the slides. I tried using stackpanels but couldn't get it to fade from one stackpanel to another.
Can someone please help me out??
Thanks.
My answer at "Animation target not specified issue - Silverlight storyboards." will do the trick at
Animation target not specified issue - Silverlight storyboards
When placing your Dia in a Grid you can easy use the PlaneProjection to move it around animating the LocalOffsetX property of the PlaneProjection for example.
<Grid>
<Grid.Projection>
<PlaneProjection />
</Grid.Projection>
<Dia />
</Grid>
If you need more explanation, let me know. I will be happy to elaborate in more detail.
Please let me know if this helped you.

Java like Window Navigation in WPF

I am a Java developer, and for user interaction I create a universal JFrame and has a JPanel container in it, and I swap that container with the other panels I created.
I started to develop WPF applications but I cannot find how this can be done. All I found that there are Page and UserControl but I could not understand the difference and how my task can be achieved. I cannot find good tutorials and I cannot understand how to search it in Google.
Any good info or tutorial would be appreciated.
You can use ContentControl for that purpose. You can set its Content property to any other control and it will show where the ContentControl is placed.
Alternatively, you can use MVVM and set the Content to a ViewModel, while providing a view in a DataTemplate.

Custom Wpf ListBox Control

I'm new to wpf and have just been given a project to create a set of custom controls which will be used to make a previous windows forms application more manageable and current. However I cannot seem to find much info with regards to customising the built in Listbox, this would involve preferably replacing the scroll bar and the +/- buttons with custom images etc..
Just wondered if anyone knows how to get at these ?
Thanks in advance.
Check here for the default control template of the listbox.You can customize the scrollviewer there to do what you are looking for.Check the below article to get started
Using Templates to Customize WPF Controls
Learn about WPF styling and templating. Other than that, the question is too generic for SO. Read the article (and perhaps google some more articles on the topic), try to style the listbox and come back with specific issues. WPF is not easy to get into, but it is definitely worth the time.

Suggestions for replacing legacy VB6/Flash application with WPF/Blend application

We have a legacy application that utilizes VB6, the Flash ActiveX control, and Flash content to display animated movies to users. For plenty of reasons we're looking to migrate away from this. I'm hoping someone out there can answer a few questions about WPF so that we can make a determination about how best to move forward.
First, a little about our current architecture and needs. The Flash content is set up as separate SWF files, where each individual SWF represents a training module with animated content. We have hundreds of these modules. Users run this software in a disconnected fashion where their local machine may or may not have ALL of these SWF files. The current application gives the user the option of downloading the SWF modules as they're needed.
Here's how we're thinking about setting up a new solution using WPF and Blend. We've written a WPF host application that can dynamically show Blend content based on button presses or whatever. And we've created a few test modules in Blend as WPF custom controls. But there are three nagging questions:
Right now we have the custom controls within the main WPF solution, but we need to make these disconnected. I've read several things about using Application.LoadComponent but I don't know if that will work for our solution.
Each of the Blend custom controls contains one or more storyboards that control the animation. As soon as I add one of the custom controls to a container in the WPF app, ALL of the storyboards automatically start "playing". How can I programatically make it so that I start/stop certain storyboards as needed?
Let's say I want to change a text label in one of the custom controls. If we're dynamically loading the custom control, how would I access one of the text labels to make such a change?
Any tips would be greatly appreciated. Loving WPF so far and hoping we can make this work and say goodbye to Flash forever!!!
There is Manage Extensibility Framework, that is a standard approach for dynamic modules.
Anyway, I haven't used it, so I would answer the questions in other way:
1) No, LoadComponent is ised for xaml files, whereas custom control consist of code and xaml. I mean, the custom control that you can add using Add->New Item->Custom Control(WPF). So you should do something like this, with reflection and ContentControl:
Assembly asm = Assembly.LoadFile(#"C:\SomeLibrary.dll");
Type type = asm.GetType("SomeNamespace.SomeControl");
var control = Activator.CreateInstance(type) as Control;
this.myContentControl.Content = control;
2) It isn't fact. You can put the storyboards into Control.Resources and launch them manually.
((Storyboard)control.Resources["myStoryboard"]).Begin(control);
3)
control.FindName("anyname") as TextBlock;

WPF solution design of slideshow application

Been thinking about this for hours now. Im building a simple slideshow application, where the user creates slides through a web application and publishes them to a wpf "player". The user is allowed to create two types of slides one based on html and one based on xaml (thought this would be easy).
When i get the slide to the player i have to determine how to render/load the slide. The HTML slide i convert to xaml (code i found on msdn) as a flowdocument (but now what to do with it?). The Xaml i just get in "raw" xaml.
My plan is to convert both of these to xaml, then have the slide load the xaml in someway and display it, but how? And would this setup be the proper architecture? please bear in mind that this is a small player application.
Any help on either architecture or on how to display these are highly appreciated.
Sincerely,
Brian
Look at the Slide.Show project from Vertigo. It a WPF project released under codeplex. It may give you ideas on the design.
Why not just display them in the web page? There are a huge number of slideshow applications for the web already.

Resources