Skip to content

Commit 27b62cb

Browse files
committed
Add fontFamily for text
1 parent b7b1096 commit 27b62cb

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

IntervalGraph/Components/IntAxis.cs

Lines changed: 16 additions & 2 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(
@@ -225,8 +241,6 @@ public double MaxZoom
225241

226242
#endregion
227243

228-
229-
230244
#endregion
231245

232246

IntervalGraph/Components/IntervalGraph.xaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,6 @@
114114
</ItemsPanelTemplate>
115115
</ItemsControl.ItemsPanel>
116116

117-
<ItemsControl.ItemContainerStyle>
118-
<Style TargetType="ContentPresenter">
119-
<Setter Property="Grid.ZIndex" Value="{Binding ZIndex}"/>
120-
</Style>
121-
</ItemsControl.ItemContainerStyle>
122-
123117
<ItemsControl.ItemTemplate>
124118
<DataTemplate>
125119
<Path Stroke="{Binding StrokeBrush}" StrokeThickness="{Binding StrokeThickness}" StrokeDashArray="{Binding StrokeDashArray}" Fill="{Binding FillBrush}">
@@ -220,6 +214,7 @@
220214
<Canvas>
221215

222216
<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}"
223218
Foreground="{Binding RelativeSource={RelativeSource AncestorType=local:IntervalGraph, Mode=FindAncestor}, Path=IntAxis.TextColorBrush}">
224219

225220
<TextBlock.Text>

IntervalGraph/IntervalGraph.csproj

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,17 @@
66
<Nullable>enable</Nullable>
77
<UseWPF>true</UseWPF>
88
<Title>IntervalGraph_WPF</Title>
9-
<Version>1.0.7</Version>
9+
<Version>1.1.0</Version>
1010
<Authors>ControlDev</Authors>
1111
<Product>IntervalGraph_WPF</Product>
1212
<Description>Extension for WPF, thanks to which you can create an interval graph. An interval graph is a graph used for the interval method in mathematics.</Description>
1313
<PackageTags>WPF;Graph</PackageTags>
1414
<PackageProjectUrl>https://github.com/C0ntrolDev/IntervalGraph</PackageProjectUrl>
15-
<PackageIcon>ApplicationFrameHost_aFQ3jPHdKc.png</PackageIcon>
15+
<PackageIcon>DeathTimeProject_5lQvN1DD1G.png</PackageIcon>
1616
<Copyright>MIT</Copyright>
1717
<RepositoryUrl>https://github.com/C0ntrolDev/IntervalGraph</RepositoryUrl>
1818
</PropertyGroup>
1919

20-
<ItemGroup>
21-
<None Include="..\..\..\..\..\ApplicationFrameHost_aFQ3jPHdKc.png">
22-
<Pack>True</Pack>
23-
<PackagePath>\</PackagePath>
24-
</None>
25-
</ItemGroup>
26-
2720
<ItemGroup>
2821
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
2922
</ItemGroup>

Logo.png

21.5 KB
Loading

0 commit comments

Comments
 (0)