问题描述

宝塔面板安装php,消息盒子提示安装成功。

提示成功

但是,应用列表中并没有显示。查看日志,可以看到如下信息:

checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
make: * No targets specified and no makefile found.  Stop.
make: * No rule to make target 'install'.  Stop.

解决方案

ssh登陆服务器,执行如下命令,然后重新安装php即可成功安装。

apt-get install curl
apt-get install libcurl4-gnutls-dev

参考知乎 https://www.zhihu.com/question/325948326/answer/700753639

修正并简化后可分一下几步:

1、将如下内容另存为wt.reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
@="Windows Terminal Here"
"Extended"=""
"Icon"="C:\\Users\\Walt\\AppData\\Local\\terminal\\wt_32.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
@="C:\\Users\\Walt\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"

其中 "Extended"="" 为设置安装Shift右键才显示,如要直接右键即可显示,删除此项即可。
其中Walt为计算机用户名,请自行修改。

2、修改配置

0.5版本之前,如需在当前目录启动,还需要将配置中的startingDirectory项删除。
然而0.5版本之后,删除此项并不起作用,其运行目录仍在用户目录下。想要在当前目录下运行,需设置:

"startingDirectory": null

wpf获取某一属性的绑定信息

背景

WPF开发时,常常会将一些属性进行数据绑定,如某一控件A的宽高属性。然而,有些操作可能会覆盖掉该绑定,如全屏操作,基于一些原因,该操作需要手动修改控件宽高,这时,控件的绑定属性将失效,在取消全屏时,如不做处理,控件A的宽高将无法正常设置。

解决方案

全屏时,在需要手动设置控件A的宽高属性之前,手动保存宽高的绑定信息。

mb_height_multi = BindingOperations.GetMultiBindingExpression((_textbox as TextBox), EmbryologySlide.HeightProperty);

在取消全屏时,重新将宽高属性设置回绑定。

_textbox.SetBinding(TextBox.HeightProperty, mb_height_multi.ParentMultiBinding);

以上是以多条件绑定为例,如是单条件绑定,如下:

mb_height = BindingOperations.GetBindingExpression((_textbox as TextBox), EmbryologySlide.HeightProperty);
。。。
_textbox.SetBinding(TextBox.HeightProperty, mb_height?.ParentBinding);

其他操作

  • 获取Binding/MultiBinding

    MultiBindingExpression mbe = BindingOperations.GetMultiBindingExpression((child as TextBox), TextBox.TextProperty);
  • 拿到其中每个Binding的Path

    Binding bd = mbe.ParentMultiBinding.Bindings[0] as Binding;
    bindingPath = bd.Path.Path;
  • 拿到其中的ValidationRule

    ValidationRule vr = mbe.ParentMultiBinding.ValidationRules[0];
  • 更新MultiBinding

    mbe.UpdateSource();

总结

当然,大部分情况下,只要设计合理,类似全屏之类的操作,是不需要修改类似宽高之类的属性信息的。但一些特殊情况,如对自定义控件全屏,且全屏时,需要将控件移动至新窗体实现。此时若自定义控件高度绑定在了原窗体的数据或控件属性上。就需要用到本文方案了。