Window becomes inactive after DialogHost.Show()
メンテナーはふだん 1 日以内に返信
@MichelMichels がすでに取り組んでいます。
2024年3月31日 から。
評価
この issue はまだ評価されていません。
説明
Bug explanation
I'm trying to make a preloader using DialogHost (I need to display a loading indicator and lock the application while the data is being loaded)
However, when I call DialogHost.Show(), the application window loses focus
5.0.1-ci571:
if you click on a dialog, the window will become active again along with the dialog.
so they are not mutually exclusive
In my past project I used version 4.6.1 and the window did not lose focus when DialogHost was opened
I tried different versions in the current project:
- 4.10.0-ci317 everything works perfectly
- 5.0.0-ci321 this bug appears
4.10.0-ci317:
How can this be fixed without downgrading to an older version?
My code:
PreloaderDialog
<UserControl x:Class="Client.View.Dialogs.PreloaderDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d">
<ProgressBar Width="24"
Height="24"
Margin="16"
IsIndeterminate="True"
Style="{StaticResource MaterialDesignCircularProgressBar}"
Value="33" />
</UserControl>
MainWindow
<Window x:Class="Client.View.Windows.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:controls="clr-namespace:Client.View.Controls"
mc:Ignorable="d"
Title="FriendSync"
Height="500" Width="540"
WindowStartupLocation="CenterScreen">
<materialDesign:DialogHost
Identifier="RootDialog"
DialogTheme="Inherit"
Loaded="DialogHost_OnInitialized">
...
</materialDesign:DialogHost>
</Window>
Method to show preloader
public static async Task DoWithPreloader(Action action, string host = DIALOG_ROOT) {
var dialog = new PreloaderDialog();
if (DialogHost.IsDialogOpen(host)) {
try {
DialogHost.Close(host);
} catch (Exception) {
// ignored
}
}
await DialogHost.Show(dialog, host, new DialogOpenedEventHandler((_, args) => {
action();
try {
if (!args.Session.IsEnded) {
args.Session.Close(false);
}
} catch (Exception) {
// ignored
}
}));
}
Calling code
DialogUtils.DoWithPreloader(() => {
// some time-consuming code
});
Version
5.0.1-ci571
- 主要言語
- C#
- スター
- 16.3k
- フォーク
- 3.5k
- 平均マージ
- 4時間 25分
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MaterialDesignInXAML/MaterialDesignInXamlToolkit のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4124 ·
メンテナーはふだん 1 日以内に返信
-
MaterialDesignChoiceChipListBoxItem missing 'Path=Name' in GroupName binding causes selection conflict between ListBoxes対応中かも @corvinsz が 12 日前に担当しました。 オープンbug evaluation required
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4118 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#2485 ·
メンテナーはふだん 1 日以内に返信
-
enhancement evaluation required
難易度 3/5 半日 初心者へのやさしさ 30/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4120 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add Semantic, Theme-Aware Colors対応中かも @corvinsz が 22 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4114 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
MaterialDesignInXAML/MaterialDesignInXamlToolkit の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
a-corriger documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
christian-raj/S-Aloha#312 ·
-
ready-for-agent tech-debt
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
DigiBanks99/menlo#640 ·
メンテナーはふだん 1 日以内に返信
-
ci
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
OpenTabletDriver/OpenTabletDriver#5283 ·
メンテナーはふだん 3 日以内に返信
-
area / templates
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
bitfoundation/bitplatform#15109 ·
メンテナーはふだん 1 日以内に返信