jswigart
Topic Author
Posts: 12
Joined: 14 Mar 2019, 02:35

Can't get a simple control template to work

25 Jun 2019, 02:05

I filed a bug https://www.noesisengine.com/bugs/view.php?id=1507

But what I'm trying to do is do some pretty basic stuff to learn XAML and Noesis. I've got a unity project where I am experimenting with mocking up a UI in blend and testing it in Unity. Just as I started to try and make some control templates to start making some reusable components, I start to run into an issue where a style/template that works fine in Blend refuses to work in Noesis and I don't understand why. I'm not getting any errors in Noesis.

Basically I have the following template
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MapMakerUI">

<Style x:Key="SingleSelection" TargetType="{x:Type local:RadioToggleButton}">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Button Width="100" Height="100" Background="{DynamicResource Image_Wait}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
The class is very simply
namespace MapMakerUI
{ class RadioToggleButton : RadioButton
{

}
}
And I have them in a WrapPanel like so
<local:RadioToggleButton Style="{DynamicResource SingleSelection}"/>
As the screenshots show, they work fine in Blend, showing my placeholder clock icon on large 100x100 buttons, but when I load this same Xaml in Unity, they show up as simple radio buttons with no warnings or anything.

Blend
blend.png
Unity
unity.JPG
 
User avatar
sfernandez
Site Admin
Posts: 1920
Joined: 22 Dec 2011, 19:20

Re: Can't get a simple control template to work

25 Jun 2019, 10:59

I answered in the bug #1507, could you please confirm it solves the problem?

Who is online

Users browsing this forum: No registered users and 0 guests