-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
45 lines (42 loc) · 1.43 KB
/
MainWindow.xaml.cs
File metadata and controls
45 lines (42 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System.Windows;
using System.Windows.Controls;
using Serilog;
namespace SSEC_Inventory
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
/// <summary>
/// Initializes the main window and its components.
/// </summary>
public MainWindow()
{
Log.Information("Entering MainWindow constructor");
InitializeComponent();
Log.Information("Exiting MainWindow constructor");
}
/// <summary>
/// Handles the selection change event for the TabControl.
/// Displays a popup with the selected tab's header and logs the event.
/// </summary>
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Log.Information("Entering TabControl_SelectionChanged");
if(e.Source is TabControl tabControl && tabControl.SelectedItem is TabItem selectedTab) {
TabPopupText.Text = $"You selected: {selectedTab.Header}";
TabPopup.IsOpen = true;
Log.Information("Tab selection changed to {TabHeader}", selectedTab.Header);
}
Log.Information("Exiting TabControl_SelectionChanged");
}
/// <summary>
/// Destructor for MainWindow. Logs when the window is finalized.
/// </summary>
~MainWindow()
{
Log.Information("MainWindow destructor called");
}
}
}