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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:49:34+00:00 2026-05-29T20:49:34+00:00

As part of a WPF presentation, I need a control like the mock up

  • 0

As part of a WPF presentation, I need a control like the mock up below to let a user:

  1. enter a variable number of percentages up to 100%
  2. know what the total of all entries are
  3. know what the balance is (100% – TotalEntered)

While this is obviously a pretty pedestrian requirement, I am at a loss as to how to implement it. It’s a one-off requirement, so it need not be a reuseable, although it would be nice if it could be. A pattern to allow separation and testability (ie, MVVM) would also be great.

I assume the existing DataGrid control is the right tool to go with, but maybe it’s overkill. Can someone suggest some starting implementation code or link to same?

Cheers,
Berryl

mock up

  • 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-29T20:49:35+00:00Added an answer on May 29, 2026 at 8:49 pm

    VM = “ViewModel” implementing INotifyPropertyChanged.

    Create a Shares VM and a Share VM (implementation removed for brevity).

    SharesViewModel
    {
        double TotalPercent
        double RemainingPercent
        ObservableCollection<ShareViewModel> Shares
        // foreach Share in Shares 
        //   handle PropertyChanged on ActualPercent to update TotalPercent
    }
    ShareViewModel
    {
        int Line
        string Percent // on set, parse/validate and set ActualPercent
        double ActualPercent
    }
    

    Use this article to see how to keep the Line sequence in order.

    Bind DataGrid ItemsSource to SharesViewModel Shares property.

    (Ensure to validate percent inputs. IDataErrorInfo may help.)

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

Sidebar

Related Questions

I'm trying to create a JPG from part of my WPF Applications. Like a
I'd like to implement the ViewModel part of WPF's MVVM pattern without referencing WPF
I want to restyle just part of a WPF control. (Specifically, I want to
A WPF app has an operation of loading a user control from a separate
Currently my WPF application imports a part like this [Import(typeof(ILedPanel)] public ILedPanel Panel {
I'd like to have a WPF window open in the top right part of
I'm writing a WPF user control which internally uses MVVM. In order to work
Summary: I want the prettiness of Silverlight/WPF in part of my current Winforms application.
I have a requirement to change a very small part of the WPF ComboBox's
Is WPF an ECMA standard library? Or it is just a part of MS

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.