The other day I was working on a WPF functionality that requires me to format a user input from a DatePickerTextBox.…
Category: Did You Know Series
WPF did you know series #3: the following code snippets are the same
Snippet 1:
1 |
<Button xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” Content=”OK”><br /> <Button.Background><br /> <SolidColorBrush Color=”White”/><br /> </Button.Background><br /></Button> |
Snippet 2:
1 |
<Button xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”<br />Content=”OK”><br /> <Button.Background><br /> <SolidColorBrush><br /> <SolidColorBrush.Color><br /> <Color A=”255” R=”255” G=”255” B=”255”/><br /> </SolidColorBrush.Color><br /> </SolidColorBrush><br /> </Button.Background><br /></Button> |
Snippet 3:
1 |
System.Windows.Controls.Button button = new System.Windows.Controls.Button();<br />button.Content = “OK”;<br />button.Background = (Brush)System.ComponentModel.TypeDescriptor.GetConverter(typeof(Brush)).ConvertFromInvariantString(“White”); |
Snippet 1 uses in-built converters to convert “special” type…
WPF did you know series #2: margin and padding
I’ve been reading WPF Unleashed by Adam Nathan. I will be posting my lesson’s learnt in the form of small code…
WPF did you now series #1: you can run XAML from Internet Explorer
Dear reader, It’s being a while, I know. Got married, changed jobs, moved cities, and a newly minted daddy to…