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

[WIP] MetroDialogs v4 #901

Merged
merged 8 commits into from
Jan 12, 2014
Merged

Conversation

AzureKitsune
Copy link
Member

Todo list

  • Remove SizeToContent stuff. I have no idea why that was there. See Window SizeToContent #881 because it was the temporary solution until I removed this.
  • Write a simple InputDialog. If you want more features, take the code and modify it to your needs.
  • Fix accented dialog's transparency.
  • RequestClose works for internal dialogs too. It is now called RequestCloseAsync.
  • Added UseAnimations property to disable the animations on dialogs. This does not affect the overlay animations.

FIXES #906

@robertstefan
Copy link

What does it bring new? :D

@AzureKitsune
Copy link
Member Author

@robertstefan Bug fixes of course. I am taking suggestions for new features! 😸

@robertstefan
Copy link

MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Accented;
await this.ShowMessageAsync("Application Error", "message_here");

gives this modal
accented_modal

MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Accented;
var dialog = (BaseMetroDialog) new LoginDialogModal();
await this.ShowMetroDialogAsync(dialog);

gives this modal
modal

What am I missing?

EDIT:
Just discovered by trial, that if i bind AccentColorBrush to the background of the control it works, but doesn't it kinda defeat the purpose of MetroDialogOptions.ColorScheme ?

@AzureKitsune
Copy link
Member Author

@robertstefan It is something you have to handle from inside of your custom dialogs. In the ProgressDialog and MessageDialog, I handled both cases already. You simply have to do the same.

See this line as an example.

@robertstefan
Copy link

Now that explains a lot why there was such a difference :)
Thanks @Amrykid

@AzureKitsune
Copy link
Member Author

@robertstefan No problem!

…h instead of AccentColorBrush (which has 80% transparency by design). If it ain't broken, don't fix it.
@robertstefan
Copy link

@Amrykid is there any method in the latest code from master branch that allows you to close the modal from within?

I mean, I open a modal from the main window, but in case I receive an error I want to close it and display the error message.
I have this code:

try
{
    Assembly = _driver.LoadAssembly(DatabaseConnector.SelectedValue.ToString());
    try
    {
        Connection = _driver.ExecComm(Assembly, DatabaseCommands.Connect, new Dictionary<string, dynamic>
            {
                {"user", DbUser.Text},
                {"host", DbHost.Text},
                {"password", ServerPassword.Password},
                {"enableMars", true}
            });
    }
    catch(Exception)
    {
        throw;
    }
}
catch(Exception)
{
    throw;
}

I gave it a try by passing the metrowindow as a parameter when I instantiate the modal :D but I don't think that's a good idea...

@AzureKitsune
Copy link
Member Author

@robertstefan I don't understand. Since this is not directly related to dialogs, could we take this to IRC? You can access it directly from your browser by clicking here and typing in a name and the capcha.

@AzureKitsune AzureKitsune mentioned this pull request Jan 5, 2014
15 tasks
AzureKitsune added a commit that referenced this pull request Jan 12, 2014
@AzureKitsune AzureKitsune merged commit e178127 into MahApps:master Jan 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants