Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TitleBarButton: Fix Foreground not using property value at initial #1017

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs
Original file line number Diff line number Diff line change
@@ -110,14 +110,15 @@
{
DependencyPropertyDescriptor
.FromProperty(ButtonsForegroundProperty, typeof(Brush))
.RemoveValueChanged(this, OnButtonsForegroundChanged);

Check warning on line 113 in src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void TitleBarButton.OnButtonsForegroundChanged(object sender, EventArgs e)' doesn't match the target delegate 'EventHandler' (possibly because of nullability attributes).
}

private void TitleBarButton_Loaded(object sender, RoutedEventArgs e)
{
RenderButtonsForeground = ButtonsForeground;
DependencyPropertyDescriptor
.FromProperty(ButtonsForegroundProperty, typeof(Brush))
.AddValueChanged(this, OnButtonsForegroundChanged);

Check warning on line 121 in src/Wpf.Ui/Controls/TitleBar/TitleBarButton.cs

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void TitleBarButton.OnButtonsForegroundChanged(object sender, EventArgs e)' doesn't match the target delegate 'EventHandler' (possibly because of nullability attributes).
}

private void OnButtonsForegroundChanged(object sender, EventArgs e)

Unchanged files with check annotations Beta

/// </summary>
/// <param name="sender">Sender of the click event.</param>
/// <param name="parameter">Additional parameters.</param>
protected override void OnTemplateButtonClick(string parameter)

Check warning on line 189 in src/Wpf.Ui/Controls/PasswordBox/PasswordBox.cs

GitHub Actions / build

Nullability of type of parameter 'parameter' doesn't match overridden member (possibly because of nullability attributes).
{
#if DEBUG
System.Diagnostics.Debug.WriteLine(
/// </summary>
public class UiApplication
{
private static UiApplication _uiApplication;

Check warning on line 13 in src/Wpf.Ui/UiApplication.cs

GitHub Actions / build

Non-nullable field '_uiApplication' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
private readonly Application _application;
/// <summary>
/// Initializes a new instance of the <see cref="UiApplication"/> class.
/// </summary>
public UiApplication(Application application)

Check warning on line 24 in src/Wpf.Ui/UiApplication.cs

GitHub Actions / build

Non-nullable field '_resources' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.

Check warning on line 24 in src/Wpf.Ui/UiApplication.cs

GitHub Actions / build

Non-nullable field '_mainWindow' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
{
_application = application;
}
/// 0x00000004. The szTip member is valid.
/// </summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x80)] // 128
public string szTip;

Check warning on line 116 in src/Wpf.Ui/Interop/Shell32.cs

GitHub Actions / build

Non-nullable field 'szTip' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
/// <summary>
/// The state of the icon. There are two flags that can be set independently.
public uint dwStateMask;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x100)] // 256
public string szInfo;

Check warning on line 128 in src/Wpf.Ui/Interop/Shell32.cs

GitHub Actions / build

Non-nullable field 'szInfo' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
/// <summary>
/// Prior to Vista this was a union of uTimeout and uVersion. As of Vista, uTimeout has been deprecated.
public uint uVersion; // Used with Shell_NotifyIcon flag NIM_SETVERSION.
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x40)] // 64
public string szInfoTitle;

Check warning on line 136 in src/Wpf.Ui/Interop/Shell32.cs

GitHub Actions / build

Non-nullable field 'szInfoTitle' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.
public uint dwInfoFlags;
_currentWindow =
System.Windows.Window.GetWindow(this) ?? throw new ArgumentNullException("Window is null");
_currentWindow.StateChanged += OnParentWindowStateChanged;

Check warning on line 455 in src/Wpf.Ui/Controls/TitleBar/TitleBar.cs

GitHub Actions / build

Nullability of reference types in type of parameter 'sender' of 'void TitleBar.OnParentWindowStateChanged(object sender, EventArgs e)' doesn't match the target delegate 'EventHandler' (possibly because of nullability attributes).
_currentWindow.ContentRendered += OnWindowContentRendered;
}