Hi, folks! Today we are gonna talk about new indexer initialization syntax introduced in C# 6.0. As we know, we already have good way to initialize dictionary: var dic = new Dictionary<string, int> { {"Apple", 2}, {"Pear", 10} }; but in C# 6.0 we have a better way to do the same: var dic2 = new Dictionary<string, int> { ["Apple"] = 2, ["Pear"] = 10 }; As for me, it is a bit nicer because we already have curly brackets in the beginning and endin...
WPF Binding examples
I have found very nice WPF XAML Data Binding Cheat Sheet, so I'll just leave it here for further use. Basic Binding {Binding} Bind to current DataContext. {Binding Name} Bind to the “Name” property of the current DataContext. {Bindind Name.Length} Bind to the Length property of the object in the Name property of the current DataContext. {Binding ElementName=SomeTextBox, Path=Text} Bind to the “Text” property of the element XAML element with name=”SomeTextBox” or x:Name=”SomeTextBox”. XML Binding...