1 / 3

Szablony kontrolek

Pytania na egzamin #1. Szablony kontrolek. 1. Which of the following XAML samples correctly binds the Background property of the Label control in the template to the Background property of its templated parent?.

sereno
Download Presentation

Szablony kontrolek

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pytania na egzamin #1 Szablony kontrolek

  2. 1. Which of the following XAML samples correctly binds the Backgroundproperty of theLabel control in the template to the Background property ofits templated parent? • A.<ControlTemplate x:Key="TestTemplate„> <LabelBackground="Background" /></ControlTemplate> • B.<ControlTemplate x:Key="TestTemplate„> <LabelBackground="{BindingBackground}" /></ControlTemplate> • C.<ControlTemplate x:Key="TestTemplate„> <Label Background="{TemplateBindingBackground}" /></ControlTemplate> • D.<ControlTemplate x:Key="TestTemplate„><Label Background="{Binding RelativeSource={RelativeSourceTemplatedParent}, Path=Background}" /></ControlTemplate>

  3. 2. Which of the following XAML samples correctly appliesthe control template to allinstances of Label in Window? • A.<Window.Resources><ControlTemplate x:Key="TestTemplate„TargetType="Label“><Label Background="{Binding RelativeSource={RelativeSourceTemplatedParent}, Path=Background}" /> </ControlTemplate> <Style TargetType="Label„><Setter Property="Template" Value="{StaticResourceTestTemplate}" /> </Style></Window.Resources> • B.<Window.Resources> <Style TargetType="Label„><Setter Property="Template" Value="{StaticResourceTestTemplate}" /> </Style><ControlTemplate x:Key="TestTemplate" TargetType="Label“><Label Background="{Binding RelativeSource={RelativeSourceTemplatedParent}, Path=Background}" /> </ControlTemplate></Window.Resources>

More Related