CalendarDatePicker
弹出按钮上有阴影。该“效果”可能连接到承载控件的对话框。我附加了Dialog
的功能。你知道如何删除它吗?
private async void CreateNewDocumentDialog() {
// Creating dialoge window
var textBlock1 = new TextBlock
{
Text = "Kérem adja meg az alábbi adatokat!",
FontSize = 16
};
var docName = new TextBox
{
Name = "docName",
Margin = new Thickness(0, 10, 0, 10),
PlaceholderText = "Documentum neve"
};
var docValidUntil = new CalendarDatePicker
{
Header = "Dokumentum érvényessége:",
Date = DateTime.Now.AddYears(4),
};
var contentPanel = new StackPanel();
contentPanel.Children.Add(textBlock1);
contentPanel.Children.Add(docName);
contentPanel.Children.Add(docValidUntil);
ContentDialog CreateNewDocumentDialog = new ContentDialog
{
Content = contentPanel,
PrimaryButtonText = "Új bejegyzés létrehozása",
CloseButtonText = "Mégse",
// Default button responds to Enter
DefaultButton = ContentDialogButton.Primary
};
// Waiting for user input
ContentDialogResult result = await CreateNewDocumentDialog.ShowAsync();
if (result == ContentDialogResult.Primary)
{
// Process user input if Create New button pressed/activated
if (docName.Text != "")
{
var tempDate = docValidUntil.Date;
DocumentList.Add(new Document(docName.Text, tempDate.Value.DateTime));
}
}
else
{
// Exit dialog if Cancel button pressed
}
}