Tuesday, October 28, 2014

Great example of async and await

http://blog.roboblob.com/2014/10/23/awaiting-for-that-button-click/

WPF - Change the currently selected item style or the item that the mouse is currently over in a listbox

http://wpf.2000things.com/2014/10/24/1187-using-an-itemcontainerstyle-to-change-items-in-an-itemscontrol/

Tuesday, October 14, 2014

Data Binding in a nested element of a usercontrol to an ENUM in WPF

In .cs file

public enum Alignment
    {
        Horizontal,
        Vertical
    }

public Alignment UserAlignment

        {
            get
            {
                return _alignment;
            }
            set
            {
                _alignment = value;
            }
        }

In XAML file

xmlns:local="clr-namespace:MyNameSpace"
x:Name="MyControl"
.
.
.
.
.
.
<DataTrigger Binding="{Binding ElementName=MyControl,Path=UserAlignment}" Value="{x:Static local:Alignment.Vertical}">
                                    <Setter TargetName="TargetElement" Property="TargetProperty" >
                                        <Setter.Value>
Somevalue                  
                                        </Setter.Value>
                                    </Setter>
                                </DataTrigger>

Saturday, October 4, 2014

Enums as bitarray

http://blog.falafel.com/entity-framework-enum-flags/