I have a ScatterViewItem which contains a Canvas
<Ellipse x:Name="Outer_Ellipse" Fill="White" Width="200" Height="200"></Ellipse>
<Ellipse Fill="Red" Canvas.Top ="15" Canvas.Left="15" Canvas.Right="15" Canvas.Bottom="15" Width="170" Height="170" ></Ellipse>
</Canvas>
</s:ScatterViewItem>
Id like to provide a Custom Shape so that the default rectangle shape is not show (here is a picture of my current implementation .
I followed this example here link text and have consulted the Puzzle that comes with the SDK but I am unable to get it working, my ScatterViewItem is blank.
I defined a path in the SurfaceWindow.Resources
<Path x:Key="ScatterShape" Fill="Blue">
<Path.Data>
<EllipseGeometry
RadiusX="200"
RadiusY="200">
</EllipseGeometry>
</Path.Data>
</Path>
And copied the style attributes from the link above. I created my CustomShape.cs as instructed and then created the ScatterViewItem.
System.Windows.Shapes.Path path;
path = (System.Windows.Shapes.Path)Resources["ScatterShape"];
CustomShape poly = new CustomShape(path.Data);
ScatterViewItem item = new ScatterViewItem();
item.Content = poly;
item.CanScale = false;
Binding binding = new Binding();
binding.Source = poly;
item.SetBinding(ScatterViewItem.DataContextProperty, binding);
scatter.Items.Add(item)
Im slightly confused with the above code since my understanding with the line
item.Content = poly
would overwrite the content of the ScatterViewItem (i.e in my case the Canvas or in another case say an Image). For the time being I don't need to move or scale the ScatterView item so no shadows are neccessary I just simply want to remove the rectangular box.