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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:37:46+00:00 2026-06-12T09:37:46+00:00

I made a unit selector radiobutton, mm and inches, to allow the user to

  • 0

I made a unit selector radiobutton, “mm” and “inches”, to allow the user to switch between metric and imperial units. I have the two radio buttons binding tied to an enum in a settings file. I used this as a reference to do so, and it works great.
Storing a radio button selection in the settings.

I now need to refresh all my properties, that have my measurements, to reflect the user preference of metric or imperial. That is on start up say the units are set to metric, but they would like to see what they are in imperial. The user selects the imperial radio button to show the imperial measurements, and all the data will refresh when they click the radio button, “inches”, and the display would show in imperial measurements, but how do I get a property changed on a radio button tied to an enum in the settings file? Or if there is a different way?

If I didn’t need to store their preference of metric or imperial I would switch to a bool, per radio button, and use notify property changed.

Edit
Figured it out. I posted it as the answer.

  • 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-06-12T09:37:47+00:00Added an answer on June 12, 2026 at 9:37 am

    So I figured it out when I was trying to get a different part of my code working.

    My original radiobuttons looked like this.

    <!--Unit Selector-->
            <ribbon:RibbonGroup x:Name="Unit_Selection" Header="Units">
                <StackPanel DataContext="{StaticResource Settings}">
                    <!--Metric-->
                    <RadioButton GroupName="UnitsSelector"  Content="mm" x:Name="Metric" IsChecked="{Binding Path=Default.Units, Mode=TwoWay, Converter={StaticResource enumBooleanConverter},
                         ConverterParameter=mm}" />
    
                    <!--Imperial-->
                    <RadioButton GroupName="UnitsSelector" Content="inches"  x:Name="Imperial" IsChecked="{Binding Path=Default.Units, Mode=TwoWay, Converter={StaticResource enumBooleanConverter}, 
                         ConverterParameter=inches}" />
                </StackPanel>
            </ribbon:RibbonGroup>
    

    Which directed the binding to a User Setting enum.

    I changed the binding to a property. To get xaml code

    <ribbon:RibbonGroup x:Name="Unit_Selection" Header="Units">
                <StackPanel>
                    <RadioButton IsChecked="{Binding Path=UnitProperty, Converter={StaticResource enumBooleanConverter}, ConverterParameter=mm}">mm</RadioButton>
                    <RadioButton IsChecked="{Binding Path=UnitProperty, Converter={StaticResource enumBooleanConverter}, ConverterParameter=inches}">inches</RadioButton>
                </StackPanel>
            </ribbon:RibbonGroup>
    

    …and Property

    public Unit UnitProperty
        {
            get
            {
                return Properties.Settings.Default.Units;
            }
            set
            {
                if (Properties.Settings.Default.Units != value)
                {
                    Properties.Settings.Default.Units = value;
                    NotifyPropertyChanged("UnitProperty");
                    NotifyPropertyChanged(String.Empty);
                }
            }
        }
    

    I had to add NotifyPropertyChange(String.Empty); to get it to update my other properties.

    I also found that I need to add INotifyPropertyChanged as a base class to my notification class.

    Now I have to go through and add handling for when the user switches between mm and inches.

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

Sidebar

Related Questions

I have a class that I made for some unit tests. Everything was going
I would like to unit test a method on a class I have made,
In C++, I have often made a unit test class a friend of the
I have created a debugger visualizer in VS2008. There are two classes i've made,
I have made a project in visual studio and also implemented unit testing. The
How can I unit test my NSURLConnection delegate? I made a ConnectionDelegate class which
I made a Web service in which I have a function to count some
I made a UITableViewCell and I have 20 rows in that table in which
I have written a bunch of unit tests inside VS2010 Express and tests being
About half a year ago, I started digging into unit testing. I made my

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.