上一篇Popup Bug中修改了SystemParameters类中静态只读属性MenuDropAlignment。

Type.GetField 反射修改类中私有静态字段。

                var t = typeof(SystemParameters);
                var field = t.GetField("_menuDropAlignment", BindingFlags.NonPublic | BindingFlags.Static);
                field.SetValue(null, false);

  其中 _menuDropAlignment 为SystemParameters中的静态 私有字段。通过Type.GetField反射出该字段并进行修改。。

  

     这样SystemParameters类中的只读属性就得到了修改

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
  • 2022-01-08
  • 2022-02-25
  • 2022-01-21
猜你喜欢
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
相关资源
相似解决方案