Comments (2)
var window = new InputWindow
{
Title = "title",
Prompt = "Hi, test native owner window",
Response = "",
Result = Results.Cancel,
ShowInTaskbar = false,
};
window.Owner = this;
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
window.ShowDialog();
this above will open a modal dialog to freeze both two window.
So using the native func ShowDialog
to show a windows will freeze all of the windows.
Then I noted WindowManager.ShowMessageBox
based on native ShowDialog
.
That's the reason why WindowManager.ShowMessageBox
freeze my two windows.
@canton7 can we make WindowManager.ShowMessageBox
a same behaviour like native MessageBox.Show
?
from stylet.
I have find a workaround for this ticket. I will make a PR for this latter.
var mbvm = new MessageBoxViewModel();
mbvm.Setup("Hi, test stylet message box");
if (IoC.Get<IViewManager>().CreateAndBindViewForModelIfNecessary(mbvm) is Window window)
{
window.Owner = this;
window.Loaded += (o, args) =>
{
var dlgWindow = o as Window;
// dlg don't have a Owner
if(dlgWindow?.Owner == null)
return;
var windows = Application.Current.Windows;
// enable the window != Owner
foreach (Window w in windows)
{
if (w == dlgWindow.Owner) continue;
if (w is { IsLoaded: true })
{
if (HwndSource.FromVisual(w) is HwndSource hwndSource)
EnableWindow(hwndSource.Handle, true);
}
}
};
window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
window.ShowDialog();
}
from stylet.
Related Issues (20)
- Unable to use Style in xaml
- Built-in message box button text clips HOT 1
- Documentation correction
- EventAggregator shouldn't call handlers from within a lock
- when TabControl and Frame are used,viewmodel do not carry out HOT 1
- OnInitialActivate does not get called in "Child" Screen
- Using MicrosoftDependencyInjectionBootstrapper runtime errors
- How to ignore StyletIoCFindConstructorException
- About button binding HOT 1
- NRE in design mode with MahApps HamburgerMenu control
- Cannot open a new discussion! HOT 3
- ClassLibrary Start Stylet It is necessary!
- ShowMessageBox MessageBoxButtons.YesNo disabling the Esc key and Window "X" close functionality
- BindableCollection races against any call which adds/removes elements before it
- System.Text.Json Json serialization / deserialization fails HOT 5
- Binding an abstract type which has an abstract inheritor ToAllImplementations causes StyletIoCRegistrationException
- Conductor.OnActivate() shoudl not be required to call base.OnActivate() HOT 4
- referencing grpc.net.client in the project, error CS0234 is reported. HOT 1
- I have a class ScreenEx that inherits from Screen, rewriting OnActivate in a new ViewModel that is unresponsive HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stylet.