本文整理汇总了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类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: FileApiTests
public FileApiTests(string access_token)
{
InitializeComponent();
userToken = access_token;
files = new System.Collections.ObjectModel.ObservableCollection<File>();
listView_files.ItemsSource = files;
}
示例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);
}
}
示例4: SizeFunction
public SizeFunction()
{
Name = "Поиск размера";
SelectedParameter = FunctionParameters.CellName;
Parameters = new System.Collections.ObjectModel.ObservableCollection<CommonTypes.Parameter>();
//StringFormat = Name + "()";
}
示例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();
}
示例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();
}
示例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();
});
}
示例8: SelectRadiosWindow
public SelectRadiosWindow()
{
InitializeComponent();
_radios = new System.Collections.ObjectModel.ObservableCollection<RadioInfo>(RadioInfoLookupHelper.Instance.RadioList.OrderBy(r => r.DisplayName));
lbRadios.ItemsSource = _radios;
}
示例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);
}
示例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);
// }
};
}
示例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);
}
}
示例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;
}
示例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");
}
示例14: Data
public Data()
{
channelNames = new System.Collections.ObjectModel.ObservableCollection<string>();
TapMax = 300;
Gain = -80;
Tap = 150;
UpperFcNum = tap;
LowerFcNum = 0;
NumberOfDisplayedData = 1000;
}
示例15: SavePrescriptionView
public SavePrescriptionView(ObservableCollection<PrescriptionItem> list)
{
InitializeComponent();
if (list.Count > 0)
{
PrescriptionList = list;
gvDetail.ItemsSource = list;
}
listResult = new System.Collections.ObjectModel.ObservableCollection<ItemDemo>();
}