You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I put a CanvasControl in a Page and used Draw function to define how to use a list of data to draw.
Now I want to make it a CustomControl. I want it have a DataSource Property to get data and use PropertyChangedCallback to trigger Invalidate().
The problem is I don't know how to define a Draw function for a CanvasControl in XAML.
<Style TargetType="local:MyCanvasControl" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:MyCanvasControl">
<canvas:CanvasControl
DataSource="{TemplateBinding DataSource}"
Draw="" //How to define a Draw in XAML and how to use ?.Invalidate() in CS?
></canvas:CanvasControl>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I put a CanvasControl in a Page and used Draw function to define how to use a list of data to draw.
Now I want to make it a CustomControl. I want it have a DataSource Property to get data and use PropertyChangedCallback to trigger Invalidate().
The problem is I don't know how to define a Draw function for a CanvasControl in XAML.
Beta Was this translation helpful? Give feedback.
All reactions