Animation problem with binding a resource
Posted: 23 Feb 2012, 09:13
Hi,
I am using NoesisGUI to develop 2D game and i have problem with binding a resource in DiscreteObjectKeyFrame.
This code works:
<DiscreteObjectKeyFrame KeyTime="0:0:0.08">
<DiscreteObjectKeyFrame.Value>
<ImageBrush ImageSource="images/chew_man_chew/rompetejas02.png"/>
</DiscreteObjectKeyFrame.Value>
But this code not works:
<UserControl.Resources>
<ImageBrush x:Key="ImgRompetejas02" ImageSource="images/chew_man_chew/rompetejas02.png"/>
</UserControl.Resources>
<DiscreteObjectKeyFrame KeyTime="0:0:0.08" Value="{StaticResource ImgRompetejas02}">
However I can use the resource "ImgRompetejas02" here:
<Border x:Name="ChewManChew" Width="128" Height="128" Background="{StaticResource ImgRompetejas02"}/>


In XamlPad it works both ways.
Thanks.
I am using NoesisGUI to develop 2D game and i have problem with binding a resource in DiscreteObjectKeyFrame.
This code works:
<DiscreteObjectKeyFrame KeyTime="0:0:0.08">
<DiscreteObjectKeyFrame.Value>
<ImageBrush ImageSource="images/chew_man_chew/rompetejas02.png"/>
</DiscreteObjectKeyFrame.Value>
But this code not works:
<UserControl.Resources>
<ImageBrush x:Key="ImgRompetejas02" ImageSource="images/chew_man_chew/rompetejas02.png"/>
</UserControl.Resources>
<DiscreteObjectKeyFrame KeyTime="0:0:0.08" Value="{StaticResource ImgRompetejas02}">
However I can use the resource "ImgRompetejas02" here:
<Border x:Name="ChewManChew" Width="128" Height="128" Background="{StaticResource ImgRompetejas02"}/>


In XamlPad it works both ways.
Thanks.