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 4234798
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:24:27+00:00 2026-05-21T02:24:27+00:00

I have a project in WPF 4 and VB.net 2010. I want to bind

  • 0

I have a project in WPF 4 and VB.net 2010. I want to bind the volume property of a mediaelement to a variable in another module. Mind you, the variable is in the correct data type, so no conversion is necessary. How do I do this?

  • 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-21T02:24:27+00:00Added an answer on May 21, 2026 at 2:24 am

    First, make sure that your code behind implements INotifyPropertyChanged.

    All that is is a way to notify the UI that value for the Volume has changed and it needs to grab the new value on the binding.

    The second thing is you’ll need to somehow access the variable from the other module in your code behind, and then reference that in your code behind using a Property.

    Now the trick is, when you set the property, you’ll want to also call the notify property changed event.

    Public Property Volume()
       Get
         Volume() = YourModuleVolume
       End Get
    
       Set(ByVal Value)
         YourModuleVolume = Value
                 'Call NotifyPropertyChanged("Volume") here
       End Set
    End Property
    

    I can’t remember if the code behind class automatically sets itself as the DataContext for the User Control, so you may want to drop in a “this.DataContext = this” or VB.NET equivalent in your constructor. Usually the DataContext is pulled in automagically from your ViewModel. Basically, that says to use the specified class (aka code behind) as the source for all data bindings.

    Then in XAML it’s a usual databinding.

    <YourControl Volume="{Binding Volume}" />
    

    As a side note, this is really not how one usually goes about setting up a WPF application, so this scenario’s a little odd. If you plan to do much with WPF, you may want to look into Josh Smith’s resources on MVVM – that’s really the intended architecture of a WPF application.

    Best of luck!

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

Sidebar

Related Questions

all,, I have a project that is built in VB.Net 2010 and WPF 4.
I have a project with WPF 4/VB.net 2010. How do I begin a WPF
I have a WPF 4/VB.net 2010 project, and I'm trying to do a visual
I have a WPF 4 and VB.net 2010 project. I am playing videos in
I have a WPF VB.NET project in Visual Studio 2008. For some reason, Visual
I am developing a WPF project in vb.net and have multiple windows in it.
I have a WPF/ASP.NET project which I haven't worked on for a while (ResourceBlender.NET
I have the following method in my WPF project (.net 4): private void MyMethod(){
I have a .NET 4.0 WPF project. When I open a FileDialog, choose some
I am using VB.NET 2010 (Visual Basic 2010 Express) on a WPF-based project. I

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.