materialDesign版本是4.0
System.Windows.Markup.XamlParseException:““无法从文本“CombinedDialogOpenedEventHandler”创建“DialogOpenedAttached”。”,行号为“20”,行位置为“5”。”
ArgumentException: 无法绑定到目标方法,因其签名或安全透明度与委托类型的签名或安全透明度不兼容。
代码如下:
<StackPanel
Orientation="Horizontal">
<TextBlock
Text="{Binding Date, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
VerticalAlignment="Center"
FontSize="24" />
<Button
Margin="8 0 0 0"
Content="..."
Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}"无法绑定到目标方法,因其签名或安全透明度与委托类型的签名或安全透明度不兼容。
materialDesign:DialogHost.DialogOpenedAttached="CombinedDialogOpenedEventHandler"
materialDesign:DialogHost.DialogClosingAttached="CombinedDialogClosingEventHandler">
<Button.CommandParameter>
<Grid
Margin="-1">
<Grid.RowDefinitions>
<RowDefinition
Height="*" />
<RowDefinition
Height="Auto" />
</Grid.RowDefinitions>
<StackPanel
Grid.Row="0"
Orientation="Horizontal">
<Calendar
x:Name="CombinedCalendar"
Margin="-1 -4 -1 0" />
<materialDesign:Clock
x:Name="CombinedClock"
DisplayAutomation="CycleWithSeconds"
Is24Hours="True" />
</StackPanel>
<StackPanel
Grid.Row="1"
Margin="8"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
CommandParameter="0"
Style="{DynamicResource MaterialDesignFlatButton}">
CANCEL
</Button>
<Button
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
CommandParameter="1"
Style="{DynamicResource MaterialDesignFlatButton}">
OK
</Button>
</StackPanel>
</Grid>
</Button.CommandParameter>
</Button>
</StackPanel>
能否提供一个Demo