You can put all the controls in one panel (Grid, StackPanel, etc.), and leave the cancel button(I don’t want to disable) in another panel. Then set the IsEnabled property of the other panel.
In practice, this will probably introduce more than one additional panel.
For example, if you had a StackPanel of buttons, you can add an additional StackPanel:
<StackPanel Orientation="Horizontal"> <StackPanel x:Name="controlContainer" Orientation="Horizontal"> <!-- Other Buttons Here --> </StackPanel> <Button Content="Cancel" /> </StackPanel>
Then, you would do the following to disable everything but the cancel button:
controlContainer.IsEnabled = false;