Add About dialog with version info
- About button added next to Exit in header - Shows app name, version, author, and company - Version 1.1.4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,85 @@ public partial class MainWindow : Window
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
private void AboutButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
var versionStr = $"{version?.Major}.{version?.Minor}.{version?.Build}";
|
||||
|
||||
var aboutWindow = new Window
|
||||
{
|
||||
Title = "About Monitor Control",
|
||||
Width = 300,
|
||||
Height = 180,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen,
|
||||
ResizeMode = ResizeMode.NoResize,
|
||||
WindowStyle = WindowStyle.None,
|
||||
AllowsTransparency = true,
|
||||
Background = Brushes.Transparent
|
||||
};
|
||||
|
||||
var border = new Border
|
||||
{
|
||||
Background = new SolidColorBrush(Color.FromArgb(0xF0, 0x33, 0x33, 0x33)),
|
||||
CornerRadius = new CornerRadius(8),
|
||||
BorderBrush = new SolidColorBrush(Color.FromRgb(0x55, 0x55, 0x55)),
|
||||
BorderThickness = new Thickness(1),
|
||||
Padding = new Thickness(20)
|
||||
};
|
||||
|
||||
var stack = new StackPanel { VerticalAlignment = VerticalAlignment.Center };
|
||||
|
||||
stack.Children.Add(new TextBlock
|
||||
{
|
||||
Text = "Monitor Control",
|
||||
Foreground = Brushes.White,
|
||||
FontSize = 18,
|
||||
FontWeight = FontWeights.SemiBold,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
Margin = new Thickness(0, 0, 0, 5)
|
||||
});
|
||||
|
||||
stack.Children.Add(new TextBlock
|
||||
{
|
||||
Text = $"Version {versionStr}",
|
||||
Foreground = Brushes.LightGray,
|
||||
FontSize = 12,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
Margin = new Thickness(0, 0, 0, 10)
|
||||
});
|
||||
|
||||
stack.Children.Add(new TextBlock
|
||||
{
|
||||
Text = "by David H. Friedel Jr",
|
||||
Foreground = Brushes.Gray,
|
||||
FontSize = 11,
|
||||
HorizontalAlignment = HorizontalAlignment.Center
|
||||
});
|
||||
|
||||
stack.Children.Add(new TextBlock
|
||||
{
|
||||
Text = "MarketAlly",
|
||||
Foreground = Brushes.Gray,
|
||||
FontSize = 11,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
Margin = new Thickness(0, 0, 0, 15)
|
||||
});
|
||||
|
||||
var closeBtn = new Button
|
||||
{
|
||||
Content = "OK",
|
||||
Width = 80,
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
Style = (Style)FindResource("DarkButton")
|
||||
};
|
||||
closeBtn.Click += (s, args) => aboutWindow.Close();
|
||||
stack.Children.Add(closeBtn);
|
||||
|
||||
border.Child = stack;
|
||||
aboutWindow.Content = border;
|
||||
aboutWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void ShowLogButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var logWindow = new Window
|
||||
|
||||
Reference in New Issue
Block a user