W
Wonko the Sane
Hello,
I am using a custom control (based on Button), which has in its generic
implementation:
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:BasedOnButton">
|
|
<ContentPresenter .... />
</ControlTemplate>
</Setter.Value>
</Setter Property="Template">
Now, when using this control, I have run into a situation where I want to
use a DataTrigger (to start an animation when a bound value reaches a certain
level). However, I cannot get a DataTemplate to show the data I need in that
control. I'd like something like the following:
<cust:BasedOnButton>
<cust:BasedOnButton.ContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SomePath}">
<TextBlock.Triggers>
<DataTrigger
Binding="{Binding
RelativeSource={RelativeSource Seld}, Path=AnotherPath}"
Value="true">
|
|
</DataTrigger>
</TextBlock.Triggers>
</TextBlock>
</DataTemplate>
</cust:BasedOnButton.ContentTemplate>
</cust:BasedOnButton>
However, when I try to use a DataTemplate, the content of the button just
shows "Windows.System.DataTemplate"(or something like that), or nothing
(blank), depending on things I've tried.
I hope I have explained this enough....
Thanks,
WtS
I am using a custom control (based on Button), which has in its generic
implementation:
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:BasedOnButton">
|
|
<ContentPresenter .... />
</ControlTemplate>
</Setter.Value>
</Setter Property="Template">
Now, when using this control, I have run into a situation where I want to
use a DataTrigger (to start an animation when a bound value reaches a certain
level). However, I cannot get a DataTemplate to show the data I need in that
control. I'd like something like the following:
<cust:BasedOnButton>
<cust:BasedOnButton.ContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SomePath}">
<TextBlock.Triggers>
<DataTrigger
Binding="{Binding
RelativeSource={RelativeSource Seld}, Path=AnotherPath}"
Value="true">
|
|
</DataTrigger>
</TextBlock.Triggers>
</TextBlock>
</DataTemplate>
</cust:BasedOnButton.ContentTemplate>
</cust:BasedOnButton>
However, when I try to use a DataTemplate, the content of the button just
shows "Windows.System.DataTemplate"(or something like that), or nothing
(blank), depending on things I've tried.
I hope I have explained this enough....
Thanks,
WtS