public override void Reload(List <T> _StoreSource, string contain = "") { this.Children.Clear(); CustomDataGrid dataGrid = new CustomDataGrid(); dataGrid.Columns.Clear(); dataGrid.AutoGenerateColumns = false; dataGrid.IsReadOnly = true; dataGrid.SelectionChanged += new SelectionChangedEventHandler(selectionChanged); if (StoreSource.Any()) { foreach (DataGridColumn Column in StoreSource.First().previewList()) { dataGrid.Columns.Add(Column); } } dataGrid.ItemsSource = _StoreSource.Where(x => x.IsRelated(Id.ToString())); dataGrid.ContextMenu = this.getContextMenu(); this.Children.Add(dataGrid); }
// private PreferenceBase logout_pref; public StoreSourcePreferences(StoreSource source) { var service = ServiceManager.Get<PreferenceService> (); if (service == null) { return; } this.source = source; service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters; source_page = new SourcePage (source); var country_section = source_page.Add (new Section ("country", Catalog.GetString ("Country"), 20)); country_section.Add (country_pref = new SchemaPreference<string> (StoreCountry, null, Catalog.GetString ("Which Amazon MP3 storefront to use by default."))); /*var session_section = source_page.Add (new Section ("session", Catalog.GetString ("Session"), 30)); session_section.Add (new SchemaPreference<bool> (PersistLogin, Catalog.GetString ("_Keep me logged in"), Catalog.GetString ("Keep any session cookies that Amazon MP3 may set across instances."))); session_section.Add (logout_pref = new VoidPreference ("log-out-button"));*/ Hyena.Log.InformationFormat ("AmazonMP3 store redirect URL: {0}", RedirectUrl.Get ()); }
static void Main(string[] args) { Mapper.CreateMap <LocationSource, LocationDestination>(); Mapper.CreateMap <StoreSource, StoreDestination>(); var storeSource = new StoreSource { Name = "Worst Buy", Locations = new EntityCollection <LocationSource> { new LocationSource { Id = 1, Address = "abc1" }, new LocationSource { Id = 2, Address = "abc2" } } }; var storeDestination = Mapper.Map <StoreSource, StoreDestination>(storeSource); }
public override void Reload(List <T> _StoreSource, string contain = "") { this.Children.Clear(); UniformGrid UFG = new UniformGrid(); UFG.Columns = 5; UFG.Children.Clear(); UFG.Columns = 5; foreach (T item in StoreSource.Where(x => x.IsRelated(contain))) { CustomGroupBox cgb = new CustomGroupBox() { Prospect = item, Margin = new Thickness(2, 2, 2, 2) }; cgb.Click += new RoutedEventHandler(CustomGroupBox_Click); //Grille du header Grid gridHeader = new Grid(); gridHeader.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); gridHeader.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }); gridHeader.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto }); TextBlock TBC = new TextBlock() { Text = item.GetHeader() }; CheckBox CBX = new CheckBox(); CBX.IsEnabled = false; CBX.SetValue(Grid.ColumnProperty, 2); gridHeader.Children.Add(TBC); gridHeader.Children.Add(CBX); cgb.Header = gridHeader; StackPanel stackPanel = new StackPanel(); stackPanel.Orientation = Orientation.Vertical; foreach (TextBlock TBCBoucle in item.PreviewGroupBox()) { stackPanel.Children.Add(TBCBoucle); } cgb.Content = stackPanel; cgb.ContextMenu = this.getContextMenu(); UFG.Children.Add(cgb); } this.Children.Add(UFG); }