Quantcast
Channel: Silverlight 5 forum
Viewing all articles
Browse latest Browse all 1083

Silverlight Webpart not working

$
0
0

I created a Silverlight Webpart on sharepint 2013 to Drop and drag file, but it did not work. 

I also copied this code to a normal website and it worked very well

How can I fix it on Sharepoint 2013?

Thank for your help.

p/s: this is my code:

[Main.xaml]

<UserControl x:Class="SilverlightProject1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <Border CornerRadius="10" Background="AliceBlue" Margin="10" BorderBrush="Gray" BorderThickness="1">
        <Grid x:Name="LayoutRoot" Background="White" >
            <TextBlock AllowDrop="True" Height="100" Width="200" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" TextAlignment="Center" Text="Drop your files here..." Drop="TextBlock_Drop">
            </TextBlock>
        </Grid>
    </Border>
</UserControl>

[code behide]

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SilverlightProject1
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }
        private void TextBlock_Drop(object sender, DragEventArgs e)
        {
            MessageBox.Show("Hohohohoho!");
        }
    }
}


Viewing all articles
Browse latest Browse all 1083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>