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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:32:23+00:00 2026-06-02T15:32:23+00:00

Here is the code : <Window.DataContext> <local:MainWindowViewModel /> </Window.DataContext> <Window.Resources> <Style x:Key=RadioToggleButtonStyle TargetType=RadioButton> <Setter

  • 0

Here is the code :

   <Window.DataContext>
    <local:MainWindowViewModel />
</Window.DataContext>

<Window.Resources>

    <Style x:Key="RadioToggleButtonStyle" TargetType="RadioButton">
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <ToggleButton Content="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" IsChecked="{Binding IsChecked, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Width" Value="150" />
        <Setter Property="Height" Value="25" />
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

</Window.Resources>

<Grid>
    <RadioButton Name="radioButton1"
                 Height="29"
                 Margin="193,195,0,0"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Top"
                 **Command="{Binding Path=RadioClickCommand}"**
                 Content="RadioButton"
                 Style="{StaticResource RadioToggleButtonStyle}" />

</Grid>

In MainWindowViewModel : I have following command registration

 public ICommand RadioClickCommand
    {
        get { return new RelayCommand(RadioClickExecute); }
    }
 private void RadioClickExecute()
    {

    }

Button click never triggers the command bind.
any help would be appreciated.

  • 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-02T15:32:24+00:00Added an answer on June 2, 2026 at 3:32 pm

    You forgot in your style that you have to define a Command of a ToggleButton

    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type RadioButton}">
                <ToggleButton Content="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" IsChecked="{Binding IsChecked, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                              Command="{Binding Command, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"/>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the code that I'm using to generate the window: <Grid x:Name=LayoutRoot> <TreeView DataContext={Binding
Here's the code for my window: <Window xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml x:Class=leartWPF.ControlTestWindow x:Name=Window Title=ControlTestWindow Width=640 Height=480>
Here is my code: var showNo = 1; window.setInterval(function() { console.log(showNo); if(showNo === 1)
Here is my spaggeti code $(#table_exams tbody tr).click(function () { window.location.hash=# +$(this).attr(exam_ID); window.location.href=/medilab/prototypes/exams/edit?examId= +
Here's my XAML code: <Window x:Class=CarFinder.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=Search for cars in TuMomo Height=480
A beginner's question, probably a trivial one. Here's the XUL code snippet: <window xmlns=http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul>
so this code here dynamically adds buttons to my wpf windows application. I cant
enter code here Hi All, I have a simple windows service application that connects
I need to restart a windows mobile 6 application. Here is the code I
Ok the error is showing up somewhere in this here code if($error==false) { $query

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.