本文整理汇总了C#中System.Collections.ObjectModel.ObservableCollection类的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.ObjectModel.ObservableCollection类的具体用法?C# System.Collections.ObjectModel.ObservableCollection怎么用?C# System.Collections.ObjectModel.ObservableCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Collections.ObjectModel.ObservableCollection类属于命名空间,在下文中一共展示了System.Collections.ObjectModel.ObservableCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: LoadData
private void LoadData()
{
int pageCount = 0;
string filter = "";
System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();
//filter += "[email protected]" + paras.Count().ToString();
//paras.Add(Convert.ToInt32(CheckStates.Approved).ToString());
TextBox txtEmpName = Utility.FindChildControl<TextBox>(expander, "txtEmpName");
if (!string.IsNullOrEmpty(txtEmpName.Text))
{
if (!string.IsNullOrEmpty(filter))
{
filter += " and ";
}
filter += "[email protected]" + paras.Count().ToString();
paras.Add(txtEmpName.Text.Trim());
}
//LoginUserInfo info = new LoginUserInfo();
//info.companyID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
//info.userID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
//client.GetWelfarePaymentDetailsInfosAsync(dataPager.PageIndex, dataPager.PageSize, "welfareDetailsViews.CREATEDATE", filter, new object[]{},
// pageCount, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID);
}
开发者ID:JuRogn,项目名称:OA,代码行数:25,代码来源:WelfarePaymentDetails.xaml.cs
示例2: FileApiTests
public FileApiTests(string access_token)
{
InitializeComponent();
userToken = access_token;
files = new System.Collections.ObjectModel.ObservableCollection<File>();
listView_files.ItemsSource = files;
}
开发者ID:julianhaslinger,项目名称:AppNet.NET,代码行数:7,代码来源:FileApiTests.xaml.cs
示例3: ShowingCloneDialogWithoutBeingLoggedInShowsLoginDialog
public void ShowingCloneDialogWithoutBeingLoggedInShowsLoginDialog()
{
var provider = Substitutes.GetFullyMockedServiceProvider();
var hosts = provider.GetRepositoryHosts();
var factory = SetupFactory(provider);
var loginView = factory.GetView(GitHub.Exports.UIViewType.Login);
loginView.Value.Cancel.Returns(Observable.Empty<object>());
var cm = provider.GetConnectionManager();
var cons = new System.Collections.ObjectModel.ObservableCollection<IConnection>();
cm.Connections.Returns(cons);
using (var uiController = new UIController((IUIProvider)provider, hosts, factory, cm, LazySubstitute.For<ITwoFactorChallengeHandler>()))
{
var list = new List<IView>();
uiController.SelectFlow(UIControllerFlow.Clone)
.Subscribe(uc => list.Add(uc as IView),
() =>
{
Assert.True(list.Count > 1);
Assert.IsAssignableFrom<IViewFor<ILoginControlViewModel>>(list[0]);
});
uiController.Start(null);
}
}
开发者ID:chris134pravin,项目名称:VisualStudio,代码行数:25,代码来源:UIControllerTests.cs
示例4: SizeFunction
public SizeFunction()
{
Name = "Поиск размера";
SelectedParameter = FunctionParameters.CellName;
Parameters = new System.Collections.ObjectModel.ObservableCollection<CommonTypes.Parameter>();
//StringFormat = Name + "()";
}
开发者ID:kblc,项目名称:ExcelConverter,代码行数:7,代码来源:SizeFunction.cs
示例5: Initialize
public override void Initialize()
{
User usr = GetConcretEntity<User>();
UserInfo = ApplicationVM.Cache.UserInfos.FirstOrDefault(i => i.User_Id == usr.Id &&
(i.Application_Id == ApplicationVM.ApplicationId || i.Application_Id == BuiltIns.AllApplication.Id));
if (UserInfo != null)
{
if (UserInfo.Money.HasValue)
{
Money = UserInfo.Money.Value;
}
if (UserInfo.Score.HasValue)
{
Score = UserInfo.Score.Value;
}
RoleVM = ApplicationVM.LocalCache.AllRoleVMs.FirstOrDefault(r => r.Id == UserInfo.Role_Id);
}
var rrs = ApplicationVM.LocalCache.AllRoomRoleVMs.Where(rr => rr.UserId == Id);
if (rrs != null)
{
RoomRoleVMs = new System.Collections.ObjectModel.ObservableCollection<RoomRoleViewModel>(rrs);
}
base.Initialize();
}
开发者ID:wangws556,项目名称:duoduo-chat,代码行数:25,代码来源:UserViewModel.cs
示例6: Page1
// Constructor
public Page1()
{
InitializeComponent();
/*Microsoft.SilverlightMediaFramework.Core.Media.PlaylistItem item = new Microsoft.SilverlightMediaFramework.Core.Media.PlaylistItem();
item.MediaSource = "";
SMFPlayer.Playlist = item; */
this.SongName.Text = Playlist.selectedItem.Name;
Microsoft.SilverlightMediaFramework.Core.Media.PlaylistItem it = new Microsoft.SilverlightMediaFramework.Core.Media.PlaylistItem();
it.DeliveryMethod = Microsoft.SilverlightMediaFramework.Plugins.Primitives.DeliveryMethods.Streaming;
if (Playlist.selectedItem.link != null)
{
it.MediaSource = new Uri(Playlist.selectedItem.link);
}
else
{
MessageBox.Show("Sorry Bro!!");
}
var itList = new System.Collections.ObjectModel.ObservableCollection<Microsoft.SilverlightMediaFramework.Core.Media.PlaylistItem>();
itList.Add(it);
this.SMFPlay.Playlist = itList;
// Sample code to localize the ApplicationBar
//BuildLocalizedApplicationBar();
}
开发者ID:Hitchhikrr,项目名称:SkyStream,代码行数:29,代码来源:Page1.xaml.cs
示例7: MainViewModel
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public MainViewModel(IDataService dataService, Services.IQaStringGeneratorService generator)
{
_dataService = dataService;
_generator = generator;
_generatedTexts = new System.Collections.ObjectModel.ObservableCollection<TextItemViewModel>();
this.PropertyChanged += MainViewModel_PropertyChanged;
_dataService.GetData(
(item, error) =>
{
if (error != null)
{
// Report error here
return;
}
_pattern = item.LastPattern;
_numberOfCharacters = item.LastCount;
_qAApproved = item.LastQa;
_countList = item.LastCountList;
_results = _generator.Generate(this.NumberOfCharacters, this.Pattern, this.QAApproved);
generateCountList();
});
}
开发者ID:patware,项目名称:GenerateText,代码行数:31,代码来源:MainViewModel.cs
示例8: SelectRadiosWindow
public SelectRadiosWindow()
{
InitializeComponent();
_radios = new System.Collections.ObjectModel.ObservableCollection<RadioInfo>(RadioInfoLookupHelper.Instance.RadioList.OrderBy(r => r.DisplayName));
lbRadios.ItemsSource = _radios;
}
开发者ID:JoeGilkey,项目名称:RadioLog,代码行数:7,代码来源:SelectRadiosWindow.xaml.cs
示例9: GetData
public void GetData()
{
int pageCount = 0;
string filter = "";
System.Collections.ObjectModel.ObservableCollection<object> paras = new System.Collections.ObjectModel.ObservableCollection<object>();
FlowDesignerService.GetFlowDefineAsync(dataPager.PageIndex, dataPager.PageSize, "", filter, paras, pageCount);
}
开发者ID:JuRogn,项目名称:OA,代码行数:7,代码来源:FlowSelect.xaml.cs
示例10: LoadMenu
private void LoadMenu(string userid)
{
slAmidaConsole.Web.EQ_DomainContext db = new Web.EQ_DomainContext();
EntityQuery< vwUserMenuAllow> qry = from n in db.GetVwUserMenuAllowQuery() where n.UserID == userid && n.IsAllow select n;
LoadOperation<vwUserMenuAllow> lo = db.Load<vwUserMenuAllow>(qry);
lo.Completed += (s, a) =>
{
if (lo.Error != null)
{
MessageBox.Show(lo.Error.Message);
return;
}
MenuInfos = new System.Collections.ObjectModel.ObservableCollection<vwUserMenuAllow>(lo.Entities);
var q = (from n in MenuInfos group n by new { n.GroupName, n.MenuOrder} into gn select new MenuInfo { MainMenu = gn.Key.GroupName, MenuOrder=gn.Key.MenuOrder, Menus = gn.ToList<vwUserMenuAllow>() }).OrderBy(x=>x.MenuOrder);
this.accordin.ItemsSource = q.ToList<MenuInfo>();
// var MainMenus = (from n in MenuInfos select n.GroupName).Distinct<string>();
// foreach (string mainmenu in MainMenus)
// {
// AccordionItem item = new AccordionItem() { Header = mainmenu };
// var q = from n in MenuInfos where n.GroupName == mainmenu select n;
// item.DataContext = q;
// this.accordin.Items.Add (item);
// }
};
}
开发者ID:ufjl0683,项目名称:Earth,代码行数:32,代码来源:EqManager.xaml.cs
示例11: PlayAlbum
private void PlayAlbum()
{
var tracks = new System.Collections.ObjectModel.ObservableCollection<Track>(this.Album.Tracks);
if (tracks != null && tracks.Count() > 0)
{
this.PlayTracks(tracks);
}
}
开发者ID:uwe-e,项目名称:BSE.Tunes,代码行数:8,代码来源:AlbumDetailPageViewModel.cs
示例12: RefreshListViewSource
public void RefreshListViewSource()
{
Core MainCore = Core.GetCore();
Scheduler MainScheduler = MainCore.GetScheduler();
System.Collections.ObjectModel.ObservableCollection<AppTask> oTasksList = new System.Collections.ObjectModel.ObservableCollection<AppTask>(MainScheduler.GetTasks(false));
listView.ItemTemplate = new DataTemplate(typeof(ListItemCell));
listView.ItemsSource = oTasksList;
}
开发者ID:AndyCYao,项目名称:AndroidSchedulerApp,代码行数:9,代码来源:pageMain.cs
示例13: InitializationSavedTest
public void InitializationSavedTest()
{
SurveyMock.RemoveAllSurveys();
SurveyMock.GenerateResponseSets(RESPONSE_SETS_COUNT);
DataAccessModels.Repositories.ResponseSetRepository respository = new DataAccessModels.Repositories.ResponseSetRepository();
var items = respository.GetAllResponseSetsForUser(Membership.CurrentUser.ID);
var responseSets = new System.Collections.ObjectModel.ObservableCollection<DataAccessModels.ResponseSet>(items);
this.InitializationResponseSetViewModel(ResponseSetsType.Saved, "TopResponses");
}
开发者ID:nokiadatagathering,项目名称:WP7-Official,代码行数:9,代码来源:ResponseSetViewModelTest.cs
示例14: Data
public Data()
{
channelNames = new System.Collections.ObjectModel.ObservableCollection<string>();
TapMax = 300;
Gain = -80;
Tap = 150;
UpperFcNum = tap;
LowerFcNum = 0;
NumberOfDisplayedData = 1000;
}
开发者ID:betchx,项目名称:WaveViewerWithFiltering,代码行数:10,代码来源:Data.cs
示例15: SavePrescriptionView
public SavePrescriptionView(ObservableCollection<PrescriptionItem> list)
{
InitializeComponent();
if (list.Count > 0)
{
PrescriptionList = list;
gvDetail.ItemsSource = list;
}
listResult = new System.Collections.ObjectModel.ObservableCollection<ItemDemo>();
}
开发者ID:wybq68,项目名称:DIH_LUMBARROBAT,代码行数:10,代码来源:SavePrescriptionView.xaml.cs
示例16: FindStringFunction
public FindStringFunction()
{
Name = "Поиск значений";
SelectedParameter = FunctionParameters.CellName;
Parameters = new System.Collections.ObjectModel.ObservableCollection<CommonTypes.Parameter>
{
new Parameter{Name="Значения", ExpectedValueType = typeof(string), ParsingExpected = true},
new Parameter{Name="По умолчанию", ExpectedValueType = typeof(string)}
};
}
开发者ID:kblc,项目名称:ExcelConverter,代码行数:10,代码来源:FindStringFunction.cs
示例17: CutRightAndLeftCharsFunction
public CutRightAndLeftCharsFunction()
{
Name = "Обрезать";
SelectedParameter = FunctionParameters.CellName;
Parameters = new System.Collections.ObjectModel.ObservableCollection<CommonTypes.Parameter>
{
new Parameter{Name="Слева", Value="0", ExpectedValueType = typeof(int)},
new Parameter{Name="Справа", Value="0", ExpectedValueType = typeof(int)}
};
}
开发者ID:kblc,项目名称:ExcelConverter,代码行数:10,代码来源:CutRightAndLeftCharsFunction.cs
示例18: Main
static void Main(string[] args)
{
var objects = new System.Collections.ObjectModel.ObservableCollection<object>(Todo.NeuLaden());
JustObjectsPrototype.Show.With(objects,
types: new List<Type> { typeof(Todo) },
settings: JustObjectsPrototype.UI.Settings.New(s =>
{
s.AllowDelete[typeof(Todo)] = false;
}));
}
开发者ID:halllo,项目名称:StpNtp,代码行数:11,代码来源:Program.cs
示例19: GroupEditorDialog
public GroupEditorDialog(Common.SignalGroup group)
{
InitializeComponent();
RadioLog.WPFCommon.BrushSelectionHolder[] colors = RadioLog.WPFCommon.ColorHelper.GetBrushSelectionItems();
System.Collections.ObjectModel.ObservableCollection<RadioLog.WPFCommon.BrushSelectionHolder> colorList = new System.Collections.ObjectModel.ObservableCollection<WPFCommon.BrushSelectionHolder>(colors);
colorList.Insert(0, new WPFCommon.BrushSelectionHolder("Default", null));
cbGroupColor.ItemsSource = colorList;
_group = group;
SetupForCurrentGroup();
}
开发者ID:JoeGilkey,项目名称:RadioLog,代码行数:12,代码来源:GroupEditorDialog.xaml.cs
示例20: ExtractPlaylists
public System.Collections.ObjectModel.ObservableCollection<Model.Playlist> ExtractPlaylists()
{
IEnumerable<System.Xml.Linq.XElement> playlists = XElement.Elements();
System.Collections.ObjectModel.ObservableCollection<Model.Playlist> playlistsList = new System.Collections.ObjectModel.ObservableCollection<Model.Playlist>();
if (XElement == null)
return null;
try
{
/* CREATING AN OBSERVABLECOLLECTION FROM ALL PLAYLIST */
foreach (var playlist in playlists)
{
IEnumerable<System.Xml.Linq.XElement> medias = XElement.Elements("Media");
System.Collections.ObjectModel.ObservableCollection<Model.Media> mediasList = new System.Collections.ObjectModel.ObservableCollection<Model.Media>();
/* CREATING AN MEDIA COLLECTION CORRESPONDING TO ALL MEDIAS OF PLAYLIST */
foreach (var media in medias)
{
/* TEST IF XML ELEMENT IS VALID FOR MEDIA */
if (media != null && media.Element("Path") != null && media.Element("Type") != null)
{
Model.Media newMedia = null;
switch ((Model.Media.MediaType)Enum.Parse(typeof(Model.Media.MediaType), media.Element("Type").Value))
{
case Model.Media.MediaType.IMAGE:
newMedia = new Model.Image(media.Element("Path").Value);
break;
case Model.Media.MediaType.VIDEO:
newMedia = new Model.Video(media.Element("Path").Value);
break;
case Model.Media.MediaType.MUSIC:
newMedia = new Model.Music(media.Element("Path").Value);
break;
}
if (newMedia != null)
mediasList.Add(newMedia);
}
}
/* ADDING NEW PLAYLIST ELEMENT TO SELECTION */
playlistsList.Add(new Model.Playlist() { Name = playlist.Element("Name").Value, MediasList = mediasList });
}
}
catch
{ }
return playlistsList;
}
开发者ID:Aiscky,项目名称:WindowsMediaPlayer,代码行数:53,代码来源:XMLPlaylist.cs
注:本文中的System.Collections.ObjectModel.ObservableCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论