Why does overriding the WPF [removed] method fail to draw to the screen?

后端 未结 4 1799
面向向阳花
面向向阳花 2021-02-08 00:02

I noticed that when overriding the System.Windows.Window OnRender method fails to draw to the screen. I\'m sure there\'s a good reason for this but was unable to find the explan

4条回答
  •  梦谈多话
    2021-02-08 00:17

    just as a check, does the snippet work with the dc.Draw... lines removed (i.e. is it the act of overriding or the additional draw commands that cause the issue)?

    I found a link that suggests that simply re-ordering the calls may solve the issue (i.e. doing the dc.Draw... calls before calling base.OnRender(dc)).

    http://www.codeproject.com/Messages/3356653/Override-OnRender-class-inherits-frameworkelement.aspx

提交回复
热议问题