Click here to Skip to main content
14,608,056 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello thereWhen I click on checkbox, I want the textbox to appear and enter the value.
Or when I remove the checkbox, I want the department checkboxes to come as a list at the bottom. But the textbox always comes with the checkbox.

For example:

AllDepartment is checked --->Textbox show.

AllDepartment is not checked ----> Show Open other checkbox list(Healthy checkbox,Banking checkbox, ...vs) and textbox show.

What I have tried:

xmal

<GroupBox x:Name="groupBox" Header="Page" HorizontalAlignment="Left" Height="300" VerticalAlignment="Top" Width="782" Margin="-9,0,0,0">

        <StackPanel Orientation="Vertical" VerticalAlignment="Top">
            <StackPanel Orientation="Horizontal">
                <CheckBox x:Name="Department" Content="All Department" IsChecked="{Binding AllDepartmentCheck}"></CheckBox>
                <TextBox  Text="{Binding AllDeparmentCount}" Visibility="{Binding allDepartmentVisibility}"/>
            </StackPanel>
            <Button x:Name="button" Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75"/>
        </StackPanel>
    </GroupBox>




CS.
public bool AllDepartmentCheck
{
    get { return allDepartmentCheck; }
    set
    { 
        allDepartmentCheck = value; 
        allDepartmentCheck = ( allDepartmentCheck != null );
        OnPropertyChanged("allDepartmentCheck");
    }
}



public void Add()
{
//this adding function code.
}
Posted
Updated 25-Aug-19 2:52am
v2
Comments
OriginalGriff 25-Aug-19 5:59am
   
And?
What have you tried?
Where are you stuck?
What help do you need?

Use the "Improve question" widget to edit your question and provide better information.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

public Visibility allDepartmentVisibility {
   get { return allDepartmentCheck ? Visibility.Visible : Visibility.Hidden; } 
}

...

OnPropertyChanged("allDepartmentCheck");
OnPropertyChanged( nameof(allDepartmentVisibility) );
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100