Skip to main content

Visual Programming MCQs with Answers

Practice important Visual Programming MCQs with answers and explanations.

Chapter: 23
Q461:
What is the role of ManipulationDelta event in WPF?
A. Handles changes in manipulation such as translation, scaling, and rotation
B. Initializes manipulation events
C. Captures touch events
D. Completes the manipulation event
Correct Answer: A
Chapter: 23
Q462:
What property must be set to true for an element to participate in manipulation events?
A. IsManipulationEnabled
B. IsManipulationActive
C. ManipulationEnabled
D. ManipulationEventsEnabled
Correct Answer: A
Chapter: 23
Q463:
What is ManipulationInertiaStartingEventArgs used for?
A. To set properties for inertia behavior after manipulation ends
B. To initialize manipulation events
C. To start manipulation events
D. To capture touch points
Correct Answer: A
Chapter: 23
Q464:
In the Canvas_ManipulationDelta method, what is applied to the MatrixTransform?
A. Translation, rotation, and scaling adjustments
B. Only translation adjustments
C. Only scaling adjustments
D. Only rotation adjustments
Correct Answer: A
Chapter: 23
Q465:
What does the Canvas_ManipulationInertiaStarting method adjust?
A. Desired deceleration for translation, rotation, and expansion behavior
B. The starting point for manipulation
C. The translation and scaling of the image
D. The initial touch points on the canvas
Correct Answer: A
Chapter: 23
Q466:
What event is used to handle boundary feedback in manipulation?
A. ManipulationBoundaryFeedback
B. ManipulationDelta
C. ManipulationStarting
D. ManipulationCompleted
Correct Answer: A
Chapter: 23
Q467:
What does setting ManipulationModes to Rotate in Grid_ManipulationStarting achieve?
A. Restricts manipulation to rotation only
B. Enables translation and scaling
C. Enables both translation and rotation
D. Disables all manipulation
Correct Answer: A
Chapter: 23
Q468:
What is the ManipulationCompleted event used for in the SpinThePrizeWheel example?
A. To notify the user of the result after the manipulation has ended
B. To start the rotation of the prize wheel
C. To adjust the deceleration of the rotation
D. To apply the transformation to the image
Correct Answer: A
Chapter: 23
Q469:
What does the Grid_ManipulationDelta method update?
A. The angle of rotation for the prize wheel
B. The position of the touch point on the canvas
C. The scaling of the image
D. The background color of the window
Correct Answer: A
Chapter: 23
Q470:
How does ManipulationInertiaStartingEventArgs affect the manipulation behavior?
A. It allows setting deceleration for the end of manipulation
B. It starts the manipulation process
C. It cancels the ongoing manipulation
D. It initializes the manipulation event
Correct Answer: A
Chapter: 23
Q471:
What does the Canvas.Background property in the XAML code define?
A. The background gradient of the canvas
B. The border color of the canvas
C. The size of the canvas
D. The layout of child elements in the canvas
Correct Answer: A
Chapter: 24
Q472:
What is the purpose of implementing the ICommand interface in WPF?
A. To define a command with execute and can execute methods
B. To create a custom UI element with specific properties
C. To handle events directly in the code-behind
D. To define data binding for a UI element
Correct Answer: A
Chapter: 24
Q473:
How can you enable or disable a command in WPF?
A. By setting the IsEnabled property of the command
B. By using the CanExecute method of the command
C. By modifying the CommandBindings collection
D. By changing the Command property of the button
Correct Answer: B
Chapter: 24
Q474:
Which event is triggered when a command is executed?
A. Executed
B. CanExecuteChanged
C. PreviewExecuted
D. CommandChanged
Correct Answer: A
Chapter: 24
Q475:
What is the role of CommandBindings in WPF?
A. To associate commands with event handlers
B. To define the layout of UI elements
C. To set properties for UI elements
D. To manage data binding between UI elements
Correct Answer: A
Chapter: 24
Q476:
In XAML, how do you specify a command to be executed when a button is clicked?
A. By setting the Command property of the button
B. By handling the Click event of the button
C. By binding the Command property to a method
D. By using the CommandBinding in the code-behind
Correct Answer: A
Chapter: 24
Q477:
What is the CanExecute method used for in the ICommand interface?
A. To determine if a command can be executed
B. To define the logic for executing a command
C. To update the command's appearance based on execution status
D. To handle the completion of command execution
Correct Answer: A
Chapter: 24
Q478:
What is the purpose of CommandBinding in WPF?
A. To link a command to its execution logic and its ability to execute
B. To define a new command for a specific control
C. To manage the input gestures for commands
D. To create a new UI element with custom behavior
Correct Answer: A
Chapter: 24
Q479:
How do you add a command binding to a control in XAML?
A. By defining it within the <Window.CommandBindings> section
B. By setting the Command property directly on the control
C. By using the CommandBindings collection in the control's code-behind
D. By using the InputBindings property of the control
Correct Answer: A
Chapter: 24
Q480:
What is a typical use case for KeyBinding in WPF?
A. To associate a keyboard shortcut with a command
B. To bind a key press to a specific UI element
C. To handle mouse events for a control
D. To change the appearance of a control based on keyboard input
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Visual Programming

🚀 Start Quiz Now