Posts

Showing posts from November, 2020

Angular Nested Routes

--- --- Angular Nested Routes In case something like this is needed Main (has the main router-outlet Settings (has its own router-outlet) Sites Users Other… Create the app with routing support ng new angular-nested-routes --routing-true Add a module for administration with its own routing support ng g module admin --routing=true Add AdminModule to the imports declaration of app.module @ NgModule ( { declarations : [ AppComponent ] , imports : [ BrowserModule , AppRoutingModule , AdminModule ] , providers : [ ] , bootstrap : [ AppComponent ] } ) export class AppModule { } Set path structure in admin-routing.module.ts const routes : Routes = [ { path : 'settings' , component : SettingsComponent , children : [ { path : 'sites' , component : SitesComponent } , { path : 'users' , component : UsersComponent } ] } ...

WPF - Combobox with a null item

--- --- WPF - Combobox with a null item It adds an item for “Select All” or “Empty” functionality into a combobox Converter public class ComboBoxEmptyItemConverter : IValueConverter { /// <summary> /// this object is the empty item in the combobox. A dynamic object that /// returns null for all property request. /// </summary> private class EmptyItem : DynamicObject { public string Name { get ; set ; } = "Empty" ; public override bool TryGetMember ( GetMemberBinder binder , out object result ) { // just set the result to null and return true result = null ; return true ; } } public object Convert ( object value , Type targetType , object parameter , CultureInfo culture ) { // assume that the value at least inherits from IEnumerable ...