0

What I'd like to do is have a balloon note that when moving the stem of the note adjusts. Think of it like a comic book. You have balloon notes above and below. The stem changes. I want it to be dynamic when moving or resizing the note. I'm not asking for a full solution I'm trying to learn how to do it. Perhaps references to ideas. Right now I just have the standard balloon note being note being made.

<Window x:Class="WpfApplication2.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="TestNote" SizeToContent="WidthAndHeight"
    MouseLeftButtonDown="Window_MouseLeftButtonDown"
    WindowStyle="None"
    AllowsTransparency="True"
    Background="Transparent">
<Canvas Width="400" Height="400" Name="Main" >
    <Path Stroke="Gray" StrokeThickness="2" Name="testPath" Height="206.97" Stretch="Fill" Width="273.448" >
        <Path.Fill >
            <SolidColorBrush Color="Khaki"></SolidColorBrush>
        </Path.Fill>
        <Path.Data>
            <CombinedGeometry GeometryCombineMode="Union">
                <CombinedGeometry.Geometry1>
                    <RectangleGeometry Rect="0,0,100,100" RadiusX="10" RadiusY="10"/>
                </CombinedGeometry.Geometry1>
                <CombinedGeometry.Geometry2>
                    <PathGeometry >
                        <PathFigure StartPoint="50,25">
                            <ArcSegment Size="100,100" RotationAngle="45"
                                SweepDirection="CounterClockwise" Point="25,25" />
                            <LineSegment Point="0,150"/>
                        </PathFigure>
                    </PathGeometry>
                </CombinedGeometry.Geometry2>
            </CombinedGeometry>
        </Path.Data>
    </Path>
</Canvas>
</Window>

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
    private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    {
        this.DragMove();
    }  
}
  • 1
    Why reinventing the wheel? WPF Popup control is just kind of control you need? You can call Popup.IsOpen to show/hide your balloon. see also http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.popup.aspx – David Mar 24 '13 at 08:36
  • how are you moving your note, drag/drop? You might want to take a look at the adorner layer instead of popup, for reasons stated in the question to which I have added an answer [that involves kind of a balloon](http://stackoverflow.com/a/15438391/385995). – Mike Fuchs Mar 24 '13 at 13:12
  • Yeah I'm not looking for a popup. This is not just a balloon. I want to make it editable/draggable/resizeable. I'll take a look at the link you provided adabyron. Essentially I want to save data in the note and be able to retrieve it. –  Mar 26 '13 at 03:40

0 Answers0