I'm new to C#/Windows store apps development and I have a problem: I'm getting
The name "CustomTemplate1" does not exist in the namespace "using:QSTLibrary.WIN8"
I work on a project which has 2 libraries (one portable(without any GUI) and one platform specific(Win store apps)) and a startup project which is based on these 2 libs.
On the platform-specific library I want to add a templated control
, but when adding it using the add -> new item -> templated control
the Generic.xaml from the auto-generated "Themes" folder has the above error.
Here is Generic.xaml:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:QSTLibrary.WIN8">
<Style TargetType="local:CustomTemplate1"> //HERE IS THE PROBLEM !!!!
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:CustomTemplate1">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
Here is CustomTemplate1:
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
// The Templated Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234235
namespace QSTLibrary.WIN8
{
public sealed class CustomTemplate1 : Control
{
public CustomTemplate1()
{
this.DefaultStyleKey = typeof(CustomTemplate1);
}
}
}
QSTLibrary.WIN8 is the platform-specific library
Please help me with this issue.