Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Radio Buttons on different tabs grouping

$
0
0

I have a TabViewModel and pass in a Tabview then I add this to a TabControl with different data on each tab. With in the TabView I have a group of Radio Buttons to change navigation in the content control with in it. It does not matter how many tabs I have open all the radio buttons are staying grouped. I have tried to bind the group name to be all different, I have also build a Markup called "Unique Name" that will assign them new group names. But non of this has worked.  I am not sure what else I can do. Any help would be great. 

Thanks

CurrentViewModel = new UserTabViewModel(Selected.AccountNo, new UserTab());
TabItem tab = new TabItem() { Header = Selected.Name + "-" + Selected.AccountNo };            
tab.Content = CurrentViewModel;
 _lstUserTabs.Add(tab);

     

<UserControl x:Class="UserModule.Views.UserTab"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 

xmlns:nn="clr-namespace:UserModule.Markup"             mc:Ignorable="d" 

             d:DesignHeight="500" d:DesignWidth="500"  >

    <Grid >


            <StackPanel Orientation="Horizontal" nn:LocalName.BaseName="{nn:UniqueName}">

                <RadioButton   Content ="Readers" GroupName="{Binding Path=UniqueName.Name, RelativeSource={RelativeSource Self}}" IsChecked="True" />
                <RadioButton  Content="Titles" GroupName="{Binding Path=UniqueName.Name, RelativeSource={RelativeSource Self}}"/>
                <RadioButton Content ="Chapters" GroupName="{Binding Path=UniqueName.Name, RelativeSource={RelativeSource Self}}"/>
                <RadioButton  Content =" History" GroupName="{Binding Path=UniqueName.Name, RelativeSource={RelativeSource Self}}"/>
                <RadioButton   Content ="Reports"  GroupName="{Binding Path=UniqueName.Name, RelativeSource={RelativeSource Self}}"/>
                <RadioButton  Content ="Books"  GroupName="{Binding Path=UniqueName.Name, RelativeSource={RelativeSource Self}}" />
            </StackPanel>
        </Border>

        <ContentControl Content="{Binding Path=CurrentViewModel}" Grid.Row="1"/>
    </Grid>
</UserControl>


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>