Exemple #1
0
        public static IEnumerable <SuggestedActionsControlItemViewModel> GetActionsForEmptyCanvasPage(ICanvasPreviewModel pasteCanvasControlModel)
        {
            List <SuggestedActionsControlItemViewModel> actions = new List <SuggestedActionsControlItemViewModel>();

            var action_paste = new SuggestedActionsControlItemViewModel(
                new AsyncRelayCommand(async() =>
            {
                CanvasPreviewControlViewModel.CanvasPasteCancellationTokenSource.Cancel();
                CanvasPreviewControlViewModel.CanvasPasteCancellationTokenSource = new CancellationTokenSource();

                SafeWrapper <DataPackageView> dataPackage = await ClipboardHelpers.GetClipboardData();

                await pasteCanvasControlModel.TryPasteData(dataPackage, CanvasPreviewControlViewModel.CanvasPasteCancellationTokenSource.Token);
            }), "Paste from clipboard", "\uE77F");

            actions.Add(action_paste);

            return(actions);
        }
Exemple #2
0
        public static IEnumerable <SuggestedActionsControlItemViewModel> GetActionsForInvalidReference(ICanvasPreviewModel pasteCanvasModel)
        {
            List <SuggestedActionsControlItemViewModel> actions = new List <SuggestedActionsControlItemViewModel>();

            var action_deleteReference = new SuggestedActionsControlItemViewModel(
                new AsyncRelayCommand(async() =>
            {
                await pasteCanvasModel.TryDeleteData(true);
            }), "Delete Reference", "\uE738");

            actions.Add(action_deleteReference);

            return(actions);
        }