Exemple #1
0
        private void move_subitem_down_MouseDown(object sender, MouseButtonEventArgs e)
        {
            try
            {
                Application.Current.Dispatcher.Invoke(new Action(() =>
                {
                    Image b = sender as Image;
                    Model.Subitems subitems = b.DataContext as Model.Subitems;

                    if (subitems != null)
                    {
                        list_subitems.SelectedItem = mSubitems;
                        var selectedIndex          = list_subitems.SelectedIndex;

                        if (selectedIndex + 1 < mSubitems.Count)
                        {
                            var itemToMoveDown = this.mSubitems[selectedIndex];
                            this.mSubitems.RemoveAt(selectedIndex);
                            this.mSubitems.Insert(selectedIndex + 1, itemToMoveDown);
                            this.list_subitems.SelectedIndex = selectedIndex + 1;
                        }
                    }
                }));
            }
            catch (Exception ex) { }
        }
Exemple #2
0
        private void image_delete_subitem_MouseDown(object sender, MouseButtonEventArgs e)
        {
            try
            {
                Application.Current.Dispatcher.Invoke(new Action(() =>
                {
                    Image b = sender as Image;
                    Model.Subitems subitems = b.DataContext as Model.Subitems;

                    if (subitems != null)
                    {
                        mSubitems.RemoveAt(subitems._Index);

                        for (int i = 0; i < mSubitems.Count; i++)
                        {
                            mSubitems[i]._Index = i;
                        }
                    }
                }));
            }
            catch (Exception ex) { }
        }
Exemple #3
0
 private bool subItemsFilter(Model.Subitems model)
 {
     return(model._IdItem == IdItem);
 }