WPF Interview Questions and Answers
Question - 71 : - What is the method to force close a ToolTip, which is currently visible?
Answer - 71 : -
It can be closed by setting the tooltip’s IsOpen property to false.
Question - 72 : - Write the differences between DynamicResource and StaticResource.
Answer - 72 : -
The most basic difference is that StaticResource evaluates the resource one time only, but DynamicResource evaluates it every time the resource is required. And due to this reason, DyanamicResource is heavy on the system but it makes pages or windows load faster
Question - 73 : - In what sense are WPF and Silverlight similar?
Answer - 73 : -
Silverlight and WPF are similar in the sense that they both use XAML and share the same code, syntax and libraries.
Question - 74 : - What is XBAP?
Answer - 74 : -
XBAP is the abbreviated form of XAML Browser Application. It allows WPF applications to run inside web browsers. Installation of .NET framework on the client machine is a prerequisite for running WPF applications. But hosted applications are not given full admission to the client’s machine and are executed in a sandbox environment. Using WPF, such applications can also be created, which run directly in the browser. These applications are called XBAP.
Question - 75 : - Explain Serialization?
Answer - 75 : -
It is the process of converting the state of an object to stream of bytes.
Question - 76 : - What is an adorner?
Answer - 76 : -
They are a special kind of FrameworkElement that provide visual clues to the user. They are also used to add handles to elements and give information about the state of a control. Adorners are bound to the UIElement and are rendered on a surface that lies above the element, which is adorned. This surface is called an AdornerLayer. Adorners are mostly placed relatively to the bounded element.
Question - 77 : - What is the unit of measurement in WPF?
Answer - 77 : -
All measurements are made in device-independent pixels, or logical pixels. One pixel is 1/96th part of an inch. These logical pixels are always mentioned as double, this enables them to have a fractional value too.
Question - 78 : - What is the way to determine if a Freezable object is Frozen?
Answer - 78 : -
“IsFrozen” property of the object can be used to determine if the freezable object is frozen.
Question - 79 : - Write about UserControl in brief.
Answer - 79 : -
UserControl wraps existing controls into a single reusable group. It contains a XAML file and a code. UserControl cannot be styled or templated.
Question - 80 : - Why are layout panels needed for in WPF?
Answer - 80 : -
Layout Panels are needed so that the controls fit screens of different sizes or having different font sizes. If we arrange controls on fixed pixel coordinates, then this model will fail when moved to a different environment. For this reason, Layout panels are necessary.