-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Templated Control doesn't appear #6475
Comments
Have you included style from "axaml" in your app? With StyleInclude. |
@maxkatz6 Thanks that was it. For anyone else:
|
Today, 2024 with Avalonia 11.1.0 the template for Templated control does not use <Style> anymore. See Problem using TemplatedControl #16447. <Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="/Controls/TemplatedControl1.axaml"/>
</ResourceDictionary.MergedDictionaries>
. . .
</ResourceDictionary>
</Application.Resources> |
Not working here with
I get this error:
I followed the custom templated control example from here, just the difference being the control existing in another assembly. Btw, in Rider, the Right-click > New > Templated Control still creates a control using the 'Styles' xaml. |
You need to specify assembly then. If "MyApp.Controls" is the name of your assembly, then: <ResourceInclude Source='avares://MyApp.Controls/Themes/ExtendedButton.axaml' /> This doc is about assets, but we use the same URI syntax for resources as well: |
I'm trying to create a TemplatedControl for the first time, but it just doesn't appear. Any ideas what I am doing wrong?
axaml:
axaml.cs:
Main window:
The text was updated successfully, but these errors were encountered: