Get control''s name if control is in style

hi.. Group,

not sure if i can explain my question clearly.

I download a sample code from Microsoft. It uses ControlTemplate. In the ControlTemplate, there are some controls defined like

<Button x:Name="button1".. />

How can I access the button1 from C# code? The button1 is actually in ControlTemplate? Thanks.

BTW:

The sample code is ColorPicker from Microsoft. I want to access the opacitySlider, which is defined in generic.xaml (line 930). The sample code can be download athttp://blogs.msdn.com/wpfsdk/archive/2006/10/26/Uncommon-Dialogs--Font-Chooser-and-Color-Picker-Dialogs.aspx

Thanks.

[913 byte] By [TaoLiu] at [2008-1-7]

Visual Studio Orcas

Site Classified