Animate field
-
How can I animate a field which is not defined in XAML but in normal code with a Storyboard?? Simply specifying the field's name does not work..
-
How can I animate a field which is not defined in XAML but in normal code with a Storyboard?? Simply specifying the field's name does not work..
elektrowolf wrote:
animate a field
What is a field?
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
-
elektrowolf wrote:
animate a field
What is a field?
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
Karl Shifflett wrote:
What is a field?
A variable in a class.
-
Karl Shifflett wrote:
What is a field?
A variable in a class.
How is this field represented in your UI? What are you trying to animate? What do you want the UI to do?
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
-
How is this field represented in your UI? What are you trying to animate? What do you want the UI to do?
Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
I create some balls in a Viewport3D during runtime and want them to slowly grow when they are hovered by the mouse. So I define the ScaleTransform3D as a class variable and add it to the balls transformation group in the MouseEnter event and remove it again in the MouseLeave event. In these event handlers I also want to raise the growing animation. So the ball is not available in XAML, but the transformation should be. The only problem is, how to access it??
-
I create some balls in a Viewport3D during runtime and want them to slowly grow when they are hovered by the mouse. So I define the ScaleTransform3D as a class variable and add it to the balls transformation group in the MouseEnter event and remove it again in the MouseLeave event. In these event handlers I also want to raise the growing animation. So the ball is not available in XAML, but the transformation should be. The only problem is, how to access it??
In the below code, I'm access a Property on the UserControl called ProductLines from within XAML. You use
RelativeSource={RelativeSource FindAncestor
to find the control up the visual tree and then can access it properties.<ComboBox x:Name="cboProductLineComboBoxEditor"
ItemsSource="{Binding Path=ProductLines, RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type local:SalesPersonMaintenanceEditingxamDataGrid}}}"
IsEditable="False" SelectedValuePath="ProductLineIdent"
SelectedValue="{Binding RelativeSource={RelativeSource TemplatedParent},
Path=ProductLineId, Mode=TwoWay}" IsSynchronizedWithCurrentItem="True"/>Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
-
In the below code, I'm access a Property on the UserControl called ProductLines from within XAML. You use
RelativeSource={RelativeSource FindAncestor
to find the control up the visual tree and then can access it properties.<ComboBox x:Name="cboProductLineComboBoxEditor"
ItemsSource="{Binding Path=ProductLines, RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type local:SalesPersonMaintenanceEditingxamDataGrid}}}"
IsEditable="False" SelectedValuePath="ProductLineIdent"
SelectedValue="{Binding RelativeSource={RelativeSource TemplatedParent},
Path=ProductLineId, Mode=TwoWay}" IsSynchronizedWithCurrentItem="True"/>Cheers, Karl
» CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP ProfileJust a grain of sand on the worlds beaches.
Actually, I have to specify the target's name :(