hercool
جمعه 27 دی 1392, 19:16 عصر
سلام دوستان
من یه مشکل در CollectionViewSource دارم
اونم اینه که نمی تونم CollectionViewSource بایندینگ کنم
این ارور رو میده
The name "DarokhanehDataSource" does not exist in the namespace "using:main_project.DataModel".
کلاس داروخانه ای که نوشتم رو اینجا میزارم
این کدی هست که من به عنوان ریسورس page در نظر گرفتم
<Page.Resources>
<!--
Collection of grouped items displayed by this page, bound to a subset
of the complete item list because items in groups cannot be virtualized
-->
<CollectionViewSource
x:Name="groupedItemsViewSource"
d:Source="{Binding AllDataDoctor ,Source={d:DesignInstance Type=data:DarokhanehDataSource,IsDesignTimeCreatab le=True}}"/>
</Page.Resources>
و این هم قسمت فضا های نامیش هست
<Page
x:Name="pageRoot"
x:Class="main_project.page_datadoctor"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:main_project"
xmlns:data="clr-namespace:main_project.DataModel"
xmlns:common="using:main_project.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
چون نمیشه بیشتر از 30000 کارکتر باشه خلاصه کلاس رو میزارم
public class DataDoctor :main_project.common.BindableBase
{
private string _CodeNezamDoctore;
private string _NameDoctor;
private string _Tkhasos;
public string CodeNezamDoctore
{
get
{
return this._CodeNezamDoctore;
}
set
{
// _Nationalcode = Nationalcode;
this.SetProperty(ref this._CodeNezamDoctore, value);
}
}
public string NameDoctor
{
get
{
return this._NameDoctor;
}
set
{
// _Nationalcode = Nationalcode;
this.SetProperty(ref this._NameDoctor, value);
}
}
public string Tkhasos
{
get
{
return this._Tkhasos;
}
set
{
// _Nationalcode = Nationalcode;
this.SetProperty(ref this._Tkhasos, value);
}
}
public DataDoctor(string CodeNezamDoctore, string NameDoctor, string Tkhasos)
{
this._CodeNezamDoctore = CodeNezamDoctore;
this._NameDoctor = NameDoctor;
this._Tkhasos = Tkhasos;
}
public DataDoctor()
{
}
}
private static DarokhanehDataSource _DarokhanehDataSource = new DarokhanehDataSource();
////////////////////////////////////////////////// ////////////////////////////////////////////////////////
//****************** *************************************
/* ساخت فیلد هاو پروپرتی ها */
// برای کلاس پزشک هست
//
private ObservableCollection<DataDoctor> _AllDataDoctor = new ObservableCollection<DataDoctor>();
public ObservableCollection<DataDoctor> AllDataDoctor
{
get
{
return this._AllDataDoctor;
}
}
public static DataDoctor GetDataNameDoctor(string NameDoctor)
{
var matches = _DarokhanehDataSource._AllDataDoctor.Where((NameDo ctorr) => NameDoctorr.NameDoctor.Equals(NameDoctor));
if (matches.Count() == 1) return matches.First();
return null;
}
من یه مشکل در CollectionViewSource دارم
اونم اینه که نمی تونم CollectionViewSource بایندینگ کنم
این ارور رو میده
The name "DarokhanehDataSource" does not exist in the namespace "using:main_project.DataModel".
کلاس داروخانه ای که نوشتم رو اینجا میزارم
این کدی هست که من به عنوان ریسورس page در نظر گرفتم
<Page.Resources>
<!--
Collection of grouped items displayed by this page, bound to a subset
of the complete item list because items in groups cannot be virtualized
-->
<CollectionViewSource
x:Name="groupedItemsViewSource"
d:Source="{Binding AllDataDoctor ,Source={d:DesignInstance Type=data:DarokhanehDataSource,IsDesignTimeCreatab le=True}}"/>
</Page.Resources>
و این هم قسمت فضا های نامیش هست
<Page
x:Name="pageRoot"
x:Class="main_project.page_datadoctor"
DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:main_project"
xmlns:data="clr-namespace:main_project.DataModel"
xmlns:common="using:main_project.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
چون نمیشه بیشتر از 30000 کارکتر باشه خلاصه کلاس رو میزارم
public class DataDoctor :main_project.common.BindableBase
{
private string _CodeNezamDoctore;
private string _NameDoctor;
private string _Tkhasos;
public string CodeNezamDoctore
{
get
{
return this._CodeNezamDoctore;
}
set
{
// _Nationalcode = Nationalcode;
this.SetProperty(ref this._CodeNezamDoctore, value);
}
}
public string NameDoctor
{
get
{
return this._NameDoctor;
}
set
{
// _Nationalcode = Nationalcode;
this.SetProperty(ref this._NameDoctor, value);
}
}
public string Tkhasos
{
get
{
return this._Tkhasos;
}
set
{
// _Nationalcode = Nationalcode;
this.SetProperty(ref this._Tkhasos, value);
}
}
public DataDoctor(string CodeNezamDoctore, string NameDoctor, string Tkhasos)
{
this._CodeNezamDoctore = CodeNezamDoctore;
this._NameDoctor = NameDoctor;
this._Tkhasos = Tkhasos;
}
public DataDoctor()
{
}
}
private static DarokhanehDataSource _DarokhanehDataSource = new DarokhanehDataSource();
////////////////////////////////////////////////// ////////////////////////////////////////////////////////
//****************** *************************************
/* ساخت فیلد هاو پروپرتی ها */
// برای کلاس پزشک هست
//
private ObservableCollection<DataDoctor> _AllDataDoctor = new ObservableCollection<DataDoctor>();
public ObservableCollection<DataDoctor> AllDataDoctor
{
get
{
return this._AllDataDoctor;
}
}
public static DataDoctor GetDataNameDoctor(string NameDoctor)
{
var matches = _DarokhanehDataSource._AllDataDoctor.Where((NameDo ctorr) => NameDoctorr.NameDoctor.Equals(NameDoctor));
if (matches.Count() == 1) return matches.First();
return null;
}