如何在XAML中实现如下所示的圆形按钮

时间:2015-01-28 09:15:26

标签: .net wpf xaml

我正在开发XAML上的逻辑连接器,但却陷入了生成困境 AND连接器

enter image description here

代码:

    <Grid> 
       <Ellipse Stroke="Red" StrokeThickness="1" Fill="Black"></Ellipse>   
       <Button> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Black" >+</TextBlock> </Button>      
       <Ellipse Stroke="Black" StrokeThickness="1" Margin="5"> </Ellipse> 
</Grid>

1 个答案:

答案 0 :(得分:0)

最后通过添加路径数据得到答案

<Grid >
                    <Ellipse HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stroke="Black" StrokeThickness="1" />
                    <Path Data="M10,0 L10,20 z" Stroke="Black" StrokeThickness="1" Stretch="Fill"  />
                  <Path Data="M0,10 L20,10 z" Stroke="Black" StrokeThickness="1" Stretch="Fill"  />
                </Grid>