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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:33:40+00:00 2026-05-23T07:33:40+00:00

I have 2 integer up down controls in my application. 1 represents minutes from

  • 0

I have 2 integer up down controls in my application. 1 represents minutes from a time span the other represents seconds from a time span. I want to bind those values to the timespan. I know that I need to use a converter for this. However I also need to send both values to the converter on any change event. So if the user changes the minutes I need to make a new timespan from the minutes and seconds. Is there a way to send both of these values to a converter or do I need to do I need to do this in the code behind?

Here is the XAML for the 2 controls.

<extToolKit:IntegerUpDown Minimum="0" Margin="1,3,0,4" x:Name="iupApproachMin">
    <extToolKit:IntegerUpDown.Value>
        <PriorityBinding FallbackValue="50">
            <Binding Path="VehicleEntryTaskStandards.MaxEntryTimeRequirement" Converter="{StaticResource timeSpanConvertor}">
            </Binding>
        </PriorityBinding>
    </extToolKit:IntegerUpDown.Value>
</extToolKit:IntegerUpDown>
<Label>min</Label>
<extToolKit:IntegerUpDown Minimum="0" Maximum="59" Margin="1,3,0,4" FormatString="00" Value="10"></extToolKit:IntegerUpDown>
<Label>sec</Label>

Here is the converters code

[ValueConversion(typeof(TimeSpan),typeof(int))]
public class TimespanConverter:IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        int minutes = ((TimeSpan)value).Minutes;
        return minutes;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        TimeSpan resultTimeSpan = new TimeSpan();

        int minutes;
        if (int.TryParse(value.ToString(), out minutes))
        {
            resultTimeSpan = new TimeSpan(0, minutes, 0);
            return resultTimeSpan;
        }
        return DependencyProperty.UnsetValue;
    }
}

Can I have it accept an array or list. If so how can this be done in xaml?

Please help!

  • 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-23T07:33:41+00:00Added an answer on May 23, 2026 at 7:33 am

    Instead of using a ValueConverter, use a couple of properties in a ViewModel.

    In the setter of each of these properties have the TimeSpan updated appropriately.

    private TimeSpan _time;
    public TimeSpan Time 
    {
      get { return _time; }
      set 
      { 
        _time = value; 
        RaisePropertyChanged("Time");
      }
    }
    
    private int _minutes
    public int Minutes
    { 
      get { return _minutes; }
      set 
      {
        _minutes = value;
        CalculateTimeSpan();
        RaisePropertyChanged("Minutes");
      }
    }
    
    private int _seconds
    public int Seconds
    { 
      get { return _seconds; }
      set 
      {
        _seconds= value;
        CalculateTimeSpan();
        RaisePropertyChanged("Seconds");
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have integer values ranging from 32-8191 which I want to map to a
Say I have the classic 4-byte signed integer, and I want something like print
In my application, I have a recent files drop down menu. It will contain
We have some integer arithmetic which for historical reasons has to work the same
I have an integer field in a ClientDataSet and I need to compare to
Let's say I have an integer that I need to convert to a string
I have an NSAttributedString s and an integer i and I'd like a function
I have a table similar to this: CREATE TABLE example ( id integer primary
We have a file that has a 64 bit integer as a string in
I have the following rails migration: create_table :articles do |t| t.integer :user_id, :allow_null =>

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.