当前位置: 首页>>代码示例>>C#>>正文


C# ObjectModel.ObservableCollection类代码示例

本文整理汇总了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);
        }
开发者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


注:本文中的System.Collections.ObjectModel.ObservableCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。