-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Description
I'm trying to define two custom controls in the app (not in a library), but it gives me this error:
In Resources/Styles.fayde I have two styles defining the template for two controls.
Note that if I remove MyControl2 style, it works, no error appears
Styles.fayde:
<Style TargetType="controls:MyControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:MyControl">
<Grid Background="Blue" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="controls:MyControl2">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:MyControl2">
<Grid Background="Green" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
The implementation is the same for both:
MyControl.ts:
import Control = Fayde.Controls.Control;
class MyControl extends Control {
constructor() {
super();
this.DefaultStyleKey = MyControl;
}
}
export = MyControl;
MyControl2.ts:
import Control = Fayde.Controls.Control;
class MyControl2 extends Control {
constructor() {
super();
this.DefaultStyleKey = MyControl2;
}
}
export = MyControl2;
In default.fap, I'm just using one control:
<controls:MyControl />
