Felix K.
Felix K.

Reputation: 6281

Set property to element

I searched and testet alot but i don't get it. How is it possible to set the property of one object to a element which is defined in xaml? I tried it with bindings but it won't work.

Xaml-sample:

<RadioButton Content="Settings" Height="Auto" Style="{StaticResource {x:Type ToggleButton}}" Padding="5" IsChecked="True" Checked="MenuCheckbox_Checked" />
<p:SettingsPage x:Name="SettingsPage" />

In the example i want to set the Tag property of the RadioButton to the object reference of the SettingsPage.

Upvotes: 0

Views: 153

Answers (1)

brunnerh
brunnerh

Reputation: 184386

Have you tried x:Reference?

<RadioButton Tag="{x:Reference SettingsPage}" ...>

Upvotes: 1

Related Questions