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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:36:47+00:00 2026-05-16T18:36:47+00:00

Any idea where I’m going wrong with this code. I want the TextBox to

  • 0

Any idea where I’m going wrong with this code. I want the TextBox to be Enabled when the associated RadioButton for it is selected, and then when a different radio button is selected I want it to be Enabled=False. I created a ProxyMode dependency property and have changed the getter to obtain it’s bool value based on whether Proxy is selected or not. Doesn’t seem to work…any ideas?

// Proxy Host Name
public string Proxy
{
  get { return (string)GetValue(ProxyProperty); }
  set { SetValue(ProxyProperty, value); }
}

public static readonly DependencyProperty ProxyProperty =
       DependencyProperty.Register("Proxy", typeof(string), typeof(ConfigWindowViewModel), new UIPropertyMetadata("[e.g. proxy.mycompany.com]"));

public bool ProxyMode
{
  get { return Proxy == "Proxy"; }
  set { SetValue(ProxyModeProperty, value); }
}

public static readonly DependencyProperty ProxyModeProperty =
       DependencyProperty.Register("ProxyMode", typeof(bool), typeof(ConfigWindowViewModel));

And the XAML

<StackPanel Grid.Column="0" Margin="2">
  <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
    <RadioButton IsChecked="{Binding Path=Mode, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Proxy}"
                  VerticalAlignment="Center"
                  Padding="2,0,10,0">Proxy
    </RadioButton>
    <TextBox Text="{Binding Path=Proxy}" 
             IsEnabled="{Binding Path=ProxyMode}"
             Width="Auto"
             Name="ProxyHostTextBox"
             VerticalAlignment="Center"
             MinWidth="150" 
    />
  </StackPanel>
  <RadioButton IsChecked="{Binding Path=Mode, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Direct}">Direct</RadioButton>
</StackPanel>
  • 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-16T18:36:48+00:00Added an answer on May 16, 2026 at 6:36 pm

    The easiest way to enable/disable the textbox based on whether the proxy RadioButton is checked is to bind the IsEnabled property of the TextBox directly to the IsChecked property of the proxy RadioButton. Assuming the proxy RadioButton is named “proxy”:

    <TextBox Text="{Binding Path=Proxy}" IsEnabled="{Binding ElementName=proxy, Path=IsChecked}"/>
    

    If you meant for your RadioButton controls to be linked so that only one can be selected at once, you need to set the GroupName property to something on both of them (it should be the same for all linked RadioButton controls).

    Let me know if you have further questions.

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

Sidebar

Related Questions

Any idea why this is wrong in Lua? if Pieza == 1 then if
Any idea why this code: extern C __declspec(dllexport) void Transform(double x[], double y[], int
Any idea why this code gives me a memory leak? As you can see,
Any idea what's wrong with my code? var pageLimit=30; $(document).ready(function() { for(var i =
Any idea why putting google plus code this way wont work in IE8 or
Any idea how I make this window visible in xcode? I want to change
Any idea how to port this code from C# to C++? [DllImport(shlwapi.dll, CharSet =
Any idea on how can I track users bookmarking event? I want to find
Any idea about ORA-1555: snapshot too old: rollback segment number I am getting this
Any idea why this wont print the errors? // Validate the email if (preg_match($regex,

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.