Adding Parameter to Angular router.navigate

Following my comments you have to : 1 – Redefine your route {path: ‘call/:caller’, component: MyComponent } 2 – Change your navigation in the parent component this.router.navigate([“call”, caller]); 3 – In the child component, get the param import { ActivatedRoute } from ‘@angular/router’; // code until … myParam: string; constructor(private route: ActivatedRoute) {} // code … Read more

How to bind local property on control in WPF

Try: Content=”{Binding ElementName=_this, Path=CompanyName}” Without the DataContext binding. EDIT I have no problems with your code, have named your window to x:Name=”_this”? <Window x:Class=”WpfStackOverflowSpielWiese.Window3″ xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Title=”Window3″ Height=”300″ Width=”300″ x:Name=”_this”> <Grid> <StackPanel> <Button HorizontalAlignment=”Center” Name=”btnChange” Click=”btnChange_Click” Content=”Click Me” /> <Label Name=”lblCompanyId” HorizontalAlignment=”Center” DataContext=”{Binding ElementName=_this}” Content=”{Binding Path=CompanyName}”></Label> </StackPanel> </Grid> </Window> Is your window really Window3? public … Read more

Binding ComboBox SelectedItem using MVVM

You seem to be unnecessarily setting properties on your ComboBox. You can remove the DisplayMemberPath and SelectedValuePath properties which have different uses. It might be an idea for you to take a look at the Difference between SelectedItem, SelectedValue and SelectedValuePath post here for an explanation of these properties. Try this: <ComboBox Name=”cbxSalesPeriods” ItemsSource=”{Binding SalesPeriods}” … Read more

Bind an input with type datetime-local to a Date property in Angular 2

Demo Plnkr You can bind to a date using the following format: yyyy-MM-ddTHH:mm, which you can also get from date.toISOString().slice(0,16) (the slice removes the time portion after the minutes). @Component({ selector: ‘app’, template: `<input type=”datetime-local” [value]=”date” (change)=”date=$event.target.value” /> {{date}}` }) export class AppComponent { date: string; constructor() { this.date = new Date().toISOString().slice(0, 16); } } … Read more

binding radiobuttons group to a property in WPF

Declare an enumeration similar to: enum RadioOptions {Option1, Option2} XAML: <RadioButton IsChecked=”{Binding SelectedOption, Converter={StaticResource EnumBooleanConverter}, ConverterParameter={x:Static local:RadioOptions.Option1}}”/> <RadioButton IsChecked=”{Binding SelectedOption, Converter={StaticResource EnumBooleanConverter}, ConverterParameter={x:Static local:RadioOptions.Option2}}”/> Converter class: public class EnumBooleanConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return value.Equals(parameter); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo … Read more

Binding ContentControl Content for dynamic content

Ok I’ve knocked up a simple example to show you how you can dynamically change the content of the ContentControl using a MVVM(Model-View-ViewModel) approach with data binding. I would recommend that you create a new project and load these files to see how it all works. We first need to implement INotifyPropertyChanged interface. This will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)