Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 530921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:14:50+00:00 2026-05-13T09:14:50+00:00

Hey guys I’m fairly green when it comes to wpf, so I need a

  • 0

Hey guys I’m fairly green when it comes to wpf, so I need a little help, here is what im looking to do.

I want to create a custom media element, I want to be able to load a video and play any where from 15 secs to 1 min of the video, I want to be able to dynamically set this on load up based on user settings. I’m loading tons of videos essentially into a list view control and I want the video to play, but im trying to save on resources by playing only a small preview of the video.

Things I’ve looked into

  • custom control – somewhat lost
  • subclassing
  • pre build control

Im just really unsure on where to go next. I would greatly appericate any help you can give me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:14:50+00:00Added an answer on May 13, 2026 at 9:14 am

    Given your comments expanding on the requirement, I’d suggest that you use the normal MediaElement, but assigning it a “preview” version of the video that only includes the fragment you want to show and has reduced resolution so as to keep load footprint down.

    Thus, your model will have two properties, say PreviewUri and SourceUri. At the PreviewUri, you store the “preview” version of the video; at the SourceUri, you store the “full” version. In your ListBox or ItemsControl, you’ll use MediaElements bound to the PreviewUri. When the user makes a selection, you’ll set the Source of the main MediaElement to the SourceUri. So your ListBox will look something like this:

    <ListBox ItemsSource="{Binding}">
      <ListBox.ItemTemplate>
        <DataTemplate>
          <MediaElement Source="{Binding PreviewUri}" />
        </DataTemplate>
      </ListBox.ItemTemplate>
    </ListBox>
    

    your model will look something like this:

    public class Video  // ideally implement INotifyPropertyChanged - not shown
    {
      public Uri PreviewUri { get; set; }
      public Uri SourceUri { get; set; }
    
      public static ObservableCollection<Video> LoadVideoInfo()
      {
        /* pseudocode
        new up a collection
        foreach (file in videoFolder)
          collection.Add(new Video { PreviewUri = smallFileUri, SourceUri = bigFileUri });
        return collection;
        */
      }
    }
    

    and your code behind will look something like this:

    DataContext = Video.LoadVideoInfo();
    

    How you show the full-size video will depend on what you want to trigger this and where the full-size video displays. Using a ListBox rather than looping and adding children to a StackPanel may help with this because you can use the SelectedItemChanged event, databind to SelectedItem or use the IsSynchronizedWithCurrentItem property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey Guys, here is my code for this, the only help i get from
Hey guys i have a question here, How do i create a body that
Hey guys, I'm working on a project. I need to use the function cvFindHomography
Hey guys, I want to store a categorized list of URLs. This is an
Hey guys i want to use the jquery Autocomplete plugin and instead of separating
Hey guys I'm following the rails tutorial found here http://net.tutsplus.com/tutorials/ruby/the-intro-to-rails-screencast-i-wish-i-had/ and I've gotten to
Hey guys I'm creating a quick mysql file to create a DB with some
Hey guys I just noticed that my join statement here SELECT * FROM reports
Hey guys I can't seem to get the syntax here right, I'm just trying
Hey guys I have my script here that is supposed to do some stuff

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.