本文整理汇总了C#中BindableCollection类的典型用法代码示例。如果您正苦于以下问题:C# BindableCollection类的具体用法?C# BindableCollection怎么用?C# BindableCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BindableCollection类属于命名空间,在下文中一共展示了BindableCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TypeOfPaymentViewModel
public TypeOfPaymentViewModel(INavigationService navigationService)
: base(navigationService)
{
_navigationService = navigationService;
_title = "Type of Payment - Step 2/4";
AvailablePayments = new BindableCollection<PaymentMethod>();
}
示例2: DeviceWizard_LocalNetworkViewModel
public DeviceWizard_LocalNetworkViewModel(DeviceInstallationWizardViewModel conductor)
{
this._conductor = conductor;
this._availableClients = new BindableCollection<ClientInfoListItemViewModel>();
this.IsScanning = false;
Task.Factory.StartNew(UpdateAvailableClients, TaskCreationOptions.LongRunning);
}
示例3: InvoicePopupViewModel
public InvoicePopupViewModel(IInvoiceService invoiceService, IProductService productService)
{
InvoiceService = invoiceService;
ProductService = productService;
Items = new BindableCollection<SaleItemViewModel>();
}
示例4: DatabaseModel
public DatabaseModel(string name, DocumentStore documentStore)
{
this.name = name;
this.documentStore = documentStore;
Tasks = new BindableCollection<TaskModel>(x => x.Name)
{
new ImportTask(),
new ExportTask(),
new StartBackupTask(),
new IndexingTask(),
new SampleDataTask()
};
SelectedTask = new Observable<TaskModel> { Value = Tasks.FirstOrDefault() };
Statistics = new Observable<DatabaseStatistics>();
Status = new Observable<string>
{
Value = "Offline"
};
asyncDatabaseCommands = name.Equals(Constants.SystemDatabase, StringComparison.OrdinalIgnoreCase)
? documentStore.AsyncDatabaseCommands.ForDefaultDatabase()
: documentStore.AsyncDatabaseCommands.ForDatabase(name);
DocumentChanges.Select(c => Unit.Default).Merge(IndexChanges.Select(c => Unit.Default))
.SampleResponsive(TimeSpan.FromSeconds(2))
.Subscribe(_ => RefreshStatistics(), exception => ApplicationModel.Current.Server.Value.IsConnected.Value = false);
RefreshStatistics();
}
示例5: CalendarWeekViewModel
public CalendarWeekViewModel(IWindsorContainer container, IAppointmentService service)
{
this.container = container;
this.appointmentService = service;
Days = new BindableCollection<DayTileViewModel>();
BuildUp();
}
示例6: CollectionsModel
public CollectionsModel()
{
ModelUrl = "/collections";
ApplicationModel.Current.Server.Value.RawUrl = null;
Collections = new BindableCollection<CollectionModel>(model => model.Name);
SelectedCollection = new Observable<CollectionModel>();
DocumentsForSelectedCollection.SetChangesObservable(d => d.IndexChanges
.Where(n =>n.Name.Equals(CollectionsIndex,StringComparison.InvariantCulture))
.Select(m => Unit.Default));
DocumentsForSelectedCollection.DocumentNavigatorFactory =
(id, index) =>
DocumentNavigator.Create(id, index, CollectionsIndex,
new IndexQuery() {Query = "Tag:" + GetSelectedCollectionName()});
SelectedCollection.PropertyChanged += (sender, args) =>
{
PutCollectionNameInTheUrl();
CollectionSource.CollectionName = GetSelectedCollectionName();
DocumentsForSelectedCollection.Context = "Collection/" + GetSelectedCollectionName();
};
SortedCollectionsList = new CollectionViewSource()
{
Source = Collections,
SortDescriptions =
{
new SortDescription("Count", ListSortDirection.Descending)
}
};
}
示例7: FingerTrackingOptionsViewModel
public FingerTrackingOptionsViewModel()
{
Colors = new BindableCollection<Color>();
foreach (var property in typeof(Color).GetProperties().Where(p => p.PropertyType == typeof(Color)))
{
Colors.Add((Color)property.GetValue(new Color()));
}
MinContourArea = 100;
ConvexHullCW = false;
ConvexHullColor = Color.Green;
ContourHighlightColor = Color.Blue;
DefectStartPointHighlightColor = Color.Violet;
DefectDepthPointHighlightColor = Color.Black;
DefectEndPointHighlightColor = Color.Yellow;
DefectLinesColor = Color.Red;
SelectedMethod = 2;
TrackOnlyControlPoint = false;
if (Execute.InDesignMode)
LoadDesignTimeData();
}
示例8: BuscarModosPago
public BindableCollection<ModoPago> BuscarModosPago()
{
BindableCollection<ModoPago> listaModoPagos = new BindableCollection<ModoPago>(); ;
SqlConnection conn = new SqlConnection(Properties.Settings.Default.inf245g4ConnectionString);
SqlCommand cmd = new SqlCommand();
SqlDataReader reader;
cmd.CommandText = "SELECT * FROM ModoPago";
cmd.CommandType = CommandType.Text;
cmd.Connection = conn;
try
{
conn.Open();
reader = cmd.ExecuteReader();
while (reader.Read())
{
ModoPago mp = new ModoPago();
mp.IdModoPago = reader.IsDBNull(reader.GetOrdinal("idModoPago")) ? -1 : (int)reader["idModoPago"];
mp.Nombre = reader.IsDBNull(reader.GetOrdinal("nombre")) ? null : reader["nombre"].ToString();
listaModoPagos.Add(mp);
}
conn.Close();
}
catch (Exception e)
{
MessageBox.Show(e.StackTrace.ToString());
}
return listaModoPagos;
}
示例9: ShellViewModel
public ShellViewModel(IEventAggregator eventAggregator, MessageHandler messageHandler)
{
this.eventAggregator = eventAggregator;
LogMessages = new BindableCollection<LogEntry>();
ViewAttached += OnViewAttachedEventHandler;
}
示例10: EditClearancesViewModel
public EditClearancesViewModel()
{
Courses =
new BindableCollection<CourseViewModel>(
JsonConvert.DeserializeObject<List<Course>>(File.ReadAllText(_courseDataPath, Encoding.UTF8))
.Select(c => new CourseViewModel(c)));
}
示例11: ContinueNearestSearchOnUiThread
protected async void ContinueNearestSearchOnUiThread()
{
Haltestellen = null;
NotifyOfPropertyChange(() => Haltestellen);
var posResult = await _locationService.GetCurrentPosition();
if (posResult.Succeeded)
{
var pos = posResult.Position;
InfoMessage = String.Format("{0}: {1:F2} {2:F2}", AppResources.PositionMessage_YourPosition, pos.Coordinate.Point.Position.Longitude, pos.Coordinate.Point.Position.Latitude);
MyLocation = new Wgs84Location(pos.Coordinate);
var haltestellen = await _dataService.GetNearestHaltestellenAsync(MyLocation);
if (!haltestellen.Any())
{
InfoMessage = String.Format("{0}: {1:F2} {2:F2}", AppResources.PositionMessage_NoStopsFoundNear,
pos.Coordinate.Point.Position.Longitude, pos.Coordinate.Point.Position.Latitude);
}
else
{
Haltestellen = new BindableCollection<Haltestelle>(haltestellen.OrderBy(h => h.Distanz));
NotifyOfPropertyChange(() => Haltestellen);
}
}
else
{
InfoMessage = posResult.ErrorMessage;
}
}
示例12: ObtenerSubLineas
public BindableCollection<SubLineaProducto> ObtenerSubLineas(int id)
{
db.cmd.CommandText = "SELECT * FROM SubLineaProducto WHERE [email protected]";
db.cmd.Parameters.AddWithValue("idLinea", id);
SqlDataReader reader;
BindableCollection<SubLineaProducto> lstSubLinea = new BindableCollection<SubLineaProducto>();
try
{
db.conn.Open();
reader=db.cmd.ExecuteReader();
while (reader.Read())
{
SubLineaProducto slp = new SubLineaProducto();
slp.IdLinea = id;
slp.Nombre=reader["Nombre"].ToString();
slp.IdSubLinea = Int32.Parse(reader["IdSubLinea"].ToString());
slp.Abreviatura = reader["Abreviatura"].ToString();
lstSubLinea.Add(slp);
}
db.cmd.Parameters.Clear();
reader.Close();
db.conn.Close();
}
catch (SqlException e)
{
Console.WriteLine(e);
}
catch (Exception e)
{
Console.WriteLine(e.StackTrace.ToString());
}
return lstSubLinea;
}
示例13: ServerModel
private ServerModel(string url)
{
this.url = url;
Databases = new BindableCollection<DatabaseModel>(model => model.Name);
SelectedDatabase = new Observable<DatabaseModel>();
Initialize();
}
示例14: SearchPresenter
public SearchPresenter(IYearToVerseSearchService searchService, IHebrewNumberConverter hebrewNumberConverter)
{
this.searchService = searchService;
this.hebrewNumberConverter = hebrewNumberConverter;
jewishYear = new Observable<string>("5770");
Verses = new BindableCollection<Verse>();
}
示例15: ChartViewModel
public ChartViewModel(ISevenDigitalClient sevenDigitalClient, INavigationService navigationService)
{
this.sevenDigitalClient = sevenDigitalClient;
this.navigationService = navigationService;
Items = new BindableCollection<ChartItem>();
}