I've an xaml code in which I've used DataTemplateSelector.But it shows me namespace error.Code behind for it is written inside "TimeSheet.Views.DataTemplate" namespace and xaml code is written in "TimeSheet.Views" namespace.How should I write namespace for it?
outline of my xaml code is:
<Controls:MetroWindow
x:Name="MainWin"
x:Class="TimeSheet.DayView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:TimeSheet.Views.DataTemplateSpace"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="DayView" Width="590" Height="590">
<l:DayViewListDataTemplateSelector x:Key="templateSelector"
DefaultDataTemplate="{StaticResource DefaultDataTemplate}"
EditableDataTemplate="{StaticResource EditableDataTemplate}"/>
Code Behind for it is,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows;
//using System.Windows.DependencyProperty;
//using System.ComponentModel.DependencyPropertyDescriptor;
using HarvestApp;
namespace TimeSheet.Views.DataTemplateSpace
{
public class DayViewListDataTemplateSelector : DataTemplateSelector
{
public DataTemplate DefaultDataTemplate { get; set; }
public DataTemplate EditableDataTemplate { get; set; }
//public DataTemplate EnumDataTemplate { get; set; }
public override DataTemplate SelectTemplate(object item,DependencyObject container)
{
//some code
}
}
}