Skip to content

Commit 23b39c7

Browse files
Merge pull request #37 from WPFDevelopersOrg/dev
Dev
2 parents 4d13c0c + 1f58ae4 commit 23b39c7

File tree

7 files changed

+54
-42
lines changed

7 files changed

+54
-42
lines changed

src/WPFDevelopers.Shared/Controls/SongWords/SongWords.cs renamed to src/WPFDevelopers.Samples.Shared/Controls/SongWords/SongWords.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Windows.Media;
55
using System.Windows.Media.Animation;
66

7-
namespace WPFDevelopers.Controls
7+
namespace WPFDevelopers.Samples.Controls
88
{
99
public class SongWords : TextBlock
1010
{
Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,57 @@
1-
<UserControl x:Class="WPFDevelopers.Samples.ExampleViews.SongWordsExample"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
7-
xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
8-
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
9-
mc:Ignorable="d"
10-
d:DesignHeight="450" d:DesignWidth="800"
11-
TextOptions.TextFormattingMode="Display" UseLayoutRounding="True"
12-
SnapsToDevicePixels="True"
13-
Foreground="White">
1+
<UserControl
2+
x:Class="WPFDevelopers.Samples.ExampleViews.SongWordsExample"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
8+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
d:DesignHeight="450"
10+
d:DesignWidth="800"
11+
Foreground="White"
12+
SnapsToDevicePixels="True"
13+
TextOptions.TextFormattingMode="Display"
14+
UseLayoutRounding="True"
15+
mc:Ignorable="d">
1416
<UserControl.Resources>
1517
<LinearGradientBrush x:Key="DefaultBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
16-
<GradientStop Color="#FF33B9AD" Offset="0" />
17-
<GradientStop Color="#FF007ACC" Offset="1" />
18+
<GradientStop Offset="0" Color="#FF33B9AD" />
19+
<GradientStop Offset="1" Color="#FF007ACC" />
1820
</LinearGradientBrush>
1921
</UserControl.Resources>
2022
<controls:CodeViewer>
21-
<Grid Background="{StaticResource DefaultBackgroundBrush}" Height="650" Width="400">
22-
<StackPanel HorizontalAlignment="Center" Grid.Row="1">
23-
<TextBlock Text="中华人民共和国国歌" HorizontalAlignment="Center" FontSize="20" Margin="0,10"/>
24-
<ItemsControl ItemsSource="{Binding MusicWordArray,RelativeSource={RelativeSource AncestorType=local:SongWordsExample}}">
25-
<ItemsControl.ItemTemplate>
26-
<DataTemplate>
27-
<wpfdev:SongWords Text="{Binding SongWords}"
28-
StartDuration="{Binding StarTime}"
29-
Duration="{Binding RunTime}"
30-
Block.TextAlignment="Center"
31-
FontSize="15" Margin="0,4"/>
32-
</DataTemplate>
33-
</ItemsControl.ItemTemplate>
34-
</ItemsControl>
35-
</StackPanel>
36-
</Grid>
23+
<Grid
24+
Width="400"
25+
Height="650"
26+
Background="{StaticResource DefaultBackgroundBrush}">
27+
<StackPanel Grid.Row="1" HorizontalAlignment="Center">
28+
<TextBlock
29+
Margin="0,10"
30+
HorizontalAlignment="Center"
31+
FontSize="20"
32+
Text="中华人民共和国国歌" />
33+
<ItemsControl ItemsSource="{Binding MusicWordArray, RelativeSource={RelativeSource AncestorType=local:SongWordsExample}}">
34+
<ItemsControl.ItemTemplate>
35+
<DataTemplate>
36+
<controls:SongWords
37+
Margin="0,4"
38+
Block.TextAlignment="Center"
39+
FontSize="15"
40+
StartDuration="{Binding StarTime}"
41+
Text="{Binding SongWords}"
42+
Duration="{Binding RunTime}" />
43+
</DataTemplate>
44+
</ItemsControl.ItemTemplate>
45+
</ItemsControl>
46+
</StackPanel>
47+
</Grid>
3748
<controls:CodeViewer.SourceCodes>
38-
<controls:SourceCodeModel
39-
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SongWordsExample.xaml"
40-
CodeType="Xaml"/>
41-
<controls:SourceCodeModel
42-
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SongWordsExample.xaml.cs"
43-
CodeType="CSharp"/>
49+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SongWordsExample.xaml" CodeType="Xaml" />
50+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SongWordsExample.xaml.cs" CodeType="CSharp" />
51+
<controls:SourceCodeModel
52+
CodeSource="/WPFDevelopers.SamplesCode;component/Controls/SongWords/SongWords.cs"
53+
CodeType="CSharp"
54+
Haader="SongWords" />
4455
</controls:CodeViewer.SourceCodes>
4556
</controls:CodeViewer>
4657
</UserControl>

src/WPFDevelopers.Samples.Shared/WPFDevelopers.Samples.Shared.projitems

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<Compile Include="$(MSBuildThisFileDirectory)Controls\ScrollViewer\ScrollViewerBehavior.cs" />
3737
<Compile Include="$(MSBuildThisFileDirectory)Controls\SnowCanvas\SnowCanvas.cs" />
3838
<Compile Include="$(MSBuildThisFileDirectory)Controls\SnowCanvas\Snowflake.cs" />
39+
<Compile Include="$(MSBuildThisFileDirectory)Controls\SongWords\SongWords.cs" />
3940
<Compile Include="$(MSBuildThisFileDirectory)Controls\TimeLine\TimeLine.cs" />
4041
<Compile Include="$(MSBuildThisFileDirectory)Controls\TimeLine\TimeLineItem.cs" />
4142
<Compile Include="$(MSBuildThisFileDirectory)Converts\DrawPrizeIndexToColor.cs" />

src/WPFDevelopers.SamplesCode/WPFDevelopers.SamplesCode.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\SnowCanvas\Snowflake.cs" Link="Controls\SnowCanvas\Snowflake.cs" />
127127
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\ScrollViewer\ScrollViewerAnimation.cs" Link="Controls\ScrollViewer\ScrollViewerAnimation.cs" />
128128
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\ScrollViewer\ScrollViewerBehavior.cs" Link="Controls\ScrollViewer\ScrollViewerBehavior.cs" />
129+
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\SongWords\SongWords.cs" Link="Controls\SongWords\SongWords.cs" />
129130
</ItemGroup>
130131
<ItemGroup>
131132
<Resource Include="..\WPFDevelopers.Samples.Shared\ExampleViews\AboutWindow.xaml">

src/WPFDevelopers.Shared/Controls/BasicBarChart/BasicBarChart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected override void OnRender(DrawingContext drawingContext)
5151

5252
var h = ActualHeight / 2 + 160;
5353
var w = ActualWidth / 2;
54-
var startX = w / 3;
54+
var startX = 0;
5555
var width = SeriesArray.Count() * 120 + startX;
5656
var stratNum = 0;
5757

src/WPFDevelopers.Shared/Controls/RadarChart/RadarChart.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ protected override void OnRender(DrawingContext drawingContext)
5757
var points = new PointCollection();
5858
foreach (var item in RadarArray)
5959
{
60-
var ss = new Point((item.PointValue.X - w) / 100 * item.ValueMax + w,
60+
var model = new Point((item.PointValue.X - w) / 100 * item.ValueMax + w,
6161
(item.PointValue.Y - h) / 100 * item.ValueMax + h);
62-
points.Add(ss);
62+
points.Add(model);
6363
}
6464

6565
geometryContext.BeginFigure(points[points.Count - 1], true, true);

src/WPFDevelopers.Shared/WPFDevelopers.Shared.projitems

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
<Compile Include="$(MSBuildThisFileDirectory)Controls\ScreenCut\ScreenCapture.cs" />
9292
<Compile Include="$(MSBuildThisFileDirectory)Controls\ScreenCut\ScreenCut.cs" />
9393
<Compile Include="$(MSBuildThisFileDirectory)Controls\ScreenCut\ScreenCutAdorner.cs" />
94-
<Compile Include="$(MSBuildThisFileDirectory)Controls\SongWords\SongWords.cs" />
9594
<Compile Include="$(MSBuildThisFileDirectory)Controls\SpotLight\SpotLight.cs" />
9695
<Compile Include="$(MSBuildThisFileDirectory)Controls\StarrySky\StarrySky.cs" />
9796
<Compile Include="$(MSBuildThisFileDirectory)Controls\Status.cs" />

0 commit comments

Comments
 (0)