blob: abd7a145503387e601a33e4c5bb21646ff8309fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
<Window x:Class="Tango.Graphics2D.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Tango.Graphics2D"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="800" DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}">
<Window.Resources>
<SolidColorBrush x:Key="RRR" Color="Blue"></SolidColorBrush>
<Style TargetType="TextBlock" x:Key="textBlock">
<Setter Property="FontSize" Value="12"></Setter>
<Setter Property="FontFamily" Value="Arial"></Setter>
</Style>
</Window.Resources>
<Grid>
<!--<ListBox ItemsSource="{Binding Persons}" VirtualizingPanel.IsVirtualizing="False" ScrollViewer.CanContentScroll="False">
<ListBox.ItemTemplate>
<DataTemplate>
<local:Drawing2DCanvas Height="50" x:Name="host">
<Rectangle Width="30" Height="30">
<Rectangle.Fill>
<SolidColorBrush Color="{Binding Color}" />
</Rectangle.Fill>
</Rectangle>
<TextBlock Canvas.Left="40" Text="{Binding Age}"></TextBlock>
</local:Drawing2DCanvas>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>-->
<StackPanel>
<!--<local:Drawing2DStackPanel VerticalAlignment="Top">
<TextBlock HorizontalAlignment="Left" Margin="0 20 0 0">
<Run>Top</Run>
<Run FontWeight="Bold" FontStyle="Italic">Left</Run>
</TextBlock>
<TextBlock Text="Center Center" HorizontalAlignment="Center" Margin="0 20 0 0"></TextBlock>
<TextBlock Text="Right Bottom" HorizontalAlignment="Right" Margin="0 20 0 0"></TextBlock>
</local:Drawing2DStackPanel>
<local:Drawing2DStackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0 100 0 0" Height="100">
<TextBlock VerticalAlignment="Top">Left Top</TextBlock>
<TextBlock Margin="100 0 0 0" VerticalAlignment="Center">Center Center</TextBlock>
<TextBlock Margin="100 0 0 0" VerticalAlignment="Bottom">Right Bottom</TextBlock>
<Rectangle Margin="100 0 0 0" MouseUp="Rectangle_MouseUp" Fill="Red" Width="100" Height="100" Stroke="Black" StrokeThickness="2"></Rectangle>
<Ellipse Margin="20 0 0 0" MouseUp="Ellipse_MouseUp" Fill="Blue" Width="100" Height="100"></Ellipse>
</local:Drawing2DStackPanel>-->
<Grid Width="300" Height="100" Margin="0 10 0 0">
<local:Drawing2DFrame CanResize="True">
<Border x:Name="border" Margin="10" MouseDown="Border_MouseDown" MouseUp="Border_MouseUp" Background="Gainsboro" BorderBrush="DimGray" BorderThickness="1" CornerRadius="5">
</Border>
<!--<Ellipse Fill="Blue" Width="50" Height="50">
</Ellipse>-->
<TextBlock x:Name="txt" Style="{StaticResource textBlock}" MouseEnter="Txt_MouseEnter" MouseLeave="Txt_MouseLeave" MouseDown="Txt_MouseDown" Text="HGI Roy asd as" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10">
<TextBlock.Foreground>
<SolidColorBrush Color="Red" />
</TextBlock.Foreground>
<TextBlock.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.5" Duration="00:00:0.3"></DoubleAnimation>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.3"></DoubleAnimation>
<ColorAnimation Storyboard.TargetProperty="Foreground.Color" To="Blue" Duration="00:00:0.3"></ColorAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.3"></DoubleAnimation>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.3"></DoubleAnimation>
<ColorAnimation Storyboard.TargetProperty="Foreground.Color" To="Red" Duration="00:00:0.3"></ColorAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
<TextBlock.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1" CenterX="50" CenterY="0.5" />
</TextBlock.RenderTransform>
</TextBlock>
<Line Stroke="Red" X1="0" Y1="0" X2="30" Y2="30"></Line>
<Image Source="/Images/sample.png" Width="50" Height="50" />
<!--<Path Stroke="Black" StrokeThickness="5" Fill="Goldenrod" Stretch="Fill">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="100,50" IsClosed="True">
<LineSegment Point="140,60"/>
<LineSegment Point="150,100"/>
<LineSegment Point="125,120"/>
<LineSegment Point="90,110"/>
<LineSegment Point="80,80"/>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>-->
</local:Drawing2DFrame>
</Grid>
</StackPanel>
<TextBlock x:Name="ttt" Text="Roy Ben Shabat" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10" IsHitTestVisible="True" Background="Red">
<TextBlock.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:00"></DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:00"></DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
<TextBlock.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1" CenterX="50" CenterY="0.5" />
</TextBlock.RenderTransform>
</TextBlock>
</Grid>
</Window>
|