首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏dino.c的专栏

    [WPF]如何使用代码创建DataTemplate(或者ControlTemplate)

    使用FrameworkElementFactory FrameworkElementFactory用于以编程的方式创建模板,虽然文档中说不推荐,但WPF中常常使用这个类,例如DisplayMemberTemplateSelector FrameworkElementFactory text = new FrameworkElementFactory(typeof(TextBlock)); Binding binding = new 参考 FrameworkElementFactory XamlWriter XamlWriter and Bindings Serialization TypeConverter TypeDescriptor

    2.5K20发布于 2019-01-17
  • 来自专栏dino.c的专栏

    [WPF]如何使用代码创建DataTemplate(或者ControlTemplate)

    使用FrameworkElementFactory FrameworkElementFactory用于以编程的方式创建模板,虽然文档中说不推荐,但WPF中常常使用这个类,例如DisplayMemberTemplateSelector FrameworkElementFactory text = new FrameworkElementFactory(typeof(TextBlock)); Binding binding = new 参考 FrameworkElementFactory XamlWriter XamlWriter and Bindings Serialization TypeConverter TypeDescriptor

    2.4K80发布于 2019-01-18
  • 来自专栏林德熙的博客

    WPF 应用启动过程同时启动多个 UI 线程且访问 ContentPresenter 可能让多个 UI 线程互等

    等方法,如下代码 static ContentPresenter() { DataTemplate template; FrameworkElementFactory CreateAccessTextFactory() { FrameworkElementFactory text = new FrameworkElementFactory (typeof(AccessText)); return text; } 在 CreateAccessTextFactory 创建的 FrameworkElementFactory 对象的构造函数代码如下,在构造函数将会给 FrameworkElementFactory.Type 属性赋值 public FrameworkElementFactory(Type type , string name) { Type = type; Name = name; } 然而 FrameworkElementFactory.Type

    91810编辑于 2022-08-12
  • 来自专栏一路走一路失去也一路拥有

    WPF窗体中控件移动 + 拖拽大小 + 动画拖动

    WireDiameter">线径</param> /// <param name="Opacity">透明度</param> /// <returns></returns> FrameworkElementFactory GetFactory(Brush InnerColor, Brush OuterColor, double WireDiameter) { FrameworkElementFactory Element = new FrameworkElementFactory(typeof(Ellipse)); //绘制椭圆形元素 Element.SetValue(Ellipse.FillProperty

    2.7K40编辑于 2022-05-31
  • 来自专栏一路走一路失去也一路拥有

    【NEW】WPF窗体中控件移动 + 拖拽大小 + 动画拖动

    WireDiameter">线径</param> /// <param name="Opacity">透明度</param> /// <returns></returns> FrameworkElementFactory GetFactory(Brush InnerColor, Brush OuterColor, double WireDiameter) { FrameworkElementFactory Element = new FrameworkElementFactory(typeof(Ellipse)); //绘制椭圆形元素 Element.SetValue(Ellipse.FillProperty

    2.9K40编辑于 2022-06-09
  • 来自专栏walterlv - 吕毅的博客

    WPF 很少人知道的科技

    比如在代码中创建 DataTemplate,主要会使用到 FrameworkElementFactory 类型。

    87920编辑于 2023-10-22
  • 来自专栏huofo's blog

    WPF源代码分析系列一:剖析WPF模板机制的内部实现(一)

    简而言之,这个方法的流程有三个分支:1)如果一个FrameworkTemplate的_templateRoot字段(FrameworkElementFactory类型)不为空,则调用其_templateRoot.InstantiateTree

    1.5K20编辑于 2022-03-17
  • 来自专栏walterlv - 吕毅的博客

    WPF 中的 NameScope

    dependencyObject.GetValue(NameScopeProperty)); } 同样实现了此接口的还有 TemplateNameScope,此 NameScope 会被 FrameworkTemplate / FrameworkElementFactory

    1.2K20发布于 2020-02-10
  • 来自专栏walterlv - 吕毅的博客

    WPF 中那些可跨线程访问的 DispatcherObject(WPF Free Threaded Dispatcher Object)

    frameworkTemplate, ref bool isSealed, FrameworkElementFactory

    1.4K20发布于 2020-02-10
领券