コード例 #1
0
        public void DragDrop(object sender, DragEventArgs dragArgs)
        {
            DataContext = sender.As <FrameworkElement>().DataContext.As <TreeGroup>();

            dragArgs
            .GetFrom <ValueTag>()
            .TryAs <IValueTag>()
            ?.Let(AddNewItem);

            dragArgs
            .GetFrom <VortexObjectDataTemplate>()
            .TryAs <TreeWrapperObject>()
            ?.Let(AddNewItem);

            dragArgs
            .GetFrom <TreeItemTemplate>()
            .TryAs <IValueTag>()
            ?.Let(AddToFavourites);

            dragArgs.Handled = true;
        }