-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathStarrySkyExample.xaml
More file actions
78 lines (78 loc) · 4.18 KB
/
StarrySkyExample.xaml
File metadata and controls
78 lines (78 loc) · 4.18 KB
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
<UserControl
x:Class="WPFDevelopers.Samples.ExampleViews.StarrySkyExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{DynamicResource WD.WindowTextBrush}" />
<Setter Property="FontSize" Value="14" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Margin" Value="2" />
</Style>
<Style BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type TextBox}">
<Setter Property="wd:ElementHelper.Watermark" Value="输入内容" />
<Setter Property="wd:ElementHelper.CornerRadius" Value="3" />
<Setter Property="Width" Value="100" />
</Style>
</UserControl.Resources>
<controls:CodeViewer Header="{Binding NavigateMenuItem.Name}">
<Grid>
<wd:StarrySky Name="myStarrySky" />
<StackPanel
HorizontalAlignment="Left"
VerticalAlignment="Top"
wd:PanelHelper.Spacing="3">
<StackPanel Orientation="Horizontal">
<TextBlock Text="星星个数:" />
<TextBox x:Name="tbx_starCount" Text="{Binding ElementName=myStarrySky, Path=StarCount}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="最小尺寸:" />
<TextBox Name="tbx_starSizeMin" Text="{Binding ElementName=myStarrySky, Path=StarSizeMin}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="最大尺寸:" />
<TextBox Name="tbx_starSizeMax" Text="{Binding ElementName=myStarrySky, Path=StarSizeMax}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="最小速度:" />
<TextBox Name="tbx_starVMin" Text="{Binding ElementName=myStarrySky, Path=StarVMin}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="最大速度:" />
<TextBox Name="tbx_starVMax" Text="{Binding ElementName=myStarrySky, Path=StarVMax}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="最小转速:" />
<TextBox Name="tbx_starRVMin" Text="{Binding ElementName=myStarrySky, Path=StarRVMin}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="最大转速:" />
<TextBox Name="tbx_starRVMax" Text="{Binding ElementName=myStarrySky, Path=StarRVMax}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="连线倍率:" />
<TextBox Name="tbx_lineRate" Text="{Binding ElementName=myStarrySky, Path=LineRate}" />
</StackPanel>
<Button
Name="btn_render"
Height="40"
wd:ElementHelper.CornerRadius="3"
Click="btn_render_Click"
Content="生成" />
</StackPanel>
</Grid>
<controls:CodeViewer.SourceCodes>
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/StarrySkyExample.xaml" CodeType="Xaml" />
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/StarrySkyExample.xaml.cs" CodeType="CSharp" />
</controls:CodeViewer.SourceCodes>
</controls:CodeViewer>
</UserControl>