gpt4 book ai didi

Wpf Material Design 日期时间选择器

转载 作者:行者123 更新时间:2023-12-04 10:52:42 26 4
gpt4 key购买 nike

我使用了代码下方的 XAML Toolkit 中的 Material Design 中的代码。

<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>

但是我有很多错误。我无法修复错误,因为我是 wpf 的新手。

错误:
Image of Errors

如何修复错误?

编辑 :
映射 materialDesign 前缀后,它给出了另一个错误:

“无法从文本‘CombinedDialogOpenedEventHandler’创建‘DialogOpenedAttached’。”行号“21”和行位置“48”。”

最佳答案

materialDesign前缀应该映射到 http://materialdesigninxaml.net/winfx/xaml/themes XAML 命名空间:

xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"

关于Wpf Material Design 日期时间选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59393324/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com