punker76 on develop
Update README.md (compare)
punker76 on develop
Merge branch 'develop' into main Fix using NuGetKeyVaultSignTool (compare)
punker76 on 2.0.0
punker76 on main
Fix using NuGetKeyVaultSignTool (compare)
punker76 on main
Fix using NuGetKeyVaultSignTool (compare)
punker76 on main
(GH-80) Drop targeting to frame… Update appveyor script Change all to new csproj format and 45 more (compare)
punker76 on develop
Update CI build and dependencies (compare)
punker76 on develop
Update CI build and dependencies (compare)
Car.carPaint paint = new Car.carPaint();
await ((MetroWindow)Application.Current.MainWindow).ShowChildWindowAsync(paint);
and works everything good, but I wish do some code when the child window will be closed... how can I do? if I add some code below, with the await
is executed after the ShowChildWindow
is called
public delegate void ChildIsClosedEventHandler();
public event ChildIsClosedEventHandler ChildIsClosedEvent;
private void ChildWindow_ClosingFinished(object sender, RoutedEventArgs e)
{
if (ChildIsClosedEvent != null)
{
ChildIsClosedEvent();
}
}
SimpleChildWindow
and IsModal
property. When I use MessageBox.Show()
, the parent window is not reacheable, not even exit button. When I use SimpleChildWindow
with IsModal
property set to true
, I can use all buttons from title bar. Is any way to get the same behaviour of MessageBox
?
OverlayFillBehavior
to FullWindow
Hello again, I'm back with another question, I want Window.ShowDialog()
like behaviour, is it posible?
private async void ConnectClick(object sender, RoutedEventArgs e)
{
if (this.connectWindow == null)
{
this.connectWindow = new ConnectWindow();
this.connectWindow.UserLoggedIn += ConnectWindowUserLoggedIn;
}
//this.connectWindow.ShowDialog();
await this.ShowChildWindowAsync(this.connectWindow, ChildWindowManager.OverlayFillBehavior.FullWindow);
if (this.connectWindow.SuccessfulResult)
{
this.connect();
}
}
With Window.ShowDialog()
I wait until close the window and then I check SuccessfulResult property to know if I can connect or not. With SimpleChildWindow.ShowChildWindowAsync()
, it doesn't wait until close the window to check the property.
I have changed the code:
private async void ConnectClick(object sender, RoutedEventArgs e)
{
if (this.connectWindow == null)
{
this.connectWindow = new ConnectWindow();
this.connectWindow.UserLoggedIn += this.ConnectWindowUserLoggedIn;
this.connectWindow.ClosingFinished += this.ConnectWindowClosingFinished;
}
await this.ShowChildWindowAsync(this.connectWindow, ChildWindowManager.OverlayFillBehavior.FullWindow);
}
private void ConnectWindowClosingFinished(object sender, RoutedEventArgs e)
{
if (this.connectWindow.SuccessfulResult)
{
this.connect();
}
}
Now I can get the SuccessfulResult
property when the SimpleChildWindow
is closed.
Hello, I've noticed that the ChildWindow closes when I press the ESC key. Is there any way to avoid it? I've tried with this code, but it is useless:
public MyChildWindow()
{
InitializeComponent();
this.KeyDown += this.MyChildWindow_KeyDown;
}
private void MyChildWindow_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
e.Handled = true;
}
The e.Handled = true;
is executed but the window closes.
Hello, I have a question about ShowMessageAsync()
method, using it when a SimpleChildWindow
is shown. In my child window I have a property to save the main window (MetroWindow
):
public MainWindow ParentWindow { get; set; }
Then when I need to show the dialog I call it like this:
this.ParentWindow.ShowMessageAsync(title, message);
The problem is that the visual effect (dark background) only affects to the main windows, the child window is white so the dialog and child window are indistinguishable visually. Are there any plans to improve this?