Exemplo n.º 1
0
        static void OnIndexChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            ArtControl me = sender as ArtControl;

            if (me != null)
            {
                if (me.Index >= 0)
                {
                    me.SelectedArt = me.Data.Art[me.Index];
                }
                else
                {
                    me.SelectedArt = null;
                }
            }
        }
Exemplo n.º 2
0
        static void OnDataChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            ArtControl me = sender as ArtControl;

            if (me != null)
            {
                if (me.Data != null && me.Data.Art != null && me.Data.Art.Count > 0)
                {
                    if (me.Index == 0)
                    {
                        me.SelectedArt = me.Data.Art[0];
                    }
                    else
                    {
                        me.Index = 0;
                    }
                }
                else
                {
                    me.Index = -1;
                }
            }
        }