Hello,
I am using a custom control (based on Button), which has in its generic
implementation:
<Setter Property="Templ ate">
<Setter.Value >
<ControlTemplat e TargetType="loc al:BasedOnButto n">
|
|
<ContentPresent er .... />
</ControlTemplate >
</Setter.Value>
</Setter Property="Templ ate">
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:BasedOnBu tton>
<cust:BasedOnBu tton.ContentTem plate>
<DataTemplate >
<TextBlock Text="{Binding Path=SomePath}" >
<TextBlock.Trig gers>
<DataTrigger
Binding="{Bindi ng
RelativeSource= {RelativeSource Seld}, Path=AnotherPat h}"
Value="true">
|
|
</DataTrigger>
</TextBlock.Trigg ers>
</TextBlock>
</DataTemplate>
</cust:BasedOnBut ton.ContentTemp late>
</cust:BasedOnBut ton>
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="Templ ate">
<Setter.Value >
<ControlTemplat e TargetType="loc al:BasedOnButto n">
|
|
<ContentPresent er .... />
</ControlTemplate >
</Setter.Value>
</Setter Property="Templ ate">
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:BasedOnBu tton>
<cust:BasedOnBu tton.ContentTem plate>
<DataTemplate >
<TextBlock Text="{Binding Path=SomePath}" >
<TextBlock.Trig gers>
<DataTrigger
Binding="{Bindi ng
RelativeSource= {RelativeSource Seld}, Path=AnotherPat h}"
Value="true">
|
|
</DataTrigger>
</TextBlock.Trigg ers>
</TextBlock>
</DataTemplate>
</cust:BasedOnBut ton.ContentTemp late>
</cust:BasedOnBut ton>
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
Comment