OnApplyTemplate not called in Custom Control

前端 未结 6 2119
忘掉有多难
忘掉有多难 2021-02-01 21:47

I have a Custom Control which uses some PART controls:

 [TemplatePart(Name = \"PART_TitleTextBox\", Type = typeof(TextBox))]
    [TemplatePart(Name = \"PART_Titl         


        
6条回答
  •  半阙折子戏
    2021-02-01 22:31

    Answer of @MoMo is correct, but additionally:

    E: It is expected that the Themes/Generic.xaml is in the root of your project. If this is not the case and your Generic.xaml is not in the root then you have to create a directory Themes with Generic.xaml in the root (Generic.xaml is just of type ResourceDictionary). In that Generic.xaml you need to reference to the location of your Generic.xaml.

    e.g.:

提交回复
热议问题