Skip to content

Commit 8488b33

Browse files
authored
Ver 1.1.1
Ver 1.1.1
2 parents 9549408 + 27b62cb commit 8488b33

File tree

13 files changed

+391
-119
lines changed

13 files changed

+391
-119
lines changed

IntervalGraph.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.6.33815.320
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntervalGraph", "IntervalGraph\IntervalGraph.csproj", "{567F3256-F5DC-4266-A4A1-BF943040F581}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntervalGraph", "IntervalGraph\IntervalGraph.csproj", "{567F3256-F5DC-4266-A4A1-BF943040F581}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{567F3256-F5DC-4266-A4A1-BF943040F581}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{567F3256-F5DC-4266-A4A1-BF943040F581}.Debug|Any CPU.Build.0 = Debug|Any CPU
14+
{567F3256-F5DC-4266-A4A1-BF943040F581}.Debug|Any CPU.ActiveCfg = Release|Any CPU
15+
{567F3256-F5DC-4266-A4A1-BF943040F581}.Debug|Any CPU.Build.0 = Release|Any CPU
1616
{567F3256-F5DC-4266-A4A1-BF943040F581}.Release|Any CPU.ActiveCfg = Release|Any CPU
1717
{567F3256-F5DC-4266-A4A1-BF943040F581}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection

IntervalGraph/Components/IntAxis.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,22 @@ public Brush TextColorBrush
118118

119119
#endregion
120120

121+
#region FontFamilyProperty
122+
123+
public static readonly DependencyProperty FontFamilyProperty = DependencyProperty.Register(
124+
nameof(FontFamily),
125+
typeof(FontFamily),
126+
typeof(IntAxis),
127+
new PropertyMetadata(default(FontFamily)));
128+
129+
public FontFamily FontFamily
130+
{
131+
get => (FontFamily)GetValue(FontFamilyProperty);
132+
set => SetValue(FontFamilyProperty, value);
133+
}
134+
135+
#endregion
136+
121137
#region TextFormatProperty
122138

123139
public static readonly DependencyProperty TextFormatProperty = DependencyProperty.Register(
@@ -140,7 +156,7 @@ public string TextFormat
140156
nameof(FontSize),
141157
typeof(double?),
142158
typeof(IntAxis),
143-
new PropertyMetadata(null));
159+
new PropertyMetadata(null, UpdateTextFontSize));
144160

145161
public double? FontSize
146162
{
@@ -225,15 +241,14 @@ public double MaxZoom
225241

226242
#endregion
227243

228-
229-
230244
#endregion
231245

232246

233247
#region DrawedFontSize
234248

235249
private double _drawedFontSize;
236250

251+
[EditorBrowsable(EditorBrowsableState.Never)]
237252
public double DrawedFontSize
238253
{
239254
get => _drawedFontSize;
@@ -244,6 +259,7 @@ public double DrawedFontSize
244259

245260
#region TextContainerHeight
246261

262+
[EditorBrowsable(EditorBrowsableState.Never)]
247263
public GridLength TextContainerHeight
248264
{
249265
get

IntervalGraph/Components/IntervalGraph.xaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,27 @@
1010
xmlns:c="clr-namespace:IntervalGraph.Infrastructure.Conveters.Converters"
1111
xmlns:graph="clr-namespace:IntervalGraph.Models.Graph"
1212
mc:Ignorable="d"
13-
d:DesignHeight="450" d:DesignWidth="800"
14-
Background="White">
13+
d:DesignHeight="450" d:DesignWidth="800">
14+
15+
<UserControl.Resources>
16+
<Style x:Key="DefaultScrollViewerStyle" TargetType="ScrollViewer"/>
17+
</UserControl.Resources>
1518

1619
<Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}}">
1720

1821
<ScrollViewer HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
1922
VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Visible"
2023
DataContext="{Binding RelativeSource={RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}}"
21-
BorderThickness="0">
24+
BorderThickness="0"
25+
Style="{Binding ScrollViewerStyle, TargetNullValue={StaticResource DefaultScrollViewerStyle}}"
26+
PreviewMouseWheel="OnMouseWheel">
2227

2328
<i:Interaction.Behaviors>
2429
<b:BindableActualSizeBehavior ActualWidth="{Binding GraphWidth, Mode=OneWayToSource}"/>
2530
</i:Interaction.Behaviors>
2631

32+
33+
2734
<Grid Width="{Binding ZoomedGraphWidth}" Background="Transparent">
2835

2936
<Grid.RowDefinitions>
@@ -111,7 +118,7 @@
111118
<DataTemplate>
112119
<Path Stroke="{Binding StrokeBrush}" StrokeThickness="{Binding StrokeThickness}" StrokeDashArray="{Binding StrokeDashArray}" Fill="{Binding FillBrush}">
113120
<Path.Data>
114-
<MultiBinding Converter="{cm:GraphIntervalToGeometry}">
121+
<MultiBinding Converter="{cm:GraphIntervalToGeometryConverter}">
115122
<Binding/>
116123
<Binding RelativeSource="{RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}"
117124
Path="ColumnWidth"/>
@@ -169,10 +176,12 @@
169176
VerticalAlignment="Center">
170177

171178
<Path.Data>
172-
<MultiBinding Converter="{cm:GraphIntervalToAxisCircle}">
179+
<MultiBinding Converter="{cm:GraphIntervalToAxisCircleConverter}">
173180
<Binding/>
174181
<Binding RelativeSource="{RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}"
175182
Path="ColumnWidth"/>
183+
<Binding RelativeSource="{RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}"
184+
Path="DrawedMinValue"/>
176185
<Binding RelativeSource="{RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}"
177186
Path="IntAxis.CirclesRadius"/>
178187
</MultiBinding>
@@ -205,6 +214,7 @@
205214
<Canvas>
206215

207216
<TextBlock FontSize="{Binding RelativeSource={RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}, Path=IntAxis.DrawedFontSize}"
217+
FontFamily="{Binding RelativeSource={RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}, Path=IntAxis.FontFamily}"
208218
Foreground="{Binding RelativeSource={RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}, Path=IntAxis.TextColorBrush}">
209219

210220
<TextBlock.Text>

0 commit comments

Comments
 (0)