Reputation: 716
I've got a custom composite WPF control (AvalonEdit) in my application that I'd like to animate whenever its Text property is changed. What I intend to do is:
I've got #2 figured out but haven't got a clue about how I'd achieve #1. Any help would be appreciated.
Upvotes: 0
Views: 221
Reputation: 70122
For (1) there are a couple of approaches that spring to mind:
VisualBrush - A visual brush is a brush which is defined by a complex UI element. In other words, you can create a visual tree of elements and use this to create your brush. See the tutorial here. I think in your case you would have to define your UI twice, i.e. have an instance of your AvalonEdit control as the 'visual' for you VisualBrush, so perhaps not ideal
WriteableBitmap - A writeable bitmap allows you to copy part of your UI into a bitmap where you can manipulate he pixel data. Whilst you do not need pixel-level manipulation it is still a convenient mechanism for cloning your UI. See this tutorial I wrote here.
Upvotes: 1