Use the declared [TemplatePart] type
ProprietaryFlags a GetTemplateChild result cast to a type that contradicts the Type of the [TemplatePart] declaring that part, including the case where the attribute declares no type at all.
OpenRewrite. Recipes. CSharp. CodeQuality. Wpf. RequireCorrectTemplatePartTypemod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Wpf. RequireCorrectTemplatePartTypeInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.