我正在开发一个自定义控件,并希望在控件样式的 setter 中将两个依赖项属性传递给 Multi Converter。我的转换器启动,但值显示为 UnsetValues。
xmlns:custom="clr-namespace:WPFStyles.CustomControls"
xmlns:con="clr-namespace:WPFStyles.Converters">
<con:PopUpVisibilty x:Key="PopUpVisibility"/>
<Style TargetType="{x:Type custom:PopUpNotification}">
<Setter Property="MaxHeight" Value="150"/>
<Setter Property="MaxWidth" Value="250"/>
<Setter Property="Visibility">
<Setter.Value>
<MultiBinding Converter="{StaticResource PopUpVisibility}">
<Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type custom:PopUpNotification}}" Path="IsOpen"/>
<Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type custom:PopUpNotification}}" Path="Header"/>
</MultiBinding>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type custom:PopUpNotification}">
Run Code Online (Sandbox Code Playgroud)
关于如何正确传递这些属性的任何帮助都会很棒。
我正在构建一个包含将数据输入数据库的网页.我成功连接到我的数据库,我的插入查询正在向数据库中添加行,但表单数据没有通过,因此正在创建行(我已在phpmyadmin中看到它们)但是数据是空的.
我有两页.一个用于显示表单,另一个用于接收表单数据并运行sql查询.
这是表单网页的数据
<body>
<form action="insert.php" method=”post”>
Venue:
<input type="text" name = "venue">
<br>
Date:
<input type="text" name = "date">
<br>
Time:
<input type="text" name = "time">
<br>
Postcode:
<input type="text" name = "postcode">
<br>
<input type="submit" Value = "submit" name= "submit">
</form>
Run Code Online (Sandbox Code Playgroud)
这是我用于输入数据的代码.我没有包含数据库的连接代码,因为我没有遇到此问题.
$venue = $_POST['venue'];
$date = $_POST['date'];
$time = $_POST['time'];
$postcode = $_POST['postcode'];
$query = "INSERT into `event`(`eventVenue`, `eventDate`, `eventTime`,
`EventPostCode`) VALUES ( '$venue', '$date','$time', '$postcode' )";
mysqli_query($dbconn, $query);
<hr>
</body>
Run Code Online (Sandbox Code Playgroud)
Db连接:
$host="50.62.209.87"; // Host name
$username="************"; …Run Code Online (Sandbox Code Playgroud)