Answering your Question title:
how can I make a topmost checkbox WPF C#
As a Minimal, Reproducible Example the following would apparently work in the MainWindow code-behind of a newly created WPF project:
XAML:
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<CheckBox Checked="CheckBox_CheckedChanged"
Unchecked="CheckBox_CheckedChanged"/>
</Grid>
</Window>
MainWindow.CS:
using System.Windows;
using System.Windows.Controls;
namespace WpfApp1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void CheckBox_CheckedChanged(object sender, RoutedEventArgs e)
{
Topmost = ((CheckBox)sender).IsChecked == true;
}
}
}