Added playlist renaming functionality.
This commit is contained in:
@@ -27,4 +27,44 @@ public class WindowsMessageService : IMessageService
|
||||
|
||||
return result == ContentDialogResult.Primary;
|
||||
}
|
||||
|
||||
public async Task<string> InputTextAsync(string title, string message, string defaultText = "")
|
||||
{
|
||||
TextBox inputTextBox = new()
|
||||
{
|
||||
Text = defaultText,
|
||||
Margin = new Thickness(0, 10, 0, 0)
|
||||
};
|
||||
|
||||
inputTextBox.SelectAll();
|
||||
|
||||
ContentDialog dialog = new()
|
||||
{
|
||||
XamlRoot = MainWindow.Content.XamlRoot,
|
||||
Style = Application.Current.Resources["DefaultContentDialogStyle"] as Style,
|
||||
Title = title,
|
||||
Content = new StackPanel
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new TextBlock { Text = message },
|
||||
inputTextBox
|
||||
}
|
||||
},
|
||||
PrimaryButtonText = "OK",
|
||||
CloseButtonText = "Cancel",
|
||||
DefaultButton = ContentDialogButton.Primary
|
||||
};
|
||||
|
||||
ContentDialogResult result = await dialog.ShowAsync();
|
||||
|
||||
if (result == ContentDialogResult.Primary)
|
||||
{
|
||||
return inputTextBox.Text;
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user