C# 错误消息错误 ;5 ;模棱两可
在这里,我收到以下错误消息: 错误5之间的歧义 'OPTFDashboard.Common.Modules.CNAAll.ViewModels.CNAAllViewModel.Shift' 和 'OPTFDashboard.Common.Modules.CNAAll.ViewModels.CNAAllViewModel.Shift'C:\OPTFDashboard\Common\Modules\CNAAll\ViewModels\CNAAllViewModel.cs 34 117 Common 我正在尝试绑定所选的护士班次(日、夜、全部),以刷新根据此选项显示的数据C# 错误消息错误 ;5 ;模棱两可,c#,wpf,mvvm,C#,Wpf,Mvvm,在这里,我收到以下错误消息: 错误5之间的歧义 'OPTFDashboard.Common.Modules.CNAAll.ViewModels.CNAAllViewModel.Shift' 和 'OPTFDashboard.Common.Modules.CNAAll.ViewModels.CNAAllViewModel.Shift'C:\OPTFDashboard\Common\Modules\CNAAll\ViewModels\CNAAllViewModel.cs 34 117 Common
using System;
using System.Collections.ObjectModel;
using System.ComponentModel.Composition;
using System.Windows.Data;
using OPTFDashboard.Common.Modules.CNABathing.DataAccess;
using OPTFDashboard.Common.Ribbon;
using OPTFDashboard.Common.Utility;
using OPTFDashboard.DataModel;
using OPTFDashboard.ViewModel;
using OPTFDashboard.Common.Modules.CNAAll.DataAccess;
namespace OPTFDashboard.Common.Modules.CNAAll.ViewModels
{
[Export]
class CNAAllViewModel : TabViewModel, ISelectedContentTab
{
private readonly String[] _shift = new String[] { "ALL", "DAY", "EVE", "NIGHT" };
public CNAAllViewModel()
: base()
{
DisplayName = "All CNA";
StartDate = DateTime.Now.AddMonths(-3);
EndDate = DateTime.Now.AddDays(19);
GroupDataCollection = new ObservableCollection<GroupData>()
{
RibbonControlHelper.CreateFacilitySelection()
, new GroupData("Criterria"
, RibbonControlHelper.CreateDateSelection(StartDate,EndDate,(s, e) => { StartDate = s; EndDate = e; RefreshData(); })
, RibbonControlHelper.CreateUnitSelection(UnitChanged)
, RibbonControlHelper.CreateComboBox("Shift", "Shift", "Select Shift to show.", _shift, (type) => { Shift = type; })
)
};
}
private string Shift;
private DateTime startDate;
public DateTime StartDate
{
get { return startDate; }
set { startDate = value; }
}
private DateTime endDate;
public DateTime EndDate
{
get { return endDate; }
set { endDate = value; }
}
public ObservableCollection<GroupData> GroupDataCollection { get; private set; }
private String UnitCode { get; set; }
private void UnitChanged(Unit unit)
{
UnitCode = unit == null ? "" : unit.Description;
RefreshData();
}
protected override void RefreshData()
{
if (FacilitiesAreChanging) { return; }
Loading = true;
// this is the details section.
// Load CNABathing
CNAAllRepository.DetailedCNABathing(FacilitySelectionService.SelectedFacilities, StartDate, EndDate, UnitCode,
(cnabathingdetails) =>
{
var data = new ListCollectionView(cnabathingdetails);
data.GroupDescriptions.Add(new PropertyGroupDescription("FACILITY_KEY"));
data.GroupDescriptions.Add(new PropertyGroupDescription("UNIT"));
DataCNABathing = data;
});
CNAAllRepository.DetailedCNABowel(FacilitySelectionService.SelectedFacilities, startDate, endDate, UnitCode,
(cna) =>
{
var data = new ListCollectionView(cna);
data.GroupDescriptions.Add(new PropertyGroupDescription("FACILITY_KEY"));
data.GroupDescriptions.Add(new PropertyGroupDescription("UNIT"));
DataCNABowel = data;
});
CNAAllRepository.DetailedCNAIntakeVSOutput(FacilitySelectionService.SelectedFacilities, StartDate, EndDate, UnitCode,
(CNAIntakeVSOutputDetails) =>
{
var data = new ListCollectionView(CNAIntakeVSOutputDetails);
data.GroupDescriptions.Add(new PropertyGroupDescription("FACILITY_KEY"));
data.GroupDescriptions.Add(new PropertyGroupDescription("UNIT"));
DataCNAIntakeVSOutput = data;
});
CNAAllRepository.DetailedCNAPoorEating((FacilitySelectionService.SelectedFacilities), startDate, endDate, UnitCode, "0",
(cnaPoorEatingDetail) =>
{
var data = new ListCollectionView(cnaPoorEatingDetail);
data.GroupDescriptions.Add(new PropertyGroupDescription("UNIT"));
DataCNAPoorEating = data;
});
Loading = false;
}
private ListCollectionView _DataCNABathing;
public ListCollectionView DataCNABathing
{
get { return _DataCNABathing; }
set { this.SetReferenceProperty("DataCNABathing", ref _DataCNABathing, value); }
}
private ListCollectionView _DataCNABowel;
public ListCollectionView DataCNABowel
{
get { return _DataCNABowel; }
set { this.SetReferenceProperty("DataCNABowel", ref _DataCNABowel, value); }
}
private ListCollectionView _DataCNAIntakeVSOutput;
public ListCollectionView DataCNAIntakeVSOutput
{
get { return _DataCNAIntakeVSOutput; }
set { this.SetReferenceProperty("DataCNAIntakeVSOutput", ref _DataCNAIntakeVSOutput, value); }
}
private ListCollectionView _DataCNAPoorEating;
public ListCollectionView DataCNAPoorEating
{
get { return _DataCNAPoorEating; }
set { this.SetReferenceProperty("DataCNAPoorEating", ref _DataCNAPoorEating, value); }
}
// here we will put the shift pulldown :
private String _Type;
private String Shift
{
get { return _Type; }
set { if (this.SetReferenceProperty("Shift", ref _Type, value)) { RefreshData(); } }
}
}
}
使用系统;
使用System.Collections.ObjectModel;
使用System.ComponentModel.Composition;
使用System.Windows.Data;
使用OPTFDashboard.Common.Modules.cnabayout.DataAccess;
使用OPTFDashboard.Common.Ribbon;
使用OPTFDashboard.Common.Utility;
使用OPTFDashboard.DataModel;
使用OPTFDashboard.ViewModel;
使用OPTFDashboard.Common.Modules.CNAAll.DataAccess;
命名空间OPTFDashboard.Common.Modules.CNAAll.ViewModels
{
[出口]
类CNAAllViewModel:TabViewModel,ISelectedContentTab
{
private readonly String[]_shift=new String[]{“ALL”、“DAY”、“EVE”、“NIGHT”};
公共CNAAllViewModel()
:base()
{
DisplayName=“所有CNA”;
StartDate=DateTime.Now.AddMonths(-3);
EndDate=DateTime.Now.AddDays(19);
GroupDataCollection=新的ObservableCollection()
{
RibbonControlHelper.CreateFacilitySelection()
,新的GroupData(“Criteria”
,RibbonControlHelper.CreateDateSelection(StartDate,EndDate,(s,e)=>{StartDate=s;EndDate=e;RefreshData();})
,RibbonControlHelper.CreateUnitSelection(UnitChanged)
,RibbonControlHelper.CreateComboBox(“Shift”,“Shift”,“选择要显示的Shift.”,_Shift,(type)=>{Shift=type;})
)
};
}
私有字符串移位;
私有日期时间起始日期;
公共日期时间起始日期
{
获取{return startDate;}
设置{startDate=value;}
}
私有日期时间结束日期;
公共日期时间结束日期
{
获取{return endDate;}
设置{endDate=value;}
}
公共ObservableCollection GroupDataCollection{get;private set;}
私有字符串单位代码{get;set;}
私有无效单位已更改(单位)
{
UnitCode=unit==null?“:unit.Description;
刷新数据();
}
受保护的覆盖无效刷新数据()
{
如果(设施更换){return;}
加载=真;
//这是细节部分。
//装货
CNAAllRepository.DetailedCNABathing(设施选择服务。所选设施、开始日期、结束日期、单位代码、,
(cnabathingdetails)=>
{
var数据=新的ListCollectionView(cnabathingdetails);
data.GroupDescriptions.Add(新的PropertyGroupDescription(“FACILITY_KEY”));
data.groupdescription.Add(新属性groupdescription(“单位”);
DATACNABATING=数据;
});
CNAAllRepository.DetailedCNABowel(设施选择服务。选择的设施、开始日期、结束日期、单位代码、,
(cna)=>
{
var数据=新的ListCollectionView(cna);
data.GroupDescriptions.Add(新的PropertyGroupDescription(“FACILITY_KEY”));
data.groupdescription.Add(新属性groupdescription(“单位”);
DataCNABowel=数据;
});
CNAAllRepository.DetailedCNAIntakeVSOutput(设施选择服务。所选设施、开始日期、结束日期、单位代码、,
(CNAIntakeVSOutputDetails)=>
{
var数据=新的ListCollectionView(CNAIntakeVSOutputDetails);
data.GroupDescriptions.Add(新的PropertyGroupDescription(“FACILITY_KEY”));
data.groupdescription.Add(新属性groupdescription(“单位”);
DataCNAIntakeVSOutput=数据;
});
CNAAllRepository.detailedCNaPoreating((FacilitySelectionService.SelectedFacilities),开始日期,结束日期,单位代码,“0”,
(CNAPOREATINGDETAIL)=>
{
var数据=新的ListCollectionView(CNAPoreatingDetail);
data.groupdescription.Add(新属性groupdescription(“单位”);
DATACNAPOREATING=数据;
});
加载=假;
}
私有ListCollectionView_数据备份;
public ListCollectionView数据收集
{
获取{return\u datacnabaying;}
set{this.SetReferenceProperty(“DataCNABathing”,ref_DataCNABathing,value);}
}
私有ListCollectionView_DataCNABowel;
public ListCollectionView DataCNABowel
{
获取{return\u DataCNABowel;}
set{this.SetReferenceProperty(“DataCNABowel”,ref_DataCNABowel,value);}
}
私有ListCollectionView_DataCNAIntakeVSOutput;
public ListCollectionView DataCNAIntakeVSOutput
{
获取{return\u DataCNAIntakeVSOutput;}
set{this.SetReferenceProperty(“DataCNAIntakeVSOutput”,ref_DataCNAIntakeVSOutput,value);}
}
private ListCollectionView_DatacnaPoreating;
public ListCollectionView数据收集
{
获取{return\u datacnaporeating;}
set{this.SetReferenceProperty(“datacnaporeating”,ref_datacnaporeating,value);}
}
//在这里,我们将按下shift键:
私有字符串_类型;
私有字符串移位
{
获取{return\u Type;}
set{if(this.SetReferenceProperty(“Shift”,ref _Type,value)){RefreshData();}
}
}
}
您有一个名为private string Shift;
...
private String Shift
{
get { return _Type; }
set { if (this.SetReferenceProperty("Shift", ref _Type, value)) { RefreshData(); } }
}