Skip to content

Commit bf6ba0e

Browse files
Fix multiple warnings and update libraries
1 parent b7eaaac commit bf6ba0e

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

src/InvLock/Controls/OutlinedTextBlock.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class OutlinedTextBlock : FrameworkElement, IAddChild
1010
{
1111
#region Private Fields
1212

13-
private Geometry _textGeometry;
13+
private Geometry? _textGeometry;
1414

1515
#endregion Private Fields
1616

@@ -38,12 +38,12 @@ public void CreateText()
3838
FontStyle fontStyle = FontStyles.Normal;
3939
FontWeight fontWeight = FontWeights.Medium;
4040

41-
if (Bold == true)
41+
if (Bold)
4242
{
4343
fontWeight = FontWeights.Bold;
4444
}
4545

46-
if (Italic == true)
46+
if (Italic)
4747
{
4848
fontStyle = FontStyles.Italic;
4949
}
@@ -55,13 +55,12 @@ public void CreateText()
5555
FlowDirection.LeftToRight,
5656
new Typeface(Font, fontStyle, fontWeight, FontStretches.Normal),
5757
FontSize,
58-
Brushes.Black // This brush does not matter since we use the geometry of the text.
59-
);
58+
Brushes.Black, // This brush does not matter since we use the geometry of the text.
59+
1);
6060

6161
// Build the geometry object that represents the text.
6262
_textGeometry = formattedText.BuildGeometry(new Point(0, 0));
6363

64-
//set the size of the custome control based on the size of the text
6564
MinWidth = formattedText.Width;
6665
MinHeight = formattedText.Height;
6766
}
@@ -73,7 +72,6 @@ public void CreateText()
7372
protected override void OnRender(DrawingContext drawingContext)
7473
{
7574
CreateText();
76-
// Draw the outline based on the properties that are set.
7775
drawingContext.DrawGeometry(Fill, new Pen(Stroke, StrokeThickness), _textGeometry);
7876
}
7977

@@ -252,7 +250,7 @@ public bool Italic
252250
}
253251

254252
/// <summary>
255-
/// Specifies the brush to use for the stroke and optional hightlight of the formatted text.
253+
/// Specifies the brush to use for the stroke and optional highlight of the formatted text.
256254
/// </summary>
257255
public Brush Stroke
258256
{
@@ -262,7 +260,7 @@ public Brush Stroke
262260
}
263261

264262
/// <summary>
265-
/// The stroke thickness of the font.
263+
/// The stroke thickness of the font.
266264
/// </summary>
267265
public ushort StrokeThickness
268266
{
@@ -285,9 +283,9 @@ public void AddChild(object value)
285283
{
286284
}
287285

288-
public void AddText(string value)
286+
public void AddText(string text)
289287
{
290-
Text = value;
288+
Text = text;
291289
}
292290

293291
#endregion DependencyProperties

src/InvLock/DataContexts/MainWindowDataContext.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ internal partial class MainWindowDataContext(Func<LockWindow?> lockWindowAccesso
1111
#if DEBUG
1212
public string Title => $"{App.AppName} - Dev {AppVersion}";
1313
#else
14-
15-
public event PropertyChangedEventHandler? PropertyChanged;
16-
1714
public string Title => $"{App.AppName} - {AppVersion}";
1815
#endif
1916

src/InvLock/InvLock.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
1919
<PackageReference Include="CuteUtils" Version="1.0.0" />
2020
<PackageReference Include="SharpHook" Version="5.3.8" />
21-
<PackageReference Include="WPF-UI" Version="3.0.5" />
22-
<PackageReference Include="WPF-UI.Tray" Version="3.0.5" />
21+
<PackageReference Include="WPF-UI" Version="4.0.0" />
22+
<PackageReference Include="WPF-UI.Tray" Version="4.0.0" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

0 commit comments

Comments
 (0)